mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge bk-internal:/home/bk/mysql-5.0
into mysql.com:/home/jimw/my/mysql-5.0-clean
This commit is contained in:
@ -114,3 +114,26 @@ drop table t1;
|
||||
select hex(cast(0x10 as binary(2)));
|
||||
hex(cast(0x10 as binary(2)))
|
||||
1000
|
||||
create table t1 (b binary(2), vb varbinary(2));
|
||||
insert into t1 values(0x4120, 0x4120);
|
||||
insert into t1 values(0x412020, 0x412020);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'b' at row 1
|
||||
Warning 1265 Data truncated for column 'vb' at row 1
|
||||
drop table t1;
|
||||
create table t1 (c char(2), vc varchar(2));
|
||||
insert into t1 values(0x4120, 0x4120);
|
||||
insert into t1 values(0x412020, 0x412020);
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'vc' at row 1
|
||||
drop table t1;
|
||||
set @old_sql_mode= @@sql_mode, sql_mode= 'traditional';
|
||||
create table t1 (b binary(2), vb varbinary(2));
|
||||
insert into t1 values(0x4120, 0x4120);
|
||||
insert into t1 values(0x412020, NULL);
|
||||
ERROR 22001: Data too long for column 'b' at row 1
|
||||
insert into t1 values(NULL, 0x412020);
|
||||
ERROR 22001: Data too long for column 'vb' at row 1
|
||||
drop table t1;
|
||||
set @@sql_mode= @old_sql_mode;
|
||||
End of 5.0 tests
|
||||
|
@ -68,3 +68,27 @@ drop table t1;
|
||||
|
||||
# check that cast appends trailing zeros
|
||||
select hex(cast(0x10 as binary(2)));
|
||||
|
||||
#
|
||||
# Bug #14299: BINARY space truncation should cause warning or error
|
||||
#
|
||||
create table t1 (b binary(2), vb varbinary(2));
|
||||
insert into t1 values(0x4120, 0x4120);
|
||||
insert into t1 values(0x412020, 0x412020);
|
||||
drop table t1;
|
||||
create table t1 (c char(2), vc varchar(2));
|
||||
insert into t1 values(0x4120, 0x4120);
|
||||
insert into t1 values(0x412020, 0x412020);
|
||||
drop table t1;
|
||||
|
||||
set @old_sql_mode= @@sql_mode, sql_mode= 'traditional';
|
||||
create table t1 (b binary(2), vb varbinary(2));
|
||||
insert into t1 values(0x4120, 0x4120);
|
||||
--error ER_DATA_TOO_LONG
|
||||
insert into t1 values(0x412020, NULL);
|
||||
--error ER_DATA_TOO_LONG
|
||||
insert into t1 values(NULL, 0x412020);
|
||||
drop table t1;
|
||||
set @@sql_mode= @old_sql_mode;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user