Commit 9a5e3e10 authored by davi@endora.local's avatar davi@endora.local
Browse files

Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime

into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
parents 0d4667eb 15409e87
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -108,6 +108,23 @@ drop table t1;
set global binlog_cache_size=@bcs;
set session autocommit = @ac;

#
# Bug#33798: prepared statements improperly handle large unsigned ints
#
--disable_warnings
drop table if exists t1;
--enable_warnings
reset master;
create table t1 (a bigint unsigned, b bigint(20) unsigned);
prepare stmt from "insert into t1 values (?,?)";
set @a= 9999999999999999;
set @b= 14632475938453979136;
execute stmt using @a, @b;
deallocate prepare stmt;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;

--echo End of 5.0 tests

# Test of a too big SET INSERT_ID: see if the truncated value goes
+16 −0
Original line number Diff line number Diff line
@@ -1717,6 +1717,22 @@ t1 CREATE TABLE `t1` (
  `?` decimal(2,1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
drop table if exists t1;
create table t1 (a bigint unsigned, b bigint(20) unsigned);
prepare stmt from "insert into t1 values (?,?)";
set @a= 9999999999999999;
set @b= 14632475938453979136;
insert into t1 values (@a, @b);
select * from t1 where a = @a and b = @b;
a	b
9999999999999999	14632475938453979136
execute stmt using @a, @b;
select * from t1 where a = @a and b = @b;
a	b
9999999999999999	14632475938453979136
9999999999999999	14632475938453979136
deallocate prepare stmt;
drop table t1;
End of 5.0 tests.
create procedure proc_1() reset query cache;
call proc_1();
+16 −0
Original line number Diff line number Diff line
@@ -1072,6 +1072,22 @@ master-bin.000001 30301 Rotate 1 30345 master-bin.000002;pos=4
drop table t1;
set global binlog_cache_size=@bcs;
set session autocommit = @ac;
drop table if exists t1;
reset master;
create table t1 (a bigint unsigned, b bigint(20) unsigned);
prepare stmt from "insert into t1 values (?,?)";
set @a= 9999999999999999;
set @b= 14632475938453979136;
execute stmt using @a, @b;
deallocate prepare stmt;
drop table t1;
show binlog events from 0;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	4	Format_desc	1	106	Server version, Binlog ver: 4
master-bin.000001	106	Query	1	227	use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
master-bin.000001	227	Table_map	1	269	table_id: # (test.t1)
master-bin.000001	269	Write_rows	1	315	table_id: # flags: STMT_END_F
master-bin.000001	315	Query	1	391	use `test`; drop table t1
End of 5.0 tests
reset master;
create table t1 (id tinyint auto_increment primary key);
+15 −0
Original line number Diff line number Diff line
@@ -579,6 +579,21 @@ master-bin.000001 36593 Rotate 1 36637 master-bin.000002;pos=4
drop table t1;
set global binlog_cache_size=@bcs;
set session autocommit = @ac;
drop table if exists t1;
reset master;
create table t1 (a bigint unsigned, b bigint(20) unsigned);
prepare stmt from "insert into t1 values (?,?)";
set @a= 9999999999999999;
set @b= 14632475938453979136;
execute stmt using @a, @b;
deallocate prepare stmt;
drop table t1;
show binlog events from 0;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	4	Format_desc	1	106	Server version, Binlog ver: 4
master-bin.000001	106	Query	1	227	use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
master-bin.000001	227	Query	1	351	use `test`; insert into t1 values (9999999999999999,14632475938453979136)
master-bin.000001	351	Query	1	427	use `test`; drop table t1
End of 5.0 tests
reset master;
create table t1 (id tinyint auto_increment primary key);
+17 −0
Original line number Diff line number Diff line
@@ -1821,6 +1821,23 @@ execute stmt using @a;
show create table t1;
drop table t1;

#
# Bug#33798: prepared statements improperly handle large unsigned ints
#
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (a bigint unsigned, b bigint(20) unsigned);
prepare stmt from "insert into t1 values (?,?)";
set @a= 9999999999999999;
set @b= 14632475938453979136;
insert into t1 values (@a, @b);
select * from t1 where a = @a and b = @b;
execute stmt using @a, @b;
select * from t1 where a = @a and b = @b;
deallocate prepare stmt;
drop table t1;

--echo End of 5.0 tests.

#
Loading