Commit 250ca1c1 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-13707 Server in ORACLE mode crashes on ALTER with wrong DEFAULT clause

parent dc82f70e
......@@ -3381,4 +3381,11 @@ create table t1 (col1 int default(-(default(col1))));
ERROR 01000: Expression for field `col1` is refering to uninitialized field `col1`
create table t1 (col int default (yearweek((exp(710)))));
ERROR 22003: DOUBLE value is out of range in 'exp(710)'
#
# MDEV-13707 Server in ORACLE mode crashes on ALTER with wrong DEFAULT clause
#
CREATE OR REPLACE TABLE t1(i int);
ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`;
ERROR 42S22: Unknown column 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' in 'DEFAULT'
DROP TABLE t1;
# end of 10.2 test
......@@ -2095,4 +2095,14 @@ create table t1 (col1 int default(-(default(col1))));
--error ER_DATA_OUT_OF_RANGE
create table t1 (col int default (yearweek((exp(710)))));
--echo #
--echo # MDEV-13707 Server in ORACLE mode crashes on ALTER with wrong DEFAULT clause
--echo #
CREATE OR REPLACE TABLE t1(i int);
--error ER_BAD_FIELD_ERROR
ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`;
DROP TABLE t1;
--echo # end of 10.2 test
......@@ -1446,9 +1446,9 @@ static inline
void mark_unsupported_func(const char *where, const char *processor_name)
{
char buff[64];
sprintf(buff, "%s::%s", where ? where: "", processor_name);
my_snprintf(buff, sizeof(buff), "%s::%s", where ? where: "", processor_name);
DBUG_ENTER(buff);
sprintf(buff, "%s returns TRUE: unsupported function", processor_name);
my_snprintf(buff, sizeof(buff), "%s returns TRUE: unsupported function", processor_name);
DBUG_PRINT("info", ("%s", buff));
DBUG_VOID_RETURN;
}
......
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