diff options
author | Georgi Kodinov <kgeorge@mysql.com> | 2008-12-09 19:46:03 +0200 |
---|---|---|
committer | Georgi Kodinov <kgeorge@mysql.com> | 2008-12-09 19:46:03 +0200 |
commit | bd8657786a185fee54cfbc35b7ef5142e8508073 (patch) | |
tree | 1ca8a7d5afa6e52bb5322471d4f14486076ffde7 /mysql-test/t/select.test | |
parent | c82ff582226749c6049bdbbbdaa2031dc72d343b (diff) | |
download | mariadb-git-bd8657786a185fee54cfbc35b7ef5142e8508073.tar.gz |
Bug #37936: ASSERT_COLUMN_MARKED_FOR_WRITE in Field_datetime::store ,
Field_varstring::store
The code that temporary saved the bitmaps of the read set and the write set so that
it can set it to all columns for debug purposes was not expecting that the
table->read_set and table->write_set can be the same. And was always saving both in
sequence.
As a result the original value was never restored.
Fixed by saving & restoring the original value only once if the two sets are the
same (in a special set of functions).
mysql-test/r/select.result:
Bug #37936: test case
mysql-test/t/select.test:
Bug #37936: test case
sql/item_cmpfunc.cc:
Bug #37936: don't save/restore twice if the read and write sets are the same
sql/opt_range.cc:
Bug #37936: don't save/restore twice if the read and write sets are the same
sql/table.h:
Bug #37936: Make a designated set of functions that save/restore
both the read and the write sets in a single call.
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r-- | mysql-test/t/select.test | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 30abb797e83..020f94699f9 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -3701,3 +3701,36 @@ SELECT a FROM t1 ORDER BY a LIMIT 2; SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296; SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297; DROP TABLE t1; + +# +# Bug #37936: ASSERT_COLUMN_MARKED_FOR_WRITE in Field_datetime::store , +# Field_varstring::store +# + +CREATE TABLE A (date_key date); + +CREATE TABLE C ( + pk int, + int_nokey int, + int_key int, + date_key date NOT NULL, + date_nokey date, + varchar_key varchar(1) +); + +INSERT INTO C VALUES +(1,1,1,'0000-00-00',NULL,NULL), +(1,1,1,'0000-00-00',NULL,NULL); + +SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C); + +SELECT COUNT(DISTINCT 1) FROM C + WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk; +SELECT date_nokey FROM C + WHERE int_key IN (SELECT 1 FROM A) + HAVING date_nokey = '10:41:7' + ORDER BY date_key; + +DROP TABLE A,C; + +--echo End of 5.1 tests |