summaryrefslogtreecommitdiff
path: root/mysql-test/t/ps.test
diff options
context:
space:
mode:
authorunknown <davi@mysql.com/endora.local>2008-02-08 08:55:55 -0200
committerunknown <davi@mysql.com/endora.local>2008-02-08 08:55:55 -0200
commit7d98c21cdf4235ebe0d4abc52ae71fa4502e1524 (patch)
tree28f57af5a942642f4bd2414edc9384f97fc6f01e /mysql-test/t/ps.test
parent32ae4aefe6e661dbbb28509fcd2bfe4c487faa54 (diff)
downloadmariadb-git-7d98c21cdf4235ebe0d4abc52ae71fa4502e1524.tar.gz
Bug#33798 prepared statements improperly handle large unsigned ints
The unsignedness of large integer user variables was not being properly preserved when feeded to prepared statements. This was happening because the unsigned flags wasn't being updated when converting the user variable is converted to a parameter. The solution is to copy the unsigned flag when converting the user variable to a parameter and take the unsigned flag into account when converting the integer to a string. mysql-test/r/binlog.result: Add test case result for Bug#33798 mysql-test/r/ps.result: Add test case result for Bug#33798 mysql-test/t/binlog.test: Add test case for Bug#33798 mysql-test/t/ps.test: Add test case for Bug#33798 sql/item.cc: Take the unsigned flag into account when converting the user variable.
Diffstat (limited to 'mysql-test/t/ps.test')
-rw-r--r--mysql-test/t/ps.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index c1505ffd645..3f4b37f13f4 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -1807,4 +1807,21 @@ 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.