1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-11 05:52:26 +03:00

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.
This commit is contained in:
thek@adventure.(none)
2007-05-18 12:44:03 +02:00
parent e22cbec571
commit 637f85ca21
12 changed files with 1641 additions and 1564 deletions

View File

@@ -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