Commit fb43180c authored by Alexander Barkov's avatar Alexander Barkov

Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext

parents 48c59f39 c5520a37
......@@ -154,7 +154,6 @@ INCLUDE(ssl)
INCLUDE(readline)
INCLUDE(libutils)
INCLUDE(dtrace)
INCLUDE(jemalloc)
INCLUDE(pcre)
INCLUDE(ctest)
INCLUDE(plugin)
......@@ -313,7 +312,7 @@ IF(NOT HAVE_CXX_NEW)
ENDIF()
# Find header files from the bundled libraries
# (jemalloc, yassl, readline, pcre, etc)
# (yassl, readline, pcre, etc)
# before the ones installed in the system
SET(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
......@@ -329,7 +328,6 @@ MYSQL_CHECK_SSL()
MYSQL_CHECK_READLINE()
SET(MALLOC_LIBRARY "system")
CHECK_JEMALLOC()
CHECK_PCRE()
......
This diff is collapsed.
......@@ -27,7 +27,10 @@ ENDIF()
IF(SIZEOF_VOIDP EQUAL 8)
SET(64BIT 1)
ENDIF()
# include aws_key_management plugin in release builds
OPTION(AWS_SDK_EXTERNAL_PROJECT "Allow download and build AWS C++ SDK" ON)
SET(FEATURE_SET "community" CACHE STRING
" Selection of features. Options are
- xsmall :
......
......@@ -1071,6 +1071,7 @@ typedef ulong myf; /* Type of MyFlags in my_funcs */
#ifdef _WIN32
#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
#define RTLD_DEFAULT GetModuleHandle(NULL)
#define dlclose(lib) FreeLibrary((HMODULE)lib)
static inline char *dlerror(void)
{
......
......@@ -673,7 +673,7 @@ extern void my_mutex_end(void);
We need to have at least 256K stack to handle calls to myisamchk_init()
with the current number of keys and key parts.
*/
#define DEFAULT_THREAD_STACK (291*1024L)
#define DEFAULT_THREAD_STACK (292*1024L)
#endif
#define MY_PTHREAD_LOCK_READ 0
......
......@@ -131,3 +131,12 @@ t1 CREATE TABLE `t1` (
CONSTRAINT `CONSTRAINT_2` CHECK (`a` > `b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1(c1 int, c2 int as (c1 + 1), check (c2 > 2));
insert into t1(c1) values(1);
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
insert into t1(c1) values(2);
drop table t1;
create table t1 (a int, b int, check(a>0));
alter table t1 drop column a;
ERROR 42S22: Unknown column 'a' in 'CHECK'
drop table t1;
......@@ -2419,3 +2419,144 @@ ANALYZE
}
}
}
#
# mdev-12360: recursive reference in left operand of LEFT JOIN
#
create table folks(id int, name char(32), dob date, father int, mother int);
insert into folks values
(100, 'Me', '2000-01-01', 20, 30),
(20, 'Dad', '1970-02-02', 10, 9),
(30, 'Mom', '1975-03-03', 8, 7),
(10, 'Grandpa Bill', '1940-04-05', null, null),
(9, 'Grandma Ann', '1941-10-15', null, null),
(25, 'Uncle Jim', '1968-11-18', 8, 7),
(98, 'Sister Amy', '2001-06-20', 20, 30),
(7, 'Grandma Sally', '1943-08-23', null, 6),
(8, 'Grandpa Ben', '1940-10-21', null, null),
(6, 'Grandgrandma Martha', '1923-05-17', null, null),
(67, 'Cousin Eddie', '1992-02-28', 25, 27),
(27, 'Auntie Melinda', '1971-03-29', null, null);
with recursive
ancestor_ids (id)
as
(
select father from folks where name = 'Me'
union
select mother from folks where name = 'Me'
union
select father from ancestor_ids as a left join folks on folks.id = a.id
union
select mother from ancestor_ids as a left join folks on folks.id = a.id
),
ancestors
as
(
select p.* from folks as p, ancestor_ids as a
where p.id = a.id
)
select * from ancestors;
id name dob father mother
20 Dad 1970-02-02 10 9
30 Mom 1975-03-03 8 7
10 Grandpa Bill 1940-04-05 NULL NULL
9 Grandma Ann 1941-10-15 NULL NULL
7 Grandma Sally 1943-08-23 NULL 6
8 Grandpa Ben 1940-10-21 NULL NULL
6 Grandgrandma Martha 1923-05-17 NULL NULL
drop table folks;
#
# mdev-12368: crash with mutually recursive CTE
# that arenot Standard compliant
#
create table value_nodes (v char(4));
create table module_nodes(m char(4));
create table module_arguments(m char(4), v char(4));
create table module_results(m char(4), v char(4));
with recursive
reached_values as
(
select v from value_nodes where v in ('v3','v7','v9')
union
select module_results.v from module_results, applied_modules
where module_results.m = applied_modules.m
),
applied_modules as
(
select module_nodes.m
from
module_nodes
left join
(
module_arguments
left join
reached_values
on module_arguments.v = reached_values.v
)
on reached_values.v is null and
module_nodes.m = module_arguments.m
where module_arguments.m is null
)
select * from reached_values;
ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'applied_modules'
drop table value_nodes, module_nodes, module_arguments, module_results;
#
# mdev-12375: query using one of two mutually recursive CTEs
# whose non-recursive part returns an empty set
#
create table value_nodes (v char(4));
insert into value_nodes values
('v1'), ('v2'), ('v3'), ('v4'), ('v5'), ('v6'), ('v7'), ('v8'), ('v9'),
('v10'), ('v11'), ('v12'), ('v13'), ('v14'), ('v15'), ('v16');
create table module_nodes(m char(4));
insert into module_nodes values
('m1'), ('m2'), ('m3'), ('m4'), ('m5'), ('m6'), ('m7');
create table module_arguments(m char(4), v char(4));
insert into module_arguments values
('m1','v3'), ('m1','v9'),
('m2','v4'), ('m2','v3'), ('m2','v7'),
('m3','v6'),
('m4','v4'), ('m4','v1'),
('m5','v10'), ('m5','v8'), ('m5','v3'),
('m6','v8'), ('m6','v1'),
('m7','v11'), ('m7','v12');
create table module_results(m char(4), v char(4));
insert into module_results values
('m1','v4'),
('m2','v1'), ('m2','v6'),
('m3','v10'),
('m4','v8'),
('m5','v11'), ('m5','v9'),
('m6','v12'), ('m6','v4'),
('m7','v2');
set statement max_recursive_iterations=2, standard_compliant_cte=0 for
with recursive
reached_values as
(
select v from value_nodes where v in ('v3','v7','v9')
union
select module_results.v from module_results, applied_modules
where module_results.m = applied_modules.m
),
applied_modules as
(
select * from module_nodes where 1=0
union
select module_nodes.m
from
module_nodes
left join
(
module_arguments
left join
reached_values
on module_arguments.v = reached_values.v
)
on reached_values.v is null and
module_nodes.m = module_arguments.m
where module_arguments.m is null
)
select * from applied_modules;
m
m1
m2
drop table value_nodes, module_nodes, module_arguments, module_results;
......@@ -541,10 +541,10 @@ DROP FUNCTION f1;
CREATE PROCEDURE p1(par INT) CREATE TABLE t1 (a INT DEFAULT par);
ERROR HY000: Function or expression 'par' cannot be used in the DEFAULT clause of `a`
CREATE TABLE t1 (a INT DEFAULT par);
ERROR 42S22: Unknown column 'par' in 'virtual column function'
ERROR 42S22: Unknown column 'par' in 'DEFAULT'
CREATE PROCEDURE p1() CREATE TABLE t1 (a INT DEFAULT par);
CALL p1;
ERROR 42S22: Unknown column 'par' in 'virtual column function'
ERROR 42S22: Unknown column 'par' in 'DEFAULT'
DROP PROCEDURE p1;
CREATE TABLE t1 (a INT DEFAULT VALUES(a));
ERROR HY000: Function or expression 'values()' cannot be used in the DEFAULT clause of `a`
......@@ -3355,4 +3355,6 @@ a b t
drop table t1;
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)'
# end of 10.2 test
......@@ -222,8 +222,8 @@ Field Type Collation Null Key Default Extra Privileges Comment
c varchar(64) utf8_general_ci NO select,insert,update,references
select * from information_schema.COLUMNS where table_name="t1"
and column_name= "a";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
def mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
def mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
show columns from mysqltest.t1 where field like "%a%";
Field Type Null Key Default Extra
a int(11) YES NULL
......@@ -844,6 +844,7 @@ table_schema table_name column_name
information_schema ALL_PLUGINS PLUGIN_DESCRIPTION
information_schema COLUMNS COLUMN_DEFAULT
information_schema COLUMNS COLUMN_TYPE
information_schema COLUMNS GENERATION_EXPRESSION
information_schema EVENTS EVENT_DEFINITION
information_schema PARAMETERS DTD_IDENTIFIER
information_schema PARTITIONS PARTITION_EXPRESSION
......@@ -1577,9 +1578,9 @@ WHERE TABLE_SCHEMA='mysql' and TABLE_NAME= 'db';
TABLE_COLLATION
utf8_bin
select * from information_schema.columns where table_schema = NULL;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
select * from `information_schema`.`COLUMNS` where `TABLE_NAME` = NULL;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
select * from `information_schema`.`KEY_COLUMN_USAGE` where `TABLE_SCHEMA` = NULL;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
select * from `information_schema`.`KEY_COLUMN_USAGE` where `TABLE_NAME` = NULL;
......@@ -1920,7 +1921,7 @@ LEFT JOIN INFORMATION_SCHEMA.COLUMNS
USING (TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME)
WHERE COLUMNS.TABLE_SCHEMA = 'test'
AND COLUMNS.TABLE_NAME = 't1';
TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
#
# A test case for Bug#56540 "Exception (crash) in sql_show.cc
# during rqg_info_schema test on Windows"
......
......@@ -44,6 +44,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -64,6 +66,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -84,6 +88,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -104,6 +110,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -124,6 +132,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -144,6 +154,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -164,6 +176,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -184,6 +198,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -204,6 +220,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -224,6 +242,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -244,6 +264,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -264,6 +286,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -284,6 +308,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -304,6 +330,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -324,6 +352,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
......@@ -344,6 +374,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
DESCRIBE INFORMATION_SCHEMA.PARAMETERS;
Field Type Null Key Default Extra
SPECIFIC_CATALOG varchar(512) NO
......
......@@ -61,6 +61,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -81,6 +83,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -101,6 +105,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -121,6 +127,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -141,6 +149,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -161,6 +171,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -181,6 +193,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -201,6 +215,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -221,6 +237,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -241,6 +259,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -261,6 +281,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -281,6 +303,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -301,6 +325,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -321,6 +347,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -341,6 +369,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -361,6 +391,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -381,6 +413,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -401,6 +435,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -421,6 +457,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -441,6 +479,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -461,6 +501,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -481,6 +523,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -501,6 +545,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -521,6 +567,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -541,6 +589,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -561,6 +611,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -581,6 +633,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -601,6 +655,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -621,6 +677,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -641,6 +699,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
......@@ -661,6 +721,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
DESCRIBE INFORMATION_SCHEMA.ROUTINES;
Field Type Null Key Default Extra
SPECIFIC_NAME varchar(64) NO
......
......@@ -1496,7 +1496,7 @@ thread-pool-oversubscribe 3
thread-pool-prio-kickup-timer 1000
thread-pool-priority auto
thread-pool-stall-limit 500
thread-stack 297984
thread-stack 299008
time-format %H:%i:%s
timed-mutexes FALSE
tmp-table-size 16777216
......
......@@ -759,3 +759,24 @@ a b
1 NULL
1 NULL
DROP TABLE t1;
#
# MDEV-12390 Wrong error line numbers reported with sql_mode=IGNORE_SPACE
#
SET sql_mode=IGNORE_SPACE;
CREATE PROCEDURE p1()
BEGIN
SELECT 1+1;
syntax error;
END;
$$
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'error;
END' at line 4
SET sql_mode=DEFAULT;
CREATE PROCEDURE p1()
BEGIN
SELECT 1+1;
syntax error;
END;
$$
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'error;
END' at line 4
......
......@@ -16,17 +16,17 @@ f11 LONGTEXT UNICODE
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
def test t1 f8 7 NULL YES text 32767 65535 NULL NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references NEVER NULL
def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references NEVER NULL
def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references NEVER NULL
def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references NEVER NULL
def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references NEVER NULL
def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references NEVER NULL
def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references NEVER NULL
def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references NEVER NULL
def test t1 f8 7 NULL YES text 32767 65535 NULL NULL NULL ucs2 ucs2_general_ci text select,insert,update,references NEVER NULL
def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references NEVER NULL
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
......
......@@ -13,13 +13,13 @@ f7 VARCHAR(260) UNICODE
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references NEVER NULL
def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references NEVER NULL
def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references NEVER NULL
def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references NEVER NULL
def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references NEVER NULL
def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references NEVER NULL
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
......
......@@ -17,17 +17,17 @@ f11 LONGTEXT UNICODE
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
def test t1 f8 7 NULL YES text 32767 65535 NULL NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references NEVER NULL
def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references NEVER NULL
def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references NEVER NULL
def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references NEVER NULL
def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references NEVER NULL
def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references NEVER NULL
def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references NEVER NULL
def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references NEVER NULL
def test t1 f8 7 NULL YES text 32767 65535 NULL NULL NULL ucs2 ucs2_general_ci text select,insert,update,references NEVER NULL
def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references NEVER NULL
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
......
......@@ -48,6 +48,8 @@ COLUMN_KEY varchar(3) NO
EXTRA varchar(30) NO
PRIVILEGES varchar(80) NO
COLUMN_COMMENT varchar(1024) NO
IS_GENERATED varchar(6) NO
GENERATION_EXPRESSION longtext YES NULL
SHOW CREATE TABLE information_schema.COLUMNS;
Table Create Table
COLUMNS CREATE TEMPORARY TABLE `COLUMNS` (
......@@ -70,7 +72,9 @@ COLUMNS CREATE TEMPORARY TABLE `COLUMNS` (
`COLUMN_KEY` varchar(3) NOT NULL DEFAULT '',
`EXTRA` varchar(30) NOT NULL DEFAULT '',
`PRIVILEGES` varchar(80) NOT NULL DEFAULT '',
`COLUMN_COMMENT` varchar(1024) NOT NULL DEFAULT ''
`COLUMN_COMMENT` varchar(1024) NOT NULL DEFAULT '',
`IS_GENERATED` varchar(6) NOT NULL DEFAULT '',
`GENERATION_EXPRESSION` longtext DEFAULT NULL
) DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.COLUMNS;
Field Type Null Key Default Extra
......@@ -94,6 +98,8 @@ COLUMN_KEY varchar(3) NO
EXTRA varchar(30) NO
PRIVILEGES varchar(80) NO
COLUMN_COMMENT varchar(1024) NO
IS_GENERATED varchar(6) NO
GENERATION_EXPRESSION longtext YES NULL
SELECT table_catalog, table_schema, table_name, column_name
FROM information_schema.columns WHERE table_catalog IS NULL OR table_catalog <> 'def';
table_catalog table_schema table_name column_name
......@@ -120,17 +126,17 @@ GRANT INSERT(f1, f2) ON db_datadict.t2 TO 'testuser2'@'localhost';
SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
def db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) MUL select,insert,update,references
def db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
def db_datadict t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references
def db_datadict t1 f4 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI auto_increment select,insert,update,references
def db_datadict t2 f1 1 NULL NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI select,insert,update,references
def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
def db_datadict t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references
def db_datadict t2 f4 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI select,insert,update,references
def db_datadict v1 f1 1 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select,insert,update,references
def db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select,insert,update,references
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
def db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) MUL select,insert,update,references NEVER NULL
def db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL
def db_datadict t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
def db_datadict t1 f4 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI auto_increment select,insert,update,references NEVER NULL
def db_datadict t2 f1 1 NULL NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI select,insert,update,references NEVER NULL
def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL
def db_datadict t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
def db_datadict t2 f4 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI select,insert,update,references NEVER NULL
def db_datadict v1 f1 1 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select,insert,update,references NEVER NULL
def db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select,insert,update,references NEVER NULL
SHOW COLUMNS FROM db_datadict.t1;
Field Type Null Key Default Extra
f1 char(10) YES MUL NULL
......@@ -151,10 +157,10 @@ connect testuser1, localhost, testuser1, , db_datadict;
SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
def db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) MUL select
def db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select
def db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
def db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) MUL select NEVER NULL
def db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select NEVER NULL
def db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select NEVER NULL
SHOW COLUMNS FROM db_datadict.t1;
Field Type Null Key Default Extra
f1 char(10) YES MUL NULL
......@@ -168,9 +174,9 @@ connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
def db_datadict t2 f1 1 NULL NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI insert
def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text insert
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
def db_datadict t2 f1 1 NULL NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI insert NEVER NULL
def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text insert NEVER NULL
SHOW COLUMNS FROM db_datadict.t1;
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 't1'
SHOW COLUMNS FROM db_datadict.t2;
......@@ -219,6 +225,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES select,insert,update,references
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
SELECT table_name FROM information_schema.columns
WHERE table_name LIKE 't1_my_table%';
table_name
......@@ -425,6 +433,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES select,insert,update,references
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_tablex
......@@ -445,6 +455,8 @@ COLUMN_KEY
EXTRA
PRIVILEGES select,insert,update,references
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
DROP VIEW test.t1_my_tablex;
SELECT table_name FROM information_schema.columns
WHERE table_name = 't1_my_tablex';
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -20,7 +20,7 @@ SELECT COUNT(DISTINCT f1) FROM t1;
COUNT(DISTINCT f1)
30000
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE
USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
COUNT(*)
5
connection default;
......
......@@ -13,7 +13,7 @@ SELECT @@wsrep_slave_threads = 1;
1
SET GLOBAL wsrep_slave_threads = 1;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
WHERE USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
COUNT(*)
2
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
......@@ -27,7 +27,7 @@ SELECT COUNT(*) FROM t1;
COUNT(*)
1
SELECT COUNT(*) - @@wsrep_slave_threads FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
WHERE USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
COUNT(*) - @@wsrep_slave_threads
1
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
......@@ -104,7 +104,7 @@ SELECT COUNT(*) FROM t2;
COUNT(*)
64
SELECT COUNT(*) - @@wsrep_slave_threads FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
WHERE USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
COUNT(*) - @@wsrep_slave_threads
1
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
......
......@@ -7,7 +7,7 @@
--connection node_1
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND NOT STATE <=> 'wsrep aborter idle' AND NOT STATE <=> 'InnoDB background thread' LIMIT 1`
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND NOT STATE <=> 'wsrep aborter idle' AND STATE NOT LIKE 'InnoDB%' LIMIT 1`
--disable_query_log
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR
......
......@@ -40,7 +40,7 @@ SET GLOBAL wsrep_slave_threads = 4;
SELECT COUNT(*) FROM t1;
SELECT COUNT(DISTINCT f1) FROM t1;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE
USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
--disable_query_log
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
......
......@@ -23,7 +23,7 @@ SELECT @@wsrep_slave_threads = 1;
SET GLOBAL wsrep_slave_threads = 1;
# There is a separate wsrep_aborter thread at all times
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
WHERE USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
#
......@@ -40,7 +40,7 @@ INSERT INTO t1 VALUES (1);
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) - @@wsrep_slave_threads FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
WHERE USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
#
......@@ -63,7 +63,7 @@ while ($count)
SELECT COUNT(*) FROM t2;
SELECT COUNT(*) - @@wsrep_slave_threads FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
WHERE USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
......
......@@ -575,3 +575,17 @@ SELECT 1 FROM t WHERE c GROUP BY b;
1
COMMIT;
DROP TABLE t;
#
# MDEV-9255 Add generation_expression to information_schema.columns.
#
CREATE TABLE gcol_t1 (
sidea DOUBLE,
sideb DOUBLE,
sidec DOUBLE AS (SQRT(sidea * sidea + sideb * sideb))
);
SELECT * FROM information_schema.columns WHERE table_name='gcol_t1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
def test gcol_t1 sidea 1 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
def test gcol_t1 sideb 2 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
def test gcol_t1 sidec 3 NULL YES double NULL NULL 22 NULL NULL NULL NULL double VIRTUAL GENERATED select,insert,update,references ALWAYS sqrt(`sidea` * `sidea` + `sideb` * `sideb`)
DROP TABLE gcol_t1;
......@@ -80,7 +80,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR uncommitted';
# enable purge
COMMIT;
# wait for purge to process the deleted records.
Timeout in wait_innodb_all_purged.inc for INNODB_PURGE_TRX_ID_AGE = 3
Timeout in wait_innodb_all_purged.inc for INNODB_PURGE_TRX_ID_AGE = 4
SET DEBUG_SYNC= 'now SIGNAL purged';
connection default;
/* connection default */ ALTER TABLE t1 ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=SHARED;
......
......@@ -536,3 +536,17 @@ SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ;
SELECT 1 FROM t WHERE c GROUP BY b;
COMMIT;
DROP TABLE t;
--echo #
--echo # MDEV-9255 Add generation_expression to information_schema.columns.
--echo #
CREATE TABLE gcol_t1 (
sidea DOUBLE,
sideb DOUBLE,
sidec DOUBLE AS (SQRT(sidea * sidea + sideb * sideb))
);
SELECT * FROM information_schema.columns WHERE table_name='gcol_t1';
DROP TABLE gcol_t1;
set @old_innodb_limit_optimistic_insert_debug = @@innodb_limit_optimistic_insert_debug;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
set global innodb_limit_optimistic_insert_debug = 2;
insert into t1 values (1);
connect con5,localhost,root;
begin;
insert into t1 values (5);
connect con4,localhost,root;
begin;
insert into t1 values (4);
connection default;
insert into t1 values (3);
connect con2,localhost,root;
begin;
insert into t1 values (2);
connection default;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME = 'test/t1';
CLUST_INDEX_SIZE
10
delete from t1 where a=4;
set global innodb_purge_stop_now=ON;
set global innodb_purge_run_now=ON;
connection con4;
rollback;
disconnect con4;
connection default;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME = 'test/t1';
CLUST_INDEX_SIZE
8
delete from t1 where a=5;
set global innodb_purge_stop_now=ON;
set global innodb_purge_run_now=ON;
connection con5;
rollback;
disconnect con5;
connection default;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
......@@ -30,29 +41,28 @@ select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME
CLUST_INDEX_SIZE
5
set global innodb_limit_optimistic_insert_debug = 0;
delete from t1 where a=2;
set global innodb_purge_stop_now=ON;
set global innodb_purge_run_now=ON;
connection con2;
rollback;
disconnect con2;
connection default;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME = 'test/t1';
CLUST_INDEX_SIZE
3
begin;
insert into t1 values (2);
delete from t1 where a=2;
set global innodb_purge_stop_now=ON;
set global innodb_purge_run_now=ON;
rollback;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME = 'test/t1';
CLUST_INDEX_SIZE
2
begin;
insert into t1 values (2);
delete from t1 where a=2;
set global innodb_purge_stop_now=ON;
set global innodb_purge_run_now=ON;
rollback;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
......@@ -60,3 +70,4 @@ select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME
CLUST_INDEX_SIZE
1
drop table t1;
set global innodb_limit_optimistic_insert_debug = @old_innodb_limit_optimistic_insert_debug;
......@@ -2,13 +2,9 @@
-- source include/have_innodb.inc
-- source include/have_debug.inc
-- source include/count_sessions.inc
--disable_query_log
set @old_innodb_limit_optimistic_insert_debug = @@innodb_limit_optimistic_insert_debug;
set @old_innodb_undo_logs = @@innodb_undo_logs;
# Limit undo segments for stable progress of purge.
set global innodb_undo_logs = 1;
--enable_query_log
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
......@@ -17,22 +13,29 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
#
set global innodb_limit_optimistic_insert_debug = 2;
insert into t1 values (1);
--connect (con5,localhost,root)
begin;
insert into t1 values (5);
#current tree form
# (1, 5)
--connect (con4,localhost,root)
begin;
insert into t1 values (4);
#records in a page is limited to 2 artificially. root rise occurs
#current tree form
# (1, 5)
#(1, 4) (5)
--connection default
insert into t1 values (3);
#current tree form
# (1, 5)
# (1, 4) (5)
#(1, 3) (4) (5)
--connect (con2,localhost,root)
begin;
insert into t1 values (2);
#current tree form
# (1, 5)
......@@ -40,13 +43,15 @@ insert into t1 values (2);
# (1, 3) (4) (5)
#(1, 2) (3) (4) (5)
--connection default
analyze table t1;
select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME = 'test/t1';
delete from t1 where a=4;
set global innodb_purge_stop_now=ON;
set global innodb_purge_run_now=ON;
--source include/wait_innodb_all_purged.inc
--connection con4
rollback;
--disconnect con4
--connection default
#deleting 1 record of 2 records don't cause merge artificially.
#current tree form
# (1, 5)
......@@ -57,10 +62,11 @@ set global innodb_purge_run_now=ON;
analyze table t1;
select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME = 'test/t1';
delete from t1 where a=5;
set global innodb_purge_stop_now=ON;
set global innodb_purge_run_now=ON;
--source include/wait_innodb_all_purged.inc
--connection con5
rollback;
--disconnect con5
--connection default
#deleting 1 record of 2 records don't cause merge artificially.
#current tree form
# (1)
......@@ -77,10 +83,11 @@ select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME
#disable the artificial limitation of records in a page
set global innodb_limit_optimistic_insert_debug = 0;
delete from t1 where a=2;
set global innodb_purge_stop_now=ON;
set global innodb_purge_run_now=ON;
--source include/wait_innodb_all_purged.inc
--connection con2
rollback;
--disconnect con2
--connection default
#merge page occurs. and lift up occurs.
#current tree form
# (1)
......@@ -90,16 +97,14 @@ set global innodb_purge_run_now=ON;
analyze table t1;
select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME = 'test/t1';
begin;
insert into t1 values (2);
#current tree form
# (1)
# (1) <- lift up this level next, because it is not root
# (1, 2, 3)
rollback;
delete from t1 where a=2;
set global innodb_purge_stop_now=ON;
set global innodb_purge_run_now=ON;
--source include/wait_innodb_all_purged.inc
#current tree form
# (1)
# (1, 3)
......@@ -107,15 +112,13 @@ set global innodb_purge_run_now=ON;
analyze table t1;
select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME = 'test/t1';
begin;
insert into t1 values (2);
#current tree form
# (1)
# (1, 2, 3) <- lift up this level next, because the father is root
delete from t1 where a=2;
set global innodb_purge_stop_now=ON;
set global innodb_purge_run_now=ON;
--source include/wait_innodb_all_purged.inc
rollback;
#current tree form
# (1, 3)
......@@ -124,7 +127,5 @@ select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME
drop table t1;
--disable_query_log
set global innodb_limit_optimistic_insert_debug = @old_innodb_limit_optimistic_insert_debug;
set global innodb_undo_logs = @old_innodb_undo_logs;
--enable_query_log
-- source include/wait_until_count_sessions.inc
......@@ -231,6 +231,7 @@ print OUT pack("H*x[212]Nx[1024]", "590DBAACFE922582", 0xc72d49c4);
# redo log data
print OUT pack("H*x[5]", "C0DEBA5E0022000c0000000138");
print OUT pack("H*x[475]H*", "12860cb7809781e80006626f677573", "089C0ADA");
close OUT or die;
EOF
--copy_file $bugdir/ib_logfile0 $bugdir/ib_logfile
# Anything below innodb_force_recovery=6 must find an invalid redo log.
......
......@@ -3987,9 +3987,9 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME THREAD_STACK
SESSION_VALUE NULL
GLOBAL_VALUE 297984
GLOBAL_VALUE 299008
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 297984
DEFAULT_VALUE 299008
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The stack size for each thread
......
......@@ -4869,9 +4869,9 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME THREAD_STACK
SESSION_VALUE NULL
GLOBAL_VALUE 297984
GLOBAL_VALUE 299008
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 297984
DEFAULT_VALUE 299008
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The stack size for each thread
......
select @@global.thread_stack;
@@global.thread_stack
297984
299008
select @@session.thread_stack;
ERROR HY000: Variable 'thread_stack' is a GLOBAL variable
show global variables like 'thread_stack';
Variable_name Value
thread_stack 297984
thread_stack 299008
show session variables like 'thread_stack';
Variable_name Value
thread_stack 297984
thread_stack 299008
select * from information_schema.global_variables where variable_name='thread_stack';
VARIABLE_NAME VARIABLE_VALUE
THREAD_STACK 297984
THREAD_STACK 299008
select * from information_schema.session_variables where variable_name='thread_stack';
VARIABLE_NAME VARIABLE_VALUE
THREAD_STACK 297984
THREAD_STACK 299008
set global thread_stack=1;
ERROR HY000: Variable 'thread_stack' is a read only variable
set session thread_stack=1;
......
This diff is collapsed.
This diff is collapsed.
......@@ -69,3 +69,20 @@ create or replace table t1 (a int, b int,
constraint CONSTRAINT_2 check (a>b));
show create table t1;
drop table t1;
#
# MDEV-10370 Check constraints on virtual columns fails on INSERT when column not specified
#
create table t1(c1 int, c2 int as (c1 + 1), check (c2 > 2));
--error ER_CONSTRAINT_FAILED
insert into t1(c1) values(1);
insert into t1(c1) values(2);
drop table t1;
#
# MDEV-11114 Cannot drop column referenced by CHECK constraint: Unknown column 'a' in 'virtual column function'
#
create table t1 (a int, b int, check(a>0));
--error ER_BAD_FIELD_ERROR
alter table t1 drop column a;
drop table t1;
......@@ -1517,3 +1517,147 @@ with recursive src(counter) as
union
select counter+1 from src where counter<10
) select * from src;
--echo #
--echo # mdev-12360: recursive reference in left operand of LEFT JOIN
--echo #
create table folks(id int, name char(32), dob date, father int, mother int);
insert into folks values
(100, 'Me', '2000-01-01', 20, 30),
(20, 'Dad', '1970-02-02', 10, 9),
(30, 'Mom', '1975-03-03', 8, 7),
(10, 'Grandpa Bill', '1940-04-05', null, null),
(9, 'Grandma Ann', '1941-10-15', null, null),
(25, 'Uncle Jim', '1968-11-18', 8, 7),
(98, 'Sister Amy', '2001-06-20', 20, 30),
(7, 'Grandma Sally', '1943-08-23', null, 6),
(8, 'Grandpa Ben', '1940-10-21', null, null),
(6, 'Grandgrandma Martha', '1923-05-17', null, null),
(67, 'Cousin Eddie', '1992-02-28', 25, 27),
(27, 'Auntie Melinda', '1971-03-29', null, null);
with recursive
ancestor_ids (id)
as
(
select father from folks where name = 'Me'
union
select mother from folks where name = 'Me'
union
select father from ancestor_ids as a left join folks on folks.id = a.id
union
select mother from ancestor_ids as a left join folks on folks.id = a.id
),
ancestors
as
(
select p.* from folks as p, ancestor_ids as a
where p.id = a.id
)
select * from ancestors;
drop table folks;
--echo #
--echo # mdev-12368: crash with mutually recursive CTE
--echo # that arenot Standard compliant
--echo #
create table value_nodes (v char(4));
create table module_nodes(m char(4));
create table module_arguments(m char(4), v char(4));
create table module_results(m char(4), v char(4));
--ERROR ER_NOT_STANDARD_COMPLIANT_RECURSIVE
with recursive
reached_values as
(
select v from value_nodes where v in ('v3','v7','v9')
union
select module_results.v from module_results, applied_modules
where module_results.m = applied_modules.m
),
applied_modules as
(
select module_nodes.m
from
module_nodes
left join
(
module_arguments
left join
reached_values
on module_arguments.v = reached_values.v
)
on reached_values.v is null and
module_nodes.m = module_arguments.m
where module_arguments.m is null
)
select * from reached_values;
drop table value_nodes, module_nodes, module_arguments, module_results;
--echo #
--echo # mdev-12375: query using one of two mutually recursive CTEs
--echo # whose non-recursive part returns an empty set
--echo #
create table value_nodes (v char(4));
insert into value_nodes values
('v1'), ('v2'), ('v3'), ('v4'), ('v5'), ('v6'), ('v7'), ('v8'), ('v9'),
('v10'), ('v11'), ('v12'), ('v13'), ('v14'), ('v15'), ('v16');
create table module_nodes(m char(4));
insert into module_nodes values
('m1'), ('m2'), ('m3'), ('m4'), ('m5'), ('m6'), ('m7');
create table module_arguments(m char(4), v char(4));
insert into module_arguments values
('m1','v3'), ('m1','v9'),
('m2','v4'), ('m2','v3'), ('m2','v7'),
('m3','v6'),
('m4','v4'), ('m4','v1'),
('m5','v10'), ('m5','v8'), ('m5','v3'),
('m6','v8'), ('m6','v1'),
('m7','v11'), ('m7','v12');
create table module_results(m char(4), v char(4));
insert into module_results values
('m1','v4'),
('m2','v1'), ('m2','v6'),
('m3','v10'),
('m4','v8'),
('m5','v11'), ('m5','v9'),
('m6','v12'), ('m6','v4'),
('m7','v2');
set statement max_recursive_iterations=2, standard_compliant_cte=0 for
with recursive
reached_values as
(
select v from value_nodes where v in ('v3','v7','v9')
union
select module_results.v from module_results, applied_modules
where module_results.m = applied_modules.m
),
applied_modules as
(
select * from module_nodes where 1=0
union
select module_nodes.m
from
module_nodes
left join
(
module_arguments
left join
reached_values
on module_arguments.v = reached_values.v
)
on reached_values.v is null and
module_nodes.m = module_arguments.m
where module_arguments.m is null
)
select * from applied_modules;
drop table value_nodes, module_nodes, module_arguments, module_results;
......@@ -2073,4 +2073,10 @@ drop table t1;
--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD
create table t1 (col1 int default(-(default(col1))));
#
# MDEV-10354 Assertion `! is_set()' failed in Diagnostics_area::set_ok_status on CREATE TABLE with invalid default
#
--error ER_DATA_OUT_OF_RANGE
create table t1 (col int default (yearweek((exp(710)))));
--echo # end of 10.2 test
......@@ -527,3 +527,30 @@ ALTER TABLE t1 ADD b INT;
EXECUTE stmt;
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # MDEV-12390 Wrong error line numbers reported with sql_mode=IGNORE_SPACE
--echo #
SET sql_mode=IGNORE_SPACE;
DELIMITER $$;
--error ER_PARSE_ERROR
CREATE PROCEDURE p1()
BEGIN
SELECT 1+1;
syntax error;
END;
$$
DELIMITER ;$$
SET sql_mode=DEFAULT;
DELIMITER $$;
--error ER_PARSE_ERROR
CREATE PROCEDURE p1()
BEGIN
SELECT 1+1;
syntax error;
END;
$$
DELIMITER ;$$
......@@ -12,21 +12,11 @@
# Give message why the building this plugin is skipped (only if -DVERBOSE is defined)
# or if plugin is explicitly requested to build. Then bail out.
MACRO(SKIP_AWS_PLUGIN msg)
IF(VERBOSE OR "${PLUGIN_AWS_KEY_MANAGEMENT}" MATCHES "^(STATIC|DYNAMIC)$")
MESSAGE(STATUS "Can't build aws_key_management - ${msg}")
ENDIF()
IF(TARGET aws_key_management)
MESSAGE(FATAL_ERROR "Error configuring aws_key_management - aborting")
ENDIF()
MESSAGE_ONCE(SKIP_AWS_PLUGIN "Skip aws_key_management - ${msg}")
RETURN()
ENDMACRO()
MYSQL_ADD_PLUGIN(aws_key_management aws_key_management_plugin.cc DISABLED
COMPONENT aws-key-management)
IF(NOT TARGET aws_key_management)
RETURN()
ENDIF()
# This plugin needs recent C++ compilers (AWS C++ SDK header files are using C++11 features)
SET(CXX11_FLAGS)
......@@ -67,6 +57,10 @@ IF(AWS_CPP_SDK_CORE AND AWS_CPP_SDK_KMS AND HAVE_AWS_HEADERS)
# AWS C++ SDK installed
SET(AWS_SDK_LIBS ${AWS_CPP_SDK_CORE} ${AWS_CPP_SDK_KMS})
ELSE()
OPTION(AWS_SDK_EXTERNAL_PROJECT "Allow download and build AWS C++ SDK" OFF)
IF(NOT AWS_SDK_EXTERNAL_PROJECT)
SKIP_AWS_PLUGIN("AWS_SDK_EXTERNAL_PROJECT is not set")
ENDIF()
# Build from source, using ExternalProject_Add
# AWS C++ SDK requires cmake 2.8.12
IF(CMAKE_VERSION VERSION_LESS "2.8.12")
......@@ -95,7 +89,7 @@ ELSE()
ENDIF()
ENDIF()
IF(MSVC)
SET(EXTRA_SDK_CMAKE_FLAGS -DCMAKE_CXX_FLAGS_DEBUGOPT="" -DCMAKE_EXE_LINKER_FLAGS_DEBUGOPT="" "-DCMAKE_CXX_FLAGS=/wd4530 /WX-")
SET(EXTRA_SDK_CMAKE_FLAGS -DCMAKE_CXX_FLAGS_DEBUGOPT="" -DCMAKE_EXE_LINKER_FLAGS_DEBUGOPT="" "-DCMAKE_CXX_FLAGS=/wd4530 /wd4577 /WX-")
ENDIF()
IF(CMAKE_CXX_COMPILER)
SET(EXTRA_SDK_CMAKE_FLAGS ${EXTRA_SDK_CMAKE_FLAGS} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
......@@ -143,6 +137,8 @@ ELSE()
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/aws_sdk_cpp/include)
ENDIF()
MYSQL_ADD_PLUGIN(aws_key_management aws_key_management_plugin.cc
COMPONENT aws-key-management)
ADD_DEFINITIONS(${SSL_DEFINES}) # Need to know whether openssl should be initialized
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAGS}")
TARGET_LINK_LIBRARIES(aws_key_management ${AWS_SDK_LIBS})
......@@ -170,7 +170,7 @@ ADD_DEPENDENCIES(sql GenServerSource)
ADD_DEPENDENCIES(sql GenDigestServerSource)
DTRACE_INSTRUMENT(sql)
TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
mysys mysys_ssl dbug strings vio pcre ${LIBJEMALLOC}
mysys mysys_ssl dbug strings vio pcre
${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT}
${WSREP_LIB}
${SSL_LIBRARIES}
......
......@@ -7151,6 +7151,9 @@ skip-to-error-number 2000
# MySQL 5.7 error numbers starts here
skip-to-error-number 3000
ER_FILE_CORRUPT
eng "File %s is corrupted"
ER_ERROR_ON_MASTER
eng "Query partially completed on the master (error on master: %d) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;. Query:'%s'"
......
......@@ -1168,6 +1168,8 @@ bool With_element::check_unrestricted_recursive(st_select_lex *sel,
ti.rewind();
while ((tbl= ti++))
{
if (!tbl->is_with_table_recursive_reference())
continue;
for (TABLE_LIST *tab= tbl; tab; tab= tab->embedding)
{
if (tab->outer_join & (JOIN_TYPE_LEFT | JOIN_TYPE_RIGHT))
......
......@@ -790,9 +790,12 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
*/
if (res)
{
if (derived->table && !derived->is_with_table_recursive_reference())
free_tmp_table(thd, derived->table);
delete derived->derived_result;
if (!derived->is_with_table_recursive_reference())
{
if (derived->table)
free_tmp_table(thd, derived->table);
delete derived->derived_result;
}
}
else
{
......
......@@ -1449,7 +1449,10 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
below by checking start != lex->ptr.
*/
for (; state_map[(uchar) c] == MY_LEX_SKIP ; c= lip->yyGet())
;
{
if (c == '\n')
lip->yylineno++;
}
}
if (start == lip->get_ptr() && c == '.' &&
ident_map[(uchar) lip->yyPeek()])
......
......@@ -5505,13 +5505,24 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
table->field[17]->store(STRING_WITH_LEN("auto_increment"), cs);
if (print_on_update_clause(field, &type, true))
table->field[17]->store(type.ptr(), type.length(), cs);
if (field->vcol_info)
{
String gen_s(tmp,sizeof(tmp), system_charset_info);
gen_s.length(0);
field->vcol_info->print(&gen_s);
table->field[21]->store(gen_s.ptr(), gen_s.length(), cs);
table->field[21]->set_notnull();
table->field[20]->store(STRING_WITH_LEN("ALWAYS"), cs);
if (field->vcol_info->stored_in_db)
table->field[17]->store(STRING_WITH_LEN("STORED GENERATED"), cs);
else
table->field[17]->store(STRING_WITH_LEN("VIRTUAL GENERATED"), cs);
}
else
table->field[20]->store(STRING_WITH_LEN("NEVER"), cs);
table->field[19]->store(field->comment.str, field->comment.length, cs);
if (schema_table_store_record(thd, table))
DBUG_RETURN(1);
......@@ -8444,6 +8455,9 @@ ST_FIELD_INFO columns_fields_info[]=
{"PRIVILEGES", 80, MYSQL_TYPE_STRING, 0, 0, "Privileges", OPEN_FRM_ONLY},
{"COLUMN_COMMENT", COLUMN_COMMENT_MAXLEN, MYSQL_TYPE_STRING, 0, 0,
"Comment", OPEN_FRM_ONLY},
{"IS_GENERATED", 6, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
{"GENERATION_EXPRESSION", MAX_FIELD_VARCHARLENGTH, MYSQL_TYPE_STRING, 0, 1,
0, OPEN_FRM_ONLY},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
......
......@@ -1502,7 +1502,7 @@ bool st_select_lex_unit::exec_recursive()
thd->inc_examined_row_count(examined_rows);
incr_table->file->info(HA_STATUS_VARIABLE);
if (incr_table->file->stats.records == 0)
if (with_element->level && incr_table->file->stats.records == 0)
with_element->set_as_stabilized();
else
with_element->level++;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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