summaryrefslogtreecommitdiff
path: root/mysql-test/r/type_date.result
diff options
context:
space:
mode:
authorthek@adventure.(none) <>2007-05-18 12:44:03 +0200
committerthek@adventure.(none) <>2007-05-18 12:44:03 +0200
commit637f85ca21a5d776a5c9ced149b9c7088123c2c5 (patch)
tree8813ca4bdc7ac37e0e63cf0fc7df420a2b11353e /mysql-test/r/type_date.result
parente22cbec571d657db1e068c60e92a89438c72cccb (diff)
downloadmariadb-git-637f85ca21a5d776a5c9ced149b9c7088123c2c5.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.
Diffstat (limited to 'mysql-test/r/type_date.result')
-rw-r--r--mysql-test/r/type_date.result27
1 files changed, 18 insertions, 9 deletions
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 6d5218873ce..d6a01727813 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -110,15 +110,24 @@ select 1 from t1 where cast('2000-01-01 12:01:01' as datetime) between start_dat
1
1
drop table t1;
-select @d:=1111, year(@d), month(@d), day(@d), cast(@d as date);
-@d:=1111 year(@d) month(@d) day(@d) cast(@d as date)
-1111 2000 11 11 2000-11-11
-select @d:=011111, year(@d), month(@d), day(@d), cast(@d as date);
-@d:=011111 year(@d) month(@d) day(@d) cast(@d as date)
-11111 2001 11 11 2001-11-11
-select @d:=1311, year(@d), month(@d), day(@d), cast(@d as date);
-@d:=1311 year(@d) month(@d) day(@d) cast(@d as date)
-1311 NULL NULL NULL NULL
+select @d:=1111;
+@d:=1111
+1111
+select year(@d), month(@d), day(@d), cast(@d as date);
+year(@d) month(@d) day(@d) cast(@d as date)
+2000 11 11 2000-11-11
+select @d:=011111;
+@d:=011111
+11111
+select year(@d), month(@d), day(@d), cast(@d as date);
+year(@d) month(@d) day(@d) cast(@d as date)
+2001 11 11 2001-11-11
+select @d:=1311;
+@d:=1311
+1311
+select year(@d), month(@d), day(@d), cast(@d as date);
+year(@d) month(@d) day(@d) cast(@d as date)
+NULL NULL NULL NULL
Warnings:
Warning 1292 Incorrect datetime value: '1311'
Warning 1292 Incorrect datetime value: '1311'