diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2004-01-22 22:13:24 +0200 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2004-01-22 22:13:24 +0200 |
commit | 989cb2f29bc54d4b7e8181d11f8c37d7a358ec51 (patch) | |
tree | 7ed1d8cb63ddba8857e5df7db5d334144886a454 | |
parent | d0123ed5d2eee00c3534e843e8050fd28059c150 (diff) | |
download | mariadb-git-989cb2f29bc54d4b7e8181d11f8c37d7a358ec51.tar.gz |
Fix for a bug #2422, where CONVERT(expr, cast) was masked by
CONVERT(expr, expr, expr);
mysql-test/t/mysqldump.test:
fix for my previous result fix of Jani's changes.
-rw-r--r-- | mysql-test/r/cast.result | 3 | ||||
-rw-r--r-- | mysql-test/t/cast.test | 1 | ||||
-rw-r--r-- | mysql-test/t/mysqldump.test | 12 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 12 |
4 files changed, 12 insertions, 16 deletions
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 24d33e79411..893452290b2 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -33,6 +33,9 @@ cast("2001-1-1" as DATE) cast("2001-1-1" as DATETIME) select cast("1:2:3" as TIME); cast("1:2:3" as TIME) 01:02:03 +select CONVERT("2004-01-22 21:45:33",DATE); +CONVERT("2004-01-22 21:45:33",DATE) +2004-01-22 set names binary; select cast(_latin1'test' as char character set latin2); cast(_latin1'test' as char character set latin2) diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index cb5f10515bd..e1cfe5760ee 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -13,6 +13,7 @@ select cast(5 as unsigned) -6.0; select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A"; select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME); select cast("1:2:3" as TIME); +select CONVERT("2004-01-22 21:45:33",DATE); # # Character set convertion diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 21004c8c305..93b0dd4a75d 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -6,7 +6,7 @@ DROP TABLE IF EXISTS t1, `"t"1`; CREATE TABLE t1(a int); INSERT INTO t1 VALUES (1), (2); ---exec $MYSQL_DUMP --disable-quote --skip-all --skip-comments -X test t1 +--exec $MYSQL_DUMP --skip-all --skip-comments -X test t1 DROP TABLE t1; # @@ -16,7 +16,7 @@ DROP TABLE t1; CREATE TABLE t1 (a decimal(240, 20)); INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"), ("0987654321098765432109876543210987654321"); ---exec $MYSQL_DUMP --disable-quote --skip-comments test t1 +--exec $MYSQL_DUMP --skip-comments test t1 DROP TABLE t1; # @@ -28,12 +28,12 @@ INSERT INTO t1 VALUES (-9e999999); # The following replaces is here because some systems replaces the above # double with '-inf' and others with MAX_DOUBLE --replace_result (-1.79769313486232e+308) (RES) (NULL) (RES) ---exec $MYSQL_DUMP --disable-quote --skip-comments test t1 +--exec $MYSQL_DUMP --skip-comments test t1 DROP TABLE t1; CREATE TABLE t1(a int, b text, c varchar(3)); INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES"); ---exec $MYSQL_DUMP --disable-quote --skip-all --skip-comments -X test t1 +--exec $MYSQL_DUMP --skip-all --skip-comments -X test t1 DROP TABLE t1; # @@ -42,7 +42,7 @@ DROP TABLE t1; CREATE TABLE t1 (`a"b"` char(2)); INSERT INTO t1 VALUES ("1\""), ("\"2"); ---exec $MYSQL_DUMP --disable-quote --skip-all --skip-comments -X test t1 +--exec $MYSQL_DUMP --skip-all --skip-comments -X test t1 DROP TABLE t1; # @@ -51,5 +51,5 @@ DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r; INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'); ---exec $MYSQL_DUMP --disable-quote --skip-comments test t1 +--exec $MYSQL_DUMP --skip-comments test t1 DROP TABLE t1; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 5ab53a1b934..fe8f0b2b2ee 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -664,7 +664,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %type <ha_rkey_mode> handler_rkey_mode -%type <cast_type> cast_type cast_type_finalize +%type <cast_type> cast_type %type <udf_type> udf_func_type @@ -3003,11 +3003,7 @@ in_sum_expr: $$= $3; }; -cast_type_init: - { Lex->charset= NULL; Lex->length= (char*)0; } - ; - -cast_type_finalize: +cast_type: BINARY { $$=ITEM_CAST_BINARY; } | CHAR_SYM opt_len opt_binary { $$=ITEM_CAST_CHAR; } | NCHAR_SYM opt_len { $$=ITEM_CAST_CHAR; Lex->charset= national_charset_info; } @@ -3020,10 +3016,6 @@ cast_type_finalize: | DATETIME { $$=ITEM_CAST_DATETIME; } ; -cast_type: - cast_type_init cast_type_finalize { $$= $2; } - ; - expr_list: { Select->expr_list.push_front(new List<Item>); } expr_list2 |