diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-01-26 21:49:19 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-01-26 21:49:19 +0100 |
commit | 90e2240869b9e0eba4fb8a87003e0d001872228e (patch) | |
tree | c8e7176248ea35f8b3e635d90dc85492a34af868 /mysql-test/t/group_by_null.test | |
parent | 3f2f9c36b16ad88d34a400f92cbb61e77a6ae63c (diff) | |
download | mariadb-git-90e2240869b9e0eba4fb8a87003e0d001872228e.tar.gz |
MDEV-5461 Assertion `length <= column->length' fails in write_block_record with functions in select list, GROUP BY, ORDER BY
Old code in create_tmp_table(), that created an extra one-byte field (recinfo)
before every NULL-able grouping field (Field) in the tmp table, did not actually work.
Because the matching code in end_update(), that was supposed to update this byte,
was using a wrong offset, updating the first byte of the Field, not a byte before it.
Normally this wasn't an issue, because the Field value (written later in end_update)
was overwriting this byte anyway. But in this bug the Field was Field_null, with zero
length, so end_update() was overwriting the first byte of the following field.
And the following field was not-nullable constant, which was stored only once in
create_tmp_table and never updated later.
Fixed by removing the code that didn't do any useful work anyway.
Diffstat (limited to 'mysql-test/t/group_by_null.test')
-rw-r--r-- | mysql-test/t/group_by_null.test | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/t/group_by_null.test b/mysql-test/t/group_by_null.test new file mode 100644 index 00000000000..b3fa2a003ec --- /dev/null +++ b/mysql-test/t/group_by_null.test @@ -0,0 +1,7 @@ +# +# MDEV-5461 Assertion `length <= column->length' fails in write_block_record with functions in select list, GROUP BY, ORDER BY +# +create table t1 (a int); +insert into t1 values (1),(2); +select max('foo') from t1 group by values(a), extractvalue('bar','qux') order by "v"; +drop table t1; |