summaryrefslogtreecommitdiff
path: root/mysql-test/r/user_var.result
diff options
context:
space:
mode:
authorunknown <thek@adventure.(none)>2007-05-18 12:44:03 +0200
committerunknown <thek@adventure.(none)>2007-05-18 12:44:03 +0200
commit755ae21b826d6e644560b0ad397eb46cd7191369 (patch)
tree8813ca4bdc7ac37e0e63cf0fc7df420a2b11353e /mysql-test/r/user_var.result
parent1513cd0933f73356fb9461c343ef8b2c39c1e0a0 (diff)
downloadmariadb-git-755ae21b826d6e644560b0ad397eb46cd7191369.tar.gz
Bug#26277 User variable returns one type in SELECT @v and other for CREATE as SELECT @v
- Adding variable m_cached_result_type to keep the variable type consistent during the execution of a statement. - Before each result set is returned to the client the description of each column is sent as meta data. Previously the result type for a column could change if the hash variable entry changed between statements. This caused the result set of the query to alternate column types in certain cases which is not supported by MySQL client-server protocol. Example: Previously this sequence: SET @a:=1; SELECT @a:="text", @a; would return "text", "text"; After the change the SELECT returns "text", 0 The reson for this is that previously the result set from 'SELECT @a;' would always be of the type STRING, whereas now the type of the variable is taken from the last SET statement. However, 'SELECT @a:="text"' will return type of STRING since the right side of the assignment is used. mysql-test/r/ps_2myisam.result: Changed test result because SQL type of a user variable now more accurately represents its Item type: since Item type of a variable can be either STRING, INT, DECIMAL or DOUBLE, SQL type of the result set metadata now can be either MYSQL_TYPE_VARCHAR, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_NEWDECIMAL or MYSQL_TYPE_DOUBLE. Previously it was always MYSQL_TYPE_VARCHAR. In particular, integer variables now have changed from MYSQL_TYPE_VARCHAR to MYSQL_TYPE_LONGLONG. mysql-test/r/ps_3innodb.result: Changed test result because SQL type of a user variable now more accurately represents its Item type: since Item type of a variable can be either STRING, INT, DECIMAL or DOUBLE, SQL type of the result set metadata now can be either MYSQL_TYPE_VARCHAR, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_NEWDECIMAL or MYSQL_TYPE_DOUBLE. Previously it was always MYSQL_TYPE_VARCHAR. In particular, integer variables now have changed from MYSQL_TYPE_VARCHAR to MYSQL_TYPE_LONGLONG. mysql-test/r/ps_4heap.result: Changed test result because SQL type of a user variable now more accurately represents its Item type: since Item type of a variable can be either STRING, INT, DECIMAL or DOUBLE, SQL type of the result set metadata now can be either MYSQL_TYPE_VARCHAR, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_NEWDECIMAL or MYSQL_TYPE_DOUBLE. Previously it was always MYSQL_TYPE_VARCHAR. In particular, integer variables now have changed from MYSQL_TYPE_VARCHAR to MYSQL_TYPE_LONGLONG. mysql-test/r/ps_5merge.result: Changed test result because SQL type of a user variable now more accurately represents its Item type: since Item type of a variable can be either STRING, INT, DECIMAL or DOUBLE, SQL type of the result set metadata now can be either MYSQL_TYPE_VARCHAR, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_NEWDECIMAL or MYSQL_TYPE_DOUBLE. Previously it was always MYSQL_TYPE_VARCHAR. In particular, integer variables now have changed from MYSQL_TYPE_VARCHAR to MYSQL_TYPE_LONGLONG. mysql-test/r/ps_7ndb.result: Changed test result because SQL type of a user variable now more accurately represents its Item type: since Item type of a variable can be either STRING, INT, DECIMAL or DOUBLE, SQL type of the result set metadata now can be either MYSQL_TYPE_VARCHAR, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_NEWDECIMAL or MYSQL_TYPE_DOUBLE. Previously it was always MYSQL_TYPE_VARCHAR. In particular, integer variables now have changed from MYSQL_TYPE_VARCHAR to MYSQL_TYPE_LONGLONG. mysql-test/r/sp-vars.result: Added test case. Previously variables could change their variable type during the execution of a statement. Which variable type to use in the statement is specified in any previous statement. mysql-test/r/type_date.result: This test case result is changed because it is no longer allowed for user variables to change their variable type during the execution of a statement. The determination of which variable type to use in the statement is specified in any previous statement. mysql-test/r/user_var.result: This test case result is changed because it is no longer allowed for user variables to change their variable type during the execution of a statement. The determination of which variable type to use in the statement is specified in any previous statement. mysql-test/t/sp-vars.test: Added test case. Previously variables could change their variable type during the execution of a statement. Which variable type to use in the statement is specified in any previous statement. mysql-test/t/type_date.test: This test case result is changed because it is no longer allowed for user variables to change their variable type during the execution of a statement. The determination of which variable type to use in the statement is specified in any previous statement. sql/item_func.cc: Adding variable m_cached_result_type to keep the variable type consistent during the execution of a statement. Previously the result type could change if the hash variable entry changed between statements. This caused the result set of the query to alternate column types in certain cases. sql/item_func.h: Adding variable m_cached_result_type to keep the variable type consistent during the execution of a statement. Previously the result type could change if the hash variable entry changed between statements. This caused the result set of the query to alternate column types in certain cases.
Diffstat (limited to 'mysql-test/r/user_var.result')
-rw-r--r--mysql-test/r/user_var.result2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 3a70dcddd24..5e9c62a1fb3 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -91,7 +91,7 @@ NULL test test
set @g=1;
select @g,(@g:=c),@g from t1;
@g (@g:=c) @g
-1 test test
+1 test 0
select @c, @d, @e, @f;
@c @d @e @f
1 1 2 test