Commit a20c1217 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-14435 Different UNSIGNED flag of out user variable for YEAR parameter for...

MDEV-14435 Different UNSIGNED flag of out user variable for YEAR parameter for direct vs prepared CALL
parent 4c2c5ec9
......@@ -3388,7 +3388,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` bigint(20) DEFAULT NULL
`c1` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = b'10100100101';
@a @a = b'10100100101'
......@@ -3478,7 +3478,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` bigint(20) DEFAULT NULL
`c1` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = 2010;
@a @a = 2010
......@@ -5029,3 +5029,48 @@ COERCIBILITY(?)
EXECUTE IMMEDIATE "SELECT COERCIBILITY(?)" USING TIMESTAMP'2001-01-01 10:20:30';
COERCIBILITY(?)
5
#
# MDEV-14435 Different UNSIGNED flag of out user variable for YEAR parameter for direct vs prepared CALL
#
CREATE PROCEDURE p1(OUT v INT UNSIGNED) SET v = 2010;
CALL p1(@a);
PREPARE stmt FROM 'CALL p1(?)';
EXECUTE stmt USING @b;
DEALLOCATE PREPARE stmt;
CREATE TABLE t1 AS SELECT @a AS a, @b AS b;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned DEFAULT NULL,
`b` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT v YEAR) SET v = 2010;
CALL p1(@a);
PREPARE stmt FROM 'CALL p1(?)';
EXECUTE stmt USING @b;
DEALLOCATE PREPARE stmt;
CREATE TABLE t1 AS SELECT @a AS a, @b AS b;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned DEFAULT NULL,
`b` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT v BIT(16)) SET v = 2010;
CALL p1(@a);
PREPARE stmt FROM 'CALL p1(?)';
EXECUTE stmt USING @b;
DEALLOCATE PREPARE stmt;
CREATE TABLE t1 AS SELECT @a AS a, @b AS b;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned DEFAULT NULL,
`b` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
......@@ -4495,3 +4495,37 @@ EXECUTE IMMEDIATE "SELECT COERCIBILITY(?)" USING 5.5;
EXECUTE IMMEDIATE "SELECT COERCIBILITY(?)" USING 5.5e0;
EXECUTE IMMEDIATE "SELECT COERCIBILITY(?)" USING TIME'10:20:30';
EXECUTE IMMEDIATE "SELECT COERCIBILITY(?)" USING TIMESTAMP'2001-01-01 10:20:30';
--echo #
--echo # MDEV-14435 Different UNSIGNED flag of out user variable for YEAR parameter for direct vs prepared CALL
--echo #
CREATE PROCEDURE p1(OUT v INT UNSIGNED) SET v = 2010;
CALL p1(@a);
PREPARE stmt FROM 'CALL p1(?)';
EXECUTE stmt USING @b;
DEALLOCATE PREPARE stmt;
CREATE TABLE t1 AS SELECT @a AS a, @b AS b;
SHOW CREATE TABLE t1;
DROP TABLE t1;
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT v YEAR) SET v = 2010;
CALL p1(@a);
PREPARE stmt FROM 'CALL p1(?)';
EXECUTE stmt USING @b;
DEALLOCATE PREPARE stmt;
CREATE TABLE t1 AS SELECT @a AS a, @b AS b;
SHOW CREATE TABLE t1;
DROP TABLE t1;
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT v BIT(16)) SET v = 2010;
CALL p1(@a);
PREPARE stmt FROM 'CALL p1(?)';
EXECUTE stmt USING @b;
DEALLOCATE PREPARE stmt;
CREATE TABLE t1 AS SELECT @a AS a, @b AS b;
SHOW CREATE TABLE t1;
DROP TABLE t1;
DROP PROCEDURE p1;
......@@ -4247,6 +4247,7 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it)
}
null_value= FALSE;
unsigned_flag= arg->unsigned_flag;
switch (arg->result_type()) {
case STRING_RESULT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment