MySQL Forums
Forum List  »  Partitioning

Constant, random or timezone-dependent expressions in (sub)partitioning
Posted by: Carlo Rossetti
Date: September 18, 2011 02:39AM

Good morning,
i have this strange trouble.

MySQL VERSION: 5.5.15-LOG on window xp 32 bit.

CREATE TABLE `t_test` (
`marca_id` CHAR(5) NOT NULL DEFAULT '000'
) ENGINE=MYISAM DEFAULT CHARSET=utf8

INSERT INTO t_test
(marca_id)
VALUES ('001'),('002'),('002'),('003'),('003'),('004'),('006'),('009');

DROP FUNCTION IF EXISTS `IdToHash`;

DELIMITER $$

CREATE
FUNCTION `IdToHash`(stringid CHAR(6))
RETURNS INT DETERMINISTIC
BEGIN

RETURN CAST(stringid AS SIGNED);

END$$

DELIMITER;

this is all good, but when i add a partition:

ALTER TABLE t_test
PARTITION BY HASH(`IdToHash`(marca_id));

I obtain this error:

Query : ALTER TABLE t_test PARTITION BY HASH(`ru2a_daticase`.`IdToHash`(marca_id))

Error Code : 1064
Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')

I don't understand this kind of error. Any idea?

Thank to everyone for your patience.

C.



Edited 1 time(s). Last edit at 09/18/2011 03:23AM by Carlo Rossetti.

Options: ReplyQuote


Subject
Views
Written By
Posted
Constant, random or timezone-dependent expressions in (sub)partitioning
7830
September 18, 2011 02:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.