Commit e4e25d2b authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-26423 MariaDB server crash in Create_tmp_table::finalize

Removed prohibition of creating temporary field of Item_default_value
(added by mistake by 1d9b043a fix of
MDEV-10780 and MDEV-11265).
parent c274853c
......@@ -3404,4 +3404,13 @@ ERROR 01000: Expression for field `a` is referring to uninitialized field `a`
show warnings;
Level Code Message
Error 4029 Expression for field `a` is referring to uninitialized field `a`
#
# MDEV-26423: MariaDB server crash in Create_tmp_table::finalize
#
CREATE TABLE t1 (pk varchar(36) DEFAULT uuid());
INSERT INTO t1 VALUES (),();
SELECT 1 FROM t1 GROUP BY DEFAULT(pk);
1
1
DROP TABLE t1;
# end of 10.2 test
#
# MDEV-26423: MariaDB server crash in Create_tmp_table::finalize
#
CREATE TABLE v0 (
v2 DATE DEFAULT ( v1 MOD 68321183.000000 ) ,
v1 DATETIME NULL ) engine=innodb;
SHOW DATABASES LIKE 'x';
Database (x)
SELECT DISTINCT v2 , v1 , DEFAULT ( v2 ) FROM v0;
v2 v1 DEFAULT ( v2 )
DROP TABLE v0;
CREATE TABLE t1 (v1 DATE, v2 DATE DEFAULT(v1)) engine=innodb;
SELECT DISTINCT DEFAULT(v2) FROM t1 ;
DEFAULT(v2)
DROP TABLE t1;
#
# End of 10.2 tests
#
......@@ -2116,4 +2116,13 @@ DROP TABLE t1;
create table t1 (a int as (a));
show warnings;
--echo #
--echo # MDEV-26423: MariaDB server crash in Create_tmp_table::finalize
--echo #
CREATE TABLE t1 (pk varchar(36) DEFAULT uuid());
INSERT INTO t1 VALUES (),();
SELECT 1 FROM t1 GROUP BY DEFAULT(pk);
DROP TABLE t1;
--echo # end of 10.2 test
--source include/have_innodb.inc
--echo #
--echo # MDEV-26423: MariaDB server crash in Create_tmp_table::finalize
--echo #
CREATE TABLE v0 (
v2 DATE DEFAULT ( v1 MOD 68321183.000000 ) ,
v1 DATETIME NULL ) engine=innodb;
SHOW DATABASES LIKE 'x';
SELECT DISTINCT v2 , v1 , DEFAULT ( v2 ) FROM v0;
DROP TABLE v0;
CREATE TABLE t1 (v1 DATE, v2 DATE DEFAULT(v1)) engine=innodb;
SELECT DISTINCT DEFAULT(v2) FROM t1 ;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #
......@@ -5502,7 +5502,6 @@ class Item_default_value : public Item_field
if (field && field->default_value)
field->default_value->expr->update_used_tables();
}
Field *get_tmp_table_field() { return 0; }
Item *get_tmp_table_item(THD *thd) { return this; }
Item_field *field_for_view_update() { return 0; }
bool update_vcol_processor(void *arg) { return 0; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment