mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug #6552 CHAR column w/o length is legal, BINARY w/o length is not
This commit is contained in:
@ -134,3 +134,10 @@ select * from t1 where firstname='john' and firstname like binary 'John';
|
|||||||
firstname lastname
|
firstname lastname
|
||||||
John Doe
|
John Doe
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 (a binary);
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` binary(1) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
|
@ -80,3 +80,10 @@ select * from t1 where firstname='john' and firstname = binary 'john';
|
|||||||
select * from t1 where firstname='John' and firstname like binary 'john';
|
select * from t1 where firstname='John' and firstname like binary 'john';
|
||||||
select * from t1 where firstname='john' and firstname like binary 'John';
|
select * from t1 where firstname='john' and firstname like binary 'John';
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #6552 CHAR column w/o length is legal, BINARY w/o length is not
|
||||||
|
#
|
||||||
|
create table t1 (a binary);
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
@ -1402,6 +1402,9 @@ type:
|
|||||||
| BINARY '(' NUM ')' { Lex->length=$3.str;
|
| BINARY '(' NUM ')' { Lex->length=$3.str;
|
||||||
Lex->charset=&my_charset_bin;
|
Lex->charset=&my_charset_bin;
|
||||||
$$=FIELD_TYPE_STRING; }
|
$$=FIELD_TYPE_STRING; }
|
||||||
|
| BINARY { Lex->length= (char*) "1";
|
||||||
|
Lex->charset=&my_charset_bin;
|
||||||
|
$$=FIELD_TYPE_STRING; }
|
||||||
| varchar '(' NUM ')' opt_binary { Lex->length=$3.str;
|
| varchar '(' NUM ')' opt_binary { Lex->length=$3.str;
|
||||||
$$=FIELD_TYPE_VAR_STRING; }
|
$$=FIELD_TYPE_VAR_STRING; }
|
||||||
| nvarchar '(' NUM ')' { Lex->length=$3.str;
|
| nvarchar '(' NUM ')' { Lex->length=$3.str;
|
||||||
|
Reference in New Issue
Block a user