summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2005-09-28 00:58:12 +0400
committerunknown <evgen@moonbone.local>2005-09-28 00:58:12 +0400
commita17b3dcbe3d86eaaaabe627139ed09c35828d61c (patch)
treee05cb19624737e0de739d19431a2384437485cb1 /mysql-test
parentab7ec7ee8f4ac8c751c6f0d84d8314154146bf10 (diff)
downloadmariadb-git-a17b3dcbe3d86eaaaabe627139ed09c35828d61c.tar.gz
Fix bug#13356 resolve_const_item() wasn't able to handle Item_row items.
resolve_const_item() assumed to be not called for Item_row items. For ensuring that DBUG_ASSERT(0) was set there. This patch adds section for Item_row items. If it can it recursively calls resolve_const_item() for each item the Item_row contains. If any of the contained items is null then whole Item_row substitued by Item_null. Otherwise it just returns. sql/item.cc: Fix bug#13356 resolve_const_item() wasn't able to handle Item_row items. Added section to resolve_const_item() for Item_row items. If it can it recursively calls resolve_const_item() for each item the Item_row contains. If any of the contained items is null then Item_row is substituted by Item_null. Otherwise it just returns. Comment moved closer to function it belongs to. mysql-test/t/select.test: Test case for bug#13356 resolve_const_item() wasn't able to handle Item_row items. mysql-test/r/select.result: Test case for bug#13356 resolve_const_item() wasn't able to handle Item_row items.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/select.result9
-rw-r--r--mysql-test/t/select.test10
2 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 993fe7d22f1..64cbaf4fa67 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2617,3 +2617,12 @@ select found_rows();
found_rows()
1
DROP TABLE t1;
+create table t1(f1 int, f2 int);
+create table t2(f3 int);
+select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1));
+f1
+select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1));
+f1
+select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL));
+f1
+drop table t1,t2;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index b51ea89c7dd..bdadd5c536b 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2164,4 +2164,14 @@ select found_rows();
DROP TABLE t1;
+#
+# Bug #13356 assertion failed in resolve_const_item()
+#
+create table t1(f1 int, f2 int);
+create table t2(f3 int);
+select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1));
+select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1));
+select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL));
+drop table t1,t2;
+
# End of 4.1 tests