Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä 2022-04-06 10:06:39 +03:00
commit cacb61b6be
66 changed files with 680 additions and 556 deletions

View File

@ -1047,6 +1047,7 @@ static const char *expected_errors[]=
"ERROR 1347", /* 'mysql.user' is not of type 'BASE TABLE' */ "ERROR 1347", /* 'mysql.user' is not of type 'BASE TABLE' */
"ERROR 1348", /* Column 'Show_db_priv' is not updatable */ "ERROR 1348", /* Column 'Show_db_priv' is not updatable */
"ERROR 1356", /* definer of view lack rights (UPDATE) */ "ERROR 1356", /* definer of view lack rights (UPDATE) */
"ERROR 1449", /* definer ('mariadb.sys'@'localhost') of mysql.user does not exist */
0 0
}; };

View File

@ -8587,7 +8587,10 @@ void run_prepare_stmt(struct st_connection *cn, struct st_command *command, cons
separate string separate string
*/ */
if (!disable_warnings) if (!disable_warnings)
{
append_warnings(&ds_prepare_warnings, mysql); append_warnings(&ds_prepare_warnings, mysql);
dynstr_free(&ds_prepare_warnings);
}
end: end:
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -8666,7 +8669,7 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
else else
{ {
ps_params[i].buffer_type= MYSQL_TYPE_STRING; ps_params[i].buffer_type= MYSQL_TYPE_STRING;
ps_params[i].buffer= strdup(p); ps_params[i].buffer= my_strdup(PSI_NOT_INSTRUMENTED, p, MYF(MY_WME));
ps_params[i].buffer_length= (unsigned long)strlen(p); ps_params[i].buffer_length= (unsigned long)strlen(p);
} }
} }

View File

@ -1,6 +1,6 @@
/* /*
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014, 2021, MariaDB Corporation. Copyright (c) 2014, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -877,7 +877,7 @@ parse_page(
is_leaf = (!*(const uint16*) (page + (PAGE_HEADER + PAGE_LEVEL))); is_leaf = (!*(const uint16*) (page + (PAGE_HEADER + PAGE_LEVEL)));
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tIndex page\t\t\t|" fprintf(file, "#::" UINT32PF "\t\t|\t\tIndex page\t\t\t|"
"\tindex id=%llu,", cur_page_num, id); "\tindex id=%llu,", cur_page_num, id);
@ -929,7 +929,7 @@ parse_page(
index.total_data_bytes += data_bytes; index.total_data_bytes += data_bytes;
index.pages_in_size_range[size_range_id] ++; index.pages_in_size_range[size_range_id] ++;
} }
} else { } else if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tEncrypted Index page\t\t\t|" fprintf(file, "#::" UINT32PF "\t\t|\t\tEncrypted Index page\t\t\t|"
"\tkey_version " UINT32PF ",%s\n", cur_page_num, key_version, str); "\tkey_version " UINT32PF ",%s\n", cur_page_num, key_version, str);
} }
@ -940,7 +940,7 @@ parse_page(
page_type.n_fil_page_undo_log++; page_type.n_fil_page_undo_log++;
undo_page_type = mach_read_from_2(page + undo_page_type = mach_read_from_2(page +
TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_TYPE); TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_TYPE);
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tUndo log page\t\t\t|", fprintf(file, "#::" UINT32PF "\t\t|\t\tUndo log page\t\t\t|",
cur_page_num); cur_page_num);
} }
@ -950,7 +950,7 @@ parse_page(
switch (undo_page_type) { switch (undo_page_type) {
case TRX_UNDO_ACTIVE: case TRX_UNDO_ACTIVE:
page_type.n_undo_state_active++; page_type.n_undo_state_active++;
if (page_type_dump) { if (file) {
fprintf(file, ", %s", "Undo log of " fprintf(file, ", %s", "Undo log of "
"an active transaction"); "an active transaction");
} }
@ -958,7 +958,7 @@ parse_page(
case TRX_UNDO_CACHED: case TRX_UNDO_CACHED:
page_type.n_undo_state_cached++; page_type.n_undo_state_cached++;
if (page_type_dump) { if (file) {
fprintf(file, ", %s", "Page is " fprintf(file, ", %s", "Page is "
"cached for quick reuse"); "cached for quick reuse");
} }
@ -966,7 +966,7 @@ parse_page(
case TRX_UNDO_TO_PURGE: case TRX_UNDO_TO_PURGE:
page_type.n_undo_state_to_purge++; page_type.n_undo_state_to_purge++;
if (page_type_dump) { if (file) {
fprintf(file, ", %s", "Will be " fprintf(file, ", %s", "Will be "
"freed in purge when all undo" "freed in purge when all undo"
"data in it is removed"); "data in it is removed");
@ -975,7 +975,7 @@ parse_page(
case TRX_UNDO_PREPARED: case TRX_UNDO_PREPARED:
page_type.n_undo_state_prepared++; page_type.n_undo_state_prepared++;
if (page_type_dump) { if (file) {
fprintf(file, ", %s", "Undo log of " fprintf(file, ", %s", "Undo log of "
"an prepared transaction"); "an prepared transaction");
} }
@ -985,14 +985,14 @@ parse_page(
page_type.n_undo_state_other++; page_type.n_undo_state_other++;
break; break;
} }
if(page_type_dump) { if(file) {
fprintf(file, ", %s\n", str); fprintf(file, ", %s\n", str);
} }
break; break;
case FIL_PAGE_INODE: case FIL_PAGE_INODE:
page_type.n_fil_page_inode++; page_type.n_fil_page_inode++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tInode page\t\t\t|" fprintf(file, "#::" UINT32PF "\t\t|\t\tInode page\t\t\t|"
"\t%s\n",cur_page_num, str); "\t%s\n",cur_page_num, str);
} }
@ -1000,7 +1000,7 @@ parse_page(
case FIL_PAGE_IBUF_FREE_LIST: case FIL_PAGE_IBUF_FREE_LIST:
page_type.n_fil_page_ibuf_free_list++; page_type.n_fil_page_ibuf_free_list++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tInsert buffer free list" fprintf(file, "#::" UINT32PF "\t\t|\t\tInsert buffer free list"
" page\t|\t%s\n", cur_page_num, str); " page\t|\t%s\n", cur_page_num, str);
} }
@ -1008,7 +1008,7 @@ parse_page(
case FIL_PAGE_TYPE_ALLOCATED: case FIL_PAGE_TYPE_ALLOCATED:
page_type.n_fil_page_type_allocated++; page_type.n_fil_page_type_allocated++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tFreshly allocated " fprintf(file, "#::" UINT32PF "\t\t|\t\tFreshly allocated "
"page\t\t|\t%s\n", cur_page_num, str); "page\t\t|\t%s\n", cur_page_num, str);
} }
@ -1016,7 +1016,7 @@ parse_page(
case FIL_PAGE_IBUF_BITMAP: case FIL_PAGE_IBUF_BITMAP:
page_type.n_fil_page_ibuf_bitmap++; page_type.n_fil_page_ibuf_bitmap++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tInsert Buffer " fprintf(file, "#::" UINT32PF "\t\t|\t\tInsert Buffer "
"Bitmap\t\t|\t%s\n", cur_page_num, str); "Bitmap\t\t|\t%s\n", cur_page_num, str);
} }
@ -1024,7 +1024,7 @@ parse_page(
case FIL_PAGE_TYPE_SYS: case FIL_PAGE_TYPE_SYS:
page_type.n_fil_page_type_sys++; page_type.n_fil_page_type_sys++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tSystem page\t\t\t|" fprintf(file, "#::" UINT32PF "\t\t|\t\tSystem page\t\t\t|"
"\t%s\n", cur_page_num, str); "\t%s\n", cur_page_num, str);
} }
@ -1032,7 +1032,7 @@ parse_page(
case FIL_PAGE_TYPE_TRX_SYS: case FIL_PAGE_TYPE_TRX_SYS:
page_type.n_fil_page_type_trx_sys++; page_type.n_fil_page_type_trx_sys++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tTransaction system " fprintf(file, "#::" UINT32PF "\t\t|\t\tTransaction system "
"page\t\t|\t%s\n", cur_page_num, str); "page\t\t|\t%s\n", cur_page_num, str);
} }
@ -1040,7 +1040,7 @@ parse_page(
case FIL_PAGE_TYPE_FSP_HDR: case FIL_PAGE_TYPE_FSP_HDR:
page_type.n_fil_page_type_fsp_hdr++; page_type.n_fil_page_type_fsp_hdr++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tFile Space " fprintf(file, "#::" UINT32PF "\t\t|\t\tFile Space "
"Header\t\t|\t%s\n", cur_page_num, str); "Header\t\t|\t%s\n", cur_page_num, str);
} }
@ -1048,7 +1048,7 @@ parse_page(
case FIL_PAGE_TYPE_XDES: case FIL_PAGE_TYPE_XDES:
page_type.n_fil_page_type_xdes++; page_type.n_fil_page_type_xdes++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tExtent descriptor " fprintf(file, "#::" UINT32PF "\t\t|\t\tExtent descriptor "
"page\t\t|\t%s\n", cur_page_num, str); "page\t\t|\t%s\n", cur_page_num, str);
} }
@ -1056,7 +1056,7 @@ parse_page(
case FIL_PAGE_TYPE_BLOB: case FIL_PAGE_TYPE_BLOB:
page_type.n_fil_page_type_blob++; page_type.n_fil_page_type_blob++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tBLOB page\t\t\t|\t%s\n", fprintf(file, "#::" UINT32PF "\t\t|\t\tBLOB page\t\t\t|\t%s\n",
cur_page_num, str); cur_page_num, str);
} }
@ -1064,7 +1064,7 @@ parse_page(
case FIL_PAGE_TYPE_ZBLOB: case FIL_PAGE_TYPE_ZBLOB:
page_type.n_fil_page_type_zblob++; page_type.n_fil_page_type_zblob++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tCompressed BLOB " fprintf(file, "#::" UINT32PF "\t\t|\t\tCompressed BLOB "
"page\t\t|\t%s\n", cur_page_num, str); "page\t\t|\t%s\n", cur_page_num, str);
} }
@ -1072,7 +1072,7 @@ parse_page(
case FIL_PAGE_TYPE_ZBLOB2: case FIL_PAGE_TYPE_ZBLOB2:
page_type.n_fil_page_type_zblob2++; page_type.n_fil_page_type_zblob2++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tSubsequent Compressed " fprintf(file, "#::" UINT32PF "\t\t|\t\tSubsequent Compressed "
"BLOB page\t|\t%s\n", cur_page_num, str); "BLOB page\t|\t%s\n", cur_page_num, str);
} }
@ -1080,7 +1080,7 @@ parse_page(
case FIL_PAGE_PAGE_COMPRESSED: case FIL_PAGE_PAGE_COMPRESSED:
page_type.n_fil_page_type_page_compressed++; page_type.n_fil_page_type_page_compressed++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tPage compressed " fprintf(file, "#::" UINT32PF "\t\t|\t\tPage compressed "
"page\t|\t%s\n", cur_page_num, str); "page\t|\t%s\n", cur_page_num, str);
} }
@ -1088,7 +1088,7 @@ parse_page(
case FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED: case FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED:
page_type.n_fil_page_type_page_compressed_encrypted++; page_type.n_fil_page_type_page_compressed_encrypted++;
if (page_type_dump) { if (file) {
fprintf(file, "#::" UINT32PF "\t\t|\t\tPage compressed encrypted " fprintf(file, "#::" UINT32PF "\t\t|\t\tPage compressed encrypted "
"page\t|\t%s\n", cur_page_num, str); "page\t|\t%s\n", cur_page_num, str);
} }

View File

@ -244,9 +244,12 @@ static inline void my_time_trunc(MYSQL_TIME *ltime, uint decimals)
!ltime->hour && !ltime->minute && !ltime->second) !ltime->hour && !ltime->minute && !ltime->second)
ltime->neg= FALSE; ltime->neg= FALSE;
} }
#ifdef _WIN32
#define suseconds_t long
#endif
static inline void my_timeval_trunc(struct timeval *tv, uint decimals) static inline void my_timeval_trunc(struct timeval *tv, uint decimals)
{ {
tv->tv_usec-= my_time_fraction_remainder(tv->tv_usec, decimals); tv->tv_usec-= (suseconds_t) my_time_fraction_remainder(tv->tv_usec, decimals);
} }

View File

@ -49,7 +49,7 @@ create sequence seq2;
backup lock seq1; backup lock seq1;
connection con1; connection con1;
CREATE OR REPLACE SEQUENCE seq1 START -28; CREATE OR REPLACE SEQUENCE seq1 START -28;
ERROR HY000: Sequence 'test.seq1' values are conflicting ERROR HY000: Sequence 'test.seq1' has out of range value for options
SET STATEMENT max_statement_time=10 FOR CREATE OR REPLACE SEQUENCE seq1 START 50; SET STATEMENT max_statement_time=10 FOR CREATE OR REPLACE SEQUENCE seq1 START 50;
ERROR 70100: Query execution was interrupted (max_statement_time exceeded) ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
SET STATEMENT max_statement_time=10 FOR ALTER SEQUENCE IF EXISTS seq1 NOMAXVALUE; SET STATEMENT max_statement_time=10 FOR ALTER SEQUENCE IF EXISTS seq1 NOMAXVALUE;

View File

@ -2392,5 +2392,11 @@ DROP TABLE t1;
DROP TABLE t1; DROP TABLE t1;
SET SQL_MODE=DEFAULT; SET SQL_MODE=DEFAULT;
# #
# MDEV-27673 Warning after "select progress from information_schema.processlist"
#
select progress from information_schema.processlist limit 1;
progress
0.000
#
# End of 10.3 tests # End of 10.3 tests
# #

View File

@ -2102,7 +2102,10 @@ DROP TABLE t1;
DROP TABLE t1; DROP TABLE t1;
SET SQL_MODE=DEFAULT; SET SQL_MODE=DEFAULT;
--echo #
--echo # MDEV-27673 Warning after "select progress from information_schema.processlist"
--echo #
select progress from information_schema.processlist limit 1;
--echo # --echo #
--echo # End of 10.3 tests --echo # End of 10.3 tests

View File

@ -5582,6 +5582,28 @@ a
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-19631: Assertion `0' failed in st_select_lex_unit::optimize or
# different plan upon 2nd execution of PS with EXPLAIN
#
CREATE TABLE t1 (a INT);
PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1 HAVING 6 IN ( SELECT 6 UNION SELECT 5 )';
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
# Without the patch the second execution of the 'stmt' prepared statement
# would result in server crash.
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
# End of 10.2 tests # End of 10.2 tests
# #
# #
@ -5646,5 +5668,18 @@ connection default;
SET GLOBAL disconnect_on_expired_password=@disconnect_on_expired_password_save; SET GLOBAL disconnect_on_expired_password=@disconnect_on_expired_password_save;
DROP USER user1@localhost; DROP USER user1@localhost;
# #
# MDEV-21173: Assertion `m_thd == __null' failed in sp_head::~sp_head
#
CREATE TABLE t1 (a INT);
EXECUTE IMMEDIATE "CREATE PROCEDURE p1() SELECT 1 FROM t1 PROCEDURE ANALYSE( 10, (SELECT a FROM t1));";
ERROR 42000: PROCEDURE does not support subqueries or stored functions
DROP TABLE t1;
BEGIN NOT ATOMIC
PREPARE stmt FROM 'SELECT ?';
EXECUTE stmt USING ((SELECT 1));
END;
$
ERROR 42000: EXECUTE..USING does not support subqueries or stored functions
#
# End of 10.4 tests # End of 10.4 tests
# #

View File

@ -5005,6 +5005,19 @@ DEALLOCATE PREPARE stmt;
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-19631: Assertion `0' failed in st_select_lex_unit::optimize or
--echo # different plan upon 2nd execution of PS with EXPLAIN
--echo #
CREATE TABLE t1 (a INT);
PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1 HAVING 6 IN ( SELECT 6 UNION SELECT 5 )';
EXECUTE stmt;
--echo # Without the patch the second execution of the 'stmt' prepared statement
--echo # would result in server crash.
EXECUTE stmt;
# Cleanup
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
--echo # End of 10.2 tests --echo # End of 10.2 tests
--echo # --echo #
@ -5082,6 +5095,25 @@ connection default;
SET GLOBAL disconnect_on_expired_password=@disconnect_on_expired_password_save; SET GLOBAL disconnect_on_expired_password=@disconnect_on_expired_password_save;
DROP USER user1@localhost; DROP USER user1@localhost;
--echo #
--echo # MDEV-21173: Assertion `m_thd == __null' failed in sp_head::~sp_head
--echo #
CREATE TABLE t1 (a INT);
--error ER_SUBQUERIES_NOT_SUPPORTED
EXECUTE IMMEDIATE "CREATE PROCEDURE p1() SELECT 1 FROM t1 PROCEDURE ANALYSE( 10, (SELECT a FROM t1));";
DROP TABLE t1;
delimiter $;
--error ER_SUBQUERIES_NOT_SUPPORTED
BEGIN NOT ATOMIC
PREPARE stmt FROM 'SELECT ?';
EXECUTE stmt USING ((SELECT 1));
END;
$
delimiter ;$
--echo # --echo #
--echo # End of 10.4 tests --echo # End of 10.4 tests
--echo # --echo #

View File

@ -8900,6 +8900,19 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
BEGIN BEGIN
RETURN ''; RETURN '';
END' at line 2 END' at line 2
#
# MDEV-28220: Assert failure in sp_head::~sp_head on parsing a syntax incorrect statement CREATE SEQUENCE ... RESTART inside CREATE PROCEDURE/CREATE FUNCTION
# Specifying the RESTART clause for the statement CREATE SEQUENCE is a syntax error.
# Check that CREATE PROCEDURE doesn't crash server if the statement
# CREATE SEQUNCE ... RESTART is specified in its body.
#
CREATE PROCEDURE sp1() CREATE SEQUENCE s1 START WITH 300 INCREMENT BY 30 RESTART;
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 'RESTART' at line 1
# CREATE SEQUNCE ... RESTART and CREATE SEQUNCE ... RESTART WITH ... are
# handled by different grammar rules, so check the both cases.
CREATE PROCEDURE sp1() CREATE SEQUENCE s1 START WITH 300 INCREMENT BY 30 RESTART WITH 100;
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 'RESTART' at line 1
# End of 10.3 tests # End of 10.3 tests
# #
# Start of 10.4 tests # Start of 10.4 tests
@ -8914,5 +8927,11 @@ END;
$$ $$
ERROR 42000: Incorrect usage/placement of 'HIGH_PRIORITY' ERROR 42000: Incorrect usage/placement of 'HIGH_PRIORITY'
# #
# MDEV-21173: Assertion `m_thd == __null' failed in sp_head::~sp_head
#
CREATE TABLE t1 (a INT);
CREATE PROCEDURE p1() SELECT 1 FROM t1 PROCEDURE ANALYSE( 10, (SELECT a FROM t1));
ERROR 42000: PROCEDURE does not support subqueries or stored functions
DROP TABLE t1;
# End of 10.4 tests # End of 10.4 tests
# #

View File

@ -10461,6 +10461,21 @@ END;
$$ $$
DELIMITER ;$$ DELIMITER ;$$
--echo #
--echo # MDEV-28220: Assert failure in sp_head::~sp_head on parsing a syntax incorrect statement CREATE SEQUENCE ... RESTART inside CREATE PROCEDURE/CREATE FUNCTION
--echo
--echo # Specifying the RESTART clause for the statement CREATE SEQUENCE is a syntax error.
--echo # Check that CREATE PROCEDURE doesn't crash server if the statement
--echo # CREATE SEQUNCE ... RESTART is specified in its body.
--echo #
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1() CREATE SEQUENCE s1 START WITH 300 INCREMENT BY 30 RESTART;
--echo # CREATE SEQUNCE ... RESTART and CREATE SEQUNCE ... RESTART WITH ... are
--echo # handled by different grammar rules, so check the both cases.
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1() CREATE SEQUENCE s1 START WITH 300 INCREMENT BY 30 RESTART WITH 100;
--echo # End of 10.3 tests --echo # End of 10.3 tests
@ -10481,7 +10496,14 @@ END;
$$ $$
DELIMITER ;$$ DELIMITER ;$$
--echo # --echo #
--echo # MDEV-21173: Assertion `m_thd == __null' failed in sp_head::~sp_head
--echo #
CREATE TABLE t1 (a INT);
--error ER_SUBQUERIES_NOT_SUPPORTED
CREATE PROCEDURE p1() SELECT 1 FROM t1 PROCEDURE ANALYSE( 10, (SELECT a FROM t1));
DROP TABLE t1;
--echo # End of 10.4 tests --echo # End of 10.4 tests
--echo # --echo #

View File

@ -319,7 +319,7 @@ drop table t1;
drop table t3; drop table t3;
create temporary table t1 (i int); create temporary table t1 (i int);
create trigger trg before insert on t1 for each row set @a:=1; create trigger trg before insert on t1 for each row set @a:=1;
ERROR HY000: Trigger's 't1' is view or temporary table ERROR HY000: Trigger's 't1' is view, temporary table or sequence
drop table t1; drop table t1;
create table t1 (x1col char); create table t1 (x1col char);
create trigger tx1 before insert on t1 for each row set new.x1col = 'x'; create trigger tx1 before insert on t1 for each row set new.x1col = 'x';

View File

@ -7,7 +7,7 @@ CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FOR
CREATE TABLE t4 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1; CREATE TABLE t4 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1;
CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4; CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB; CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
# Run innochecksum on t1 # Run innochecksum on t1, check -S does not cause crash for encrypted file
# Run innochecksum on t2 # Run innochecksum on t2
# Run innochecksum on t3 # Run innochecksum on t3
# Run innochecksum on t4 # Run innochecksum on t4

View File

@ -63,9 +63,9 @@ let MYSQLD_DATADIR=`select @@datadir`;
--source include/shutdown_mysqld.inc --source include/shutdown_mysqld.inc
--echo # Run innochecksum on t1
-- disable_result_log -- disable_result_log
--exec $INNOCHECKSUM $t1_IBD --echo # Run innochecksum on t1, check -S does not cause crash for encrypted file
--exec $INNOCHECKSUM -S $t1_IBD
--echo # Run innochecksum on t2 --echo # Run innochecksum on t2

View File

@ -237,7 +237,7 @@ Testcase 3.5.5.2:
Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned); Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned);
Create trigger trg2 before INSERT Create trigger trg2 before INSERT
on t1_temp for each row set new.f2=9999; on t1_temp for each row set new.f2=9999;
ERROR HY000: Trigger's 't1_temp' is view or temporary table ERROR HY000: Trigger's 't1_temp' is view, temporary table or sequence
drop table t1_temp; drop table t1_temp;
Testcase 3.5.5.3: Testcase 3.5.5.3:

View File

@ -237,7 +237,7 @@ Testcase 3.5.5.2:
Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned); Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned);
Create trigger trg2 before INSERT Create trigger trg2 before INSERT
on t1_temp for each row set new.f2=9999; on t1_temp for each row set new.f2=9999;
ERROR HY000: Trigger's 't1_temp' is view or temporary table ERROR HY000: Trigger's 't1_temp' is view, temporary table or sequence
drop table t1_temp; drop table t1_temp;
Testcase 3.5.5.3: Testcase 3.5.5.3:

View File

@ -237,7 +237,7 @@ Testcase 3.5.5.2:
Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned); Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned);
Create trigger trg2 before INSERT Create trigger trg2 before INSERT
on t1_temp for each row set new.f2=9999; on t1_temp for each row set new.f2=9999;
ERROR HY000: Trigger's 't1_temp' is view or temporary table ERROR HY000: Trigger's 't1_temp' is view, temporary table or sequence
drop table t1_temp; drop table t1_temp;
Testcase 3.5.5.3: Testcase 3.5.5.3:

View File

@ -38,4 +38,4 @@ partition : MDEV-19958 Galera test failure on galera.partition
query_cache: MDEV-15805 Test failure on galera.query_cache query_cache: MDEV-15805 Test failure on galera.query_cache
versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
galera_bf_abort_at_after_statement : Unstable galera_bf_abort_at_after_statement : Unstable
galera_bf_abort_ps_bind : MDEV-28193 Galera test failure on galera_bf_abort_ps_bind

View File

@ -28,6 +28,7 @@ PS_execute;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
PS_execute; PS_execute;
commit; commit;
PS_close;
select * from t; select * from t;
i j i j
1 node2 1 node2

View File

@ -53,6 +53,8 @@ update t set j='node2' where i=1;
--PS_execute --PS_execute
commit; commit;
--PS_close
select * from t; select * from t;
drop table t; drop table t;

View File

@ -5,10 +5,10 @@ wsrep_sst_method=rsync
[mysqld.1] [mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
log_bin=@ENV.MYSQLTEST_VARDIR/server1_binlog log_bin=@ENV.MYSQLTEST_VARDIR/mysqld.1/server1_binlog
log_bin_index=@ENV.MYSQLTEST_VARDIR/tmp/server1_binlog_index.index log_bin_index=@ENV.MYSQLTEST_VARDIR/tmp/server1_binlog_index.index
[mysqld.2] [mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
log_bin=@ENV.MYSQLTEST_VARDIR/server2_binlog log_bin=@ENV.MYSQLTEST_VARDIR/mysqld.2/server2_binlog
log_bin_index=@ENV.MYSQLTEST_VARDIR/tmp/server2_binlog_index.index log_bin_index=@ENV.MYSQLTEST_VARDIR/tmp/server2_binlog_index.index

View File

@ -7,6 +7,8 @@
--source suite/galera/include/galera_st_shutdown_slave.inc --source suite/galera/include/galera_st_shutdown_slave.inc
--source suite/galera/include/galera_st_clean_slave.inc --source suite/galera/include/galera_st_clean_slave.inc
--let $wsrep_recover_additional=--log-bin=$MYSQLTEST_VARDIR/mysqld.2/server2_binlog --log-bin-index=$MYSQLTEST_VARDIR/tmp/server2_binlog_index.index
--source suite/galera/include/galera_st_kill_slave.inc --source suite/galera/include/galera_st_kill_slave.inc
--source suite/galera/include/galera_st_kill_slave_ddl.inc --source suite/galera/include/galera_st_kill_slave_ddl.inc
--source include/auto_increment_offset_restore.inc --source include/auto_increment_offset_restore.inc

View File

@ -1,6 +1,7 @@
CREATE TABLE t(i INT) ENGINE INNODB; CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1); INSERT INTO t VALUES(1);
# xtrabackup backup # xtrabackup backup
NOT FOUND /InnoDB: Allocated tablespace ID/ in backup.log
INSERT INTO t VALUES(2); INSERT INTO t VALUES(2);
# xtrabackup prepare # xtrabackup prepare
# shutdown server # shutdown server

View File

@ -4,11 +4,18 @@ CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1); INSERT INTO t VALUES(1);
echo # xtrabackup backup; echo # xtrabackup backup;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log
--disable_result_log --disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir; exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir > $backup_log 2>&1;
--enable_result_log --enable_result_log
# The following warning must not appear after MDEV-27343 fix
--let SEARCH_PATTERN=InnoDB: Allocated tablespace ID
--let SEARCH_FILE=$backup_log
--source include/search_pattern_in_file.inc
--remove_file $backup_log
INSERT INTO t VALUES(2); INSERT INTO t VALUES(2);

View File

@ -14,6 +14,5 @@ rpl_partition_archive : MDEV-5077 2013-09-27 svoj Cannot exchange partition
rpl_row_binlog_max_cache_size : MDEV-11092 rpl_row_binlog_max_cache_size : MDEV-11092
rpl_row_index_choice : MDEV-11666 rpl_row_index_choice : MDEV-11666
rpl_semi_sync_after_sync : fails after MDEV-16172 rpl_semi_sync_after_sync : fails after MDEV-16172
rpl_semi_sync_slave_compressed_protocol : MDEV-25580 2021-05-05 Sujatha
rpl_auto_increment_update_failure : disabled for now rpl_auto_increment_update_failure : disabled for now
rpl_current_user : waits for MDEV-22374 fix rpl_current_user : waits for MDEV-22374 fix

View File

@ -29,7 +29,7 @@ select * from t1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
3 -100 9223372036854775806 50 1 0 0 0 3 -100 9223372036854775806 50 1 0 0 0
alter sequence t1 minvalue=100 start=100; alter sequence t1 minvalue=100 start=100;
ERROR HY000: Sequence 'test.t1' values are conflicting ERROR HY000: Sequence 'test.t1' has out of range value for options
alter sequence t1 minvalue=100 start=100 restart=100; alter sequence t1 minvalue=100 start=100 restart=100;
show create sequence t1; show create sequence t1;
Table Create Table Table Create Table
@ -200,21 +200,20 @@ next_not_cached_value minimum_value maximum_value start_value increment cache_si
drop sequence t1; drop sequence t1;
CREATE SEQUENCE t1 engine=myisam; CREATE SEQUENCE t1 engine=myisam;
alter sequence t1 minvalue=100; alter sequence t1 minvalue=100;
ERROR HY000: Sequence 'test.t1' values are conflicting ERROR HY000: Sequence 'test.t1' has out of range value for options
drop sequence t1; drop sequence t1;
CREATE SEQUENCE t1 engine=myisam; CREATE SEQUENCE t1 engine=myisam;
alter sequence t1 minvalue=25 maxvalue=20; alter sequence t1 minvalue=25 maxvalue=20;
ERROR HY000: Sequence 'test.t1' values are conflicting ERROR HY000: Sequence 'test.t1' has out of range value for options
drop sequence t1; drop sequence t1;
create table t1 (a int); create table t1 (a int);
alter sequence t1 minvalue=100; alter sequence t1 minvalue=100;
ERROR 42S02: 'test.t1' is not a SEQUENCE ERROR 42S02: 'test.t1' is not a SEQUENCE
drop table t1; drop table t1;
alter sequence if exists t1 minvalue=100; alter sequence if exists t1 minvalue=100;
Warnings: ERROR 42S02: Unknown SEQUENCE: 't1'
Note 4091 Unknown SEQUENCE: 'test.t1'
alter sequence t1 minvalue=100; alter sequence t1 minvalue=100;
ERROR 42S02: Table 'test.t1' doesn't exist ERROR 42S02: Unknown SEQUENCE: 't1'
create sequence t1; create sequence t1;
alter sequence t1; alter sequence t1;
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 '' at line 1 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 '' at line 1

View File

@ -119,8 +119,9 @@ create table t1 (a int);
alter sequence t1 minvalue=100; alter sequence t1 minvalue=100;
drop table t1; drop table t1;
--error ER_UNKNOWN_SEQUENCES
alter sequence if exists t1 minvalue=100; alter sequence if exists t1 minvalue=100;
--error ER_NO_SUCH_TABLE --error ER_UNKNOWN_SEQUENCES
alter sequence t1 minvalue=100; alter sequence t1 minvalue=100;
create sequence t1; create sequence t1;

View File

@ -53,7 +53,7 @@ next value for s1
drop sequence s1; drop sequence s1;
CREATE SEQUENCE t1; CREATE SEQUENCE t1;
alter sequence t1 minvalue=100; alter sequence t1 minvalue=100;
ERROR HY000: Sequence 'test.t1' values are conflicting ERROR HY000: Sequence 'test.t1' has out of range value for options
alter sequence t1 minvalue=100 start=100 restart=100; alter sequence t1 minvalue=100 start=100 restart=100;
rename table t1 to t2; rename table t1 to t2;
select next value for t2; select next value for t2;

View File

@ -167,11 +167,11 @@ drop sequence if exists t1;
Warnings: Warnings:
Note 4090 'test.t1' is not a SEQUENCE Note 4090 'test.t1' is not a SEQUENCE
create sequence t1 start with 10 maxvalue=9; create sequence t1 start with 10 maxvalue=9;
ERROR HY000: Sequence 'test.t1' values are conflicting ERROR HY000: Sequence 'test.t1' has out of range value for options
create sequence t1 minvalue= 100 maxvalue=10; create sequence t1 minvalue= 100 maxvalue=10;
ERROR HY000: Sequence 'test.t1' values are conflicting ERROR HY000: Sequence 'test.t1' has out of range value for options
create sequence t1 start with 9 minvalue=10; create sequence t1 start with 9 minvalue=10;
ERROR HY000: Sequence 'test.t1' values are conflicting ERROR HY000: Sequence 'test.t1' has out of range value for options
create or replace sequence t1 maxvalue=13, increment by -1; create or replace sequence t1 maxvalue=13, increment by -1;
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 ' increment by -1' at line 1 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 ' increment by -1' at line 1
create or replace sequence t1 start with= 10 maxvalue=13; create or replace sequence t1 start with= 10 maxvalue=13;
@ -183,7 +183,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
create or replace sequence t1 start with 10 min_value=1 NO MINVALUE; create or replace sequence t1 start with 10 min_value=1 NO MINVALUE;
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 'NO MINVALUE' at line 1 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 'NO MINVALUE' at line 1
create sequence t1 start with 10 maxvalue=9223372036854775807; create sequence t1 start with 10 maxvalue=9223372036854775807;
ERROR HY000: Sequence 'test.t1' values are conflicting ERROR HY000: Sequence 'test.t1' has out of range value for options
create sequence t1 start with 10 minvalue=-9223372036854775808; create sequence t1 start with 10 minvalue=-9223372036854775808;
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 '9223372036854775808' at line 1 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 '9223372036854775808' at line 1
create sequence t1 RESTART WITH 10; create sequence t1 RESTART WITH 10;
@ -477,7 +477,7 @@ next value for t1
1 1
drop temporary table t1; drop temporary table t1;
select previous value for t1; select previous value for t1;
ERROR 42S02: Table 'test.t1' doesn't exist ERROR 42S02: Unknown SEQUENCE: 't1'
CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10; CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10;
select next value for t1; select next value for t1;
next value for t1 next value for t1
@ -506,7 +506,7 @@ next value for t1
1 1
drop temporary table t1; drop temporary table t1;
select previous value for t1; select previous value for t1;
ERROR 42S02: Table 'test.t1' doesn't exist ERROR 42S02: Unknown SEQUENCE: 't1'
CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10 engine=innodb; CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10 engine=innodb;
select next value for t1; select next value for t1;
next value for t1 next value for t1
@ -686,3 +686,33 @@ set global innodb_force_primary_key=default;
ALTER TABLE s1 ADD PRIMARY KEY (next_not_cached_value); ALTER TABLE s1 ADD PRIMARY KEY (next_not_cached_value);
ERROR HY000: Sequence 'test.s1' table structure is invalid (Sequence tables cannot have any keys) ERROR HY000: Sequence 'test.s1' table structure is invalid (Sequence tables cannot have any keys)
DROP SEQUENCE s1; DROP SEQUENCE s1;
#
# Beginning of 10.4 Test
#
# MDEV-13005: Fixing bugs in SEQUENCE, part 3
#
# Task 1:
SET @x = PREVIOUS VALUE FOR x;
ERROR 42S02: Unknown SEQUENCE: 'x'
# Task 2:
CREATE SEQUENCE x START WITH 1 INCREMENT BY 123456789012345678;
ERROR HY000: Sequence 'test.x' has out of range value for options
# Task 3:
CREATE SEQUENCE seq1 START WITH 1 cache -1;
ERROR HY000: Sequence 'test.seq1' has out of range value for options
# Task 4:
CREATE TEMPORARY TABLE s1 (s1 INT);
DROP TEMPORARY SEQUENCE s1;
ERROR 42S02: 'test.s1' is not a SEQUENCE
DROP TEMPORARY TABLE s1;
# Task 5:
CREATE TEMPORARY TABLE s1 (s1 INT);
CREATE TEMPORARY SEQUENCE s1 (s1 INT);
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 '(s1 INT)' at line 1
DROP TEMPORARY TABLE s1;
# Task 6:
CREATE SEQUENCE seq1 START WITH 2;
CREATE TRIGGER s1 BEFORE UPDATE ON seq1 FOR EACH ROW SET @a= 5;
ERROR HY000: Trigger's 'seq1' is view, temporary table or sequence
DROP SEQUENCE seq1;
# End of 10.4 test

View File

@ -382,7 +382,7 @@ drop view v1;
CREATE TEMPORARY SEQUENCE t1; CREATE TEMPORARY SEQUENCE t1;
select next value for t1; select next value for t1;
drop temporary table t1; drop temporary table t1;
--error ER_NO_SUCH_TABLE --error ER_UNKNOWN_SEQUENCES
select previous value for t1; select previous value for t1;
CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10; CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10;
select next value for t1; select next value for t1;
@ -398,7 +398,7 @@ drop sequence t1;
CREATE TEMPORARY SEQUENCE t1 engine=innodb; CREATE TEMPORARY SEQUENCE t1 engine=innodb;
select next value for t1; select next value for t1;
drop temporary table t1; drop temporary table t1;
--error ER_NO_SUCH_TABLE --error ER_UNKNOWN_SEQUENCES
select previous value for t1; select previous value for t1;
CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10 engine=innodb; CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10 engine=innodb;
select next value for t1; select next value for t1;
@ -515,3 +515,41 @@ set global innodb_force_primary_key=default;
--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE --error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
ALTER TABLE s1 ADD PRIMARY KEY (next_not_cached_value); ALTER TABLE s1 ADD PRIMARY KEY (next_not_cached_value);
DROP SEQUENCE s1; DROP SEQUENCE s1;
--echo #
--echo # Beginning of 10.4 Test
--echo #
--echo # MDEV-13005: Fixing bugs in SEQUENCE, part 3
--echo #
--echo # Task 1:
--error ER_UNKNOWN_SEQUENCES
SET @x = PREVIOUS VALUE FOR x;
--echo # Task 2:
--error ER_SEQUENCE_INVALID_DATA
CREATE SEQUENCE x START WITH 1 INCREMENT BY 123456789012345678;
--echo # Task 3:
--error ER_SEQUENCE_INVALID_DATA
CREATE SEQUENCE seq1 START WITH 1 cache -1;
--echo # Task 4:
CREATE TEMPORARY TABLE s1 (s1 INT);
--error ER_NOT_SEQUENCE2
DROP TEMPORARY SEQUENCE s1;
DROP TEMPORARY TABLE s1;
--echo # Task 5:
CREATE TEMPORARY TABLE s1 (s1 INT);
--error ER_PARSE_ERROR
CREATE TEMPORARY SEQUENCE s1 (s1 INT);
DROP TEMPORARY TABLE s1;
--echo # Task 6:
CREATE SEQUENCE seq1 START WITH 2;
--error ER_TRG_ON_VIEW_OR_TEMP_TABLE
CREATE TRIGGER s1 BEFORE UPDATE ON seq1 FOR EACH ROW SET @a= 5;
DROP SEQUENCE seq1;
--echo # End of 10.4 test

View File

@ -109,28 +109,28 @@ maxvalue 100000
increment by 1 increment by 1
nocache nocache
nocycle; nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1 create sequence s2 start with 1
minvalue 5 minvalue 5
maxvalue 5 maxvalue 5
increment by 1 increment by 1
nocache nocache
nocycle; nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1 create sequence s2 start with 1
minvalue 5 minvalue 5
maxvalue 4 maxvalue 4
increment by 1 increment by 1
nocache nocache
nocycle; nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1 create sequence s2 start with 1
minvalue 5 minvalue 5
maxvalue 4 maxvalue 4
increment by 0 increment by 0
nocache nocache
nocycle; nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting ERROR HY000: Sequence 's_db.s2' has out of range value for options
########################################### ###########################################
global read lock prevent query sequence global read lock prevent query sequence
########################################### ###########################################
@ -314,7 +314,7 @@ next_not_cached_value minimum_value maximum_value start_value increment cache_si
update s_t set next_not_cached_value= 11,start_value=10, minimum_value=11; update s_t set next_not_cached_value= 11,start_value=10, minimum_value=11;
ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s_t` doesn't have this option ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s_t` doesn't have this option
ALTER SEQUENCE s_t restart with 11 start=10 minvalue=11; ALTER SEQUENCE s_t restart with 11 start=10 minvalue=11;
ERROR HY000: Sequence 's_db.s_t' values are conflicting ERROR HY000: Sequence 's_db.s_t' has out of range value for options
commit; commit;
create table t_1(id int); create table t_1(id int);
insert into t_1 value(1111); insert into t_1 value(1111);

View File

@ -387,7 +387,7 @@ previous value for t1
1 1
drop sequence t1; drop sequence t1;
select previous value for t1; select previous value for t1;
ERROR 42S02: Table 'test.t1' doesn't exist ERROR 42S02: Unknown SEQUENCE: 't1'
CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle; CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
select previous value for t1; select previous value for t1;
previous value for t1 previous value for t1

View File

@ -166,7 +166,7 @@ select previous value for t1;
flush tables; flush tables;
select previous value for t1; select previous value for t1;
drop sequence t1; drop sequence t1;
--error ER_NO_SUCH_TABLE --error ER_UNKNOWN_SEQUENCES
select previous value for t1; select previous value for t1;
CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle; CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
select previous value for t1; select previous value for t1;

View File

@ -50,9 +50,9 @@ ERROR HY000: Field 'maximum_value' doesn't have a default value
insert into s1 values (next value for s1, 1,9223372036854775806,1,1,1000,0,0); insert into s1 values (next value for s1, 1,9223372036854775806,1,1,1000,0,0);
ERROR HY000: Table 's1' is specified twice, both as a target for 'INSERT' and as a separate source for data ERROR HY000: Table 's1' is specified twice, both as a target for 'INSERT' and as a separate source for data
insert into s1 values(1000,9223372036854775806,1,1,1,1000,0,0); insert into s1 values(1000,9223372036854775806,1,1,1,1000,0,0);
ERROR HY000: Sequence 'test.s1' values are conflicting ERROR HY000: Sequence 'test.s1' has out of range value for options
insert into s1 values(0,9223372036854775806,1,1,1,1000,0,0); insert into s1 values(0,9223372036854775806,1,1,1,1000,0,0);
ERROR HY000: Sequence 'test.s1' values are conflicting ERROR HY000: Sequence 'test.s1' has out of range value for options
select * from s1; select * from s1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
1 1 9223372036854775806 1 1 1000 0 0 1 1 9223372036854775806 1 1 1000 0 0
@ -67,7 +67,7 @@ select * from s1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
2000 1 9223372036854775806 1 1 1000 0 0 2000 1 9223372036854775806 1 1 1000 0 0
insert into s2 values(0, 1, 10, 1, 2, 1, 1, 0); insert into s2 values(0, 1, 10, 1, 2, 1, 1, 0);
ERROR HY000: Sequence 'test.s2' values are conflicting ERROR HY000: Sequence 'test.s2' has out of range value for options
select * from s1; select * from s1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
2000 1 9223372036854775806 1 1 1000 0 0 2000 1 9223372036854775806 1 1 1000 0 0

View File

@ -227,28 +227,28 @@ maxvalue 100000
increment by 1 increment by 1
nocache nocache
nocycle; nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1 create sequence s2 start with 1
minvalue 5 minvalue 5
maxvalue 5 maxvalue 5
increment by 1 increment by 1
nocache nocache
nocycle; nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1 create sequence s2 start with 1
minvalue 5 minvalue 5
maxvalue 4 maxvalue 4
increment by 1 increment by 1
nocache nocache
nocycle; nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1 create sequence s2 start with 1
minvalue 5 minvalue 5
maxvalue 4 maxvalue 4
increment by 0 increment by 0
nocache nocache
nocycle; nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting ERROR HY000: Sequence 's_db.s2' has out of range value for options
########################################### ###########################################
global read lock prevent query sequence global read lock prevent query sequence
########################################### ###########################################
@ -412,12 +412,12 @@ select * from s_t;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
16 1 20 1 1 5 1 0 16 1 20 1 1 5 1 0
alter sequence s_t minvalue=11 maxvalue=9; alter sequence s_t minvalue=11 maxvalue=9;
ERROR HY000: Sequence 's_db.s_t' values are conflicting ERROR HY000: Sequence 's_db.s_t' has out of range value for options
select * from s_t; select * from s_t;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
16 1 20 1 1 5 1 0 16 1 20 1 1 5 1 0
alter sequence s_t restart= 12 start=10 minvalue=11 maxvalue=20; alter sequence s_t restart= 12 start=10 minvalue=11 maxvalue=20;
ERROR HY000: Sequence 's_db.s_t' values are conflicting ERROR HY000: Sequence 's_db.s_t' has out of range value for options
select * from s_t; select * from s_t;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
16 1 20 1 1 5 1 0 16 1 20 1 1 5 1 0

View File

@ -50,5 +50,17 @@ t4 CREATE TABLE `t4` (
`row_end` timestamp(6) GENERATED ALWAYS AS ROW END, `row_end` timestamp(6) GENERATED ALWAYS AS ROW END,
PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`) PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING ) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
set global debug_dbug=@old_dbug;
drop table t1, t2, t3, t4; drop table t1, t2, t3, t4;
#
# MDEV-19525 remove ER_VERS_FIELD_WRONG_TYPE from init_from_binary_frm_image()
#
create table t1 (x int) with system versioning;
set debug_dbug='+d,error_vers_wrong_type';
show create table t1;
ERROR HY000: Incorrect information in file: './test/t1.frm'
show warnings;
Level Code Message
Warning 4110 `row_start` must be of type TIMESTAMP(6) for system-versioned table `t1`
Error 1033 Incorrect information in file: './test/t1.frm'
drop table t1;
set global debug_dbug=@old_dbug;

View File

@ -411,6 +411,17 @@ check_row_ts(row_start, row_end)
CURRENT ROW CURRENT ROW
drop table t1; drop table t1;
# #
# MDEV-22973 Assertion in compare_record upon multi-update involving versioned table via view
#
create or replace table t1 (a int, primary key (a)) engine=myisam;
insert into t1 values (0);
create or replace table t2 (pk int, b int, primary key (pk), key(b)) engine=innodb with system versioning;
insert into t2 values (1, 0), (2, 0);
create or replace view v as select a, b from t1, t2;
update v set b= null where a = 0 order by b;
drop view v;
drop table t1, t2;
#
# MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob # MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob
# #
create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning; create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning;
@ -426,3 +437,4 @@ update t1 set a = 3 where b <= 9;
update t2 set a = 3 where b <= 9; update t2 set a = 3 where b <= 9;
update t1, t2 set t1.a = 3, t2.a = 3 where t1.b <= 10 and t2.b <= 10 and t1.b = t2.b; update t1, t2 set t1.a = 3, t2.a = 3 where t1.b <= 10 and t2.b <= 10 and t1.b = t2.b;
drop tables t1, t2; drop tables t1, t2;
# End of 10.4 tests

View File

@ -1,5 +1,7 @@
--source include/have_debug.inc --source include/have_debug.inc
--let $datadir=`select @@datadir`
create table t1 (a int); create table t1 (a int);
show create table t1; show create table t1;
@ -30,6 +32,18 @@ set debug_dbug='+d,sysvers_show';
show create table t3; show create table t3;
create table t4 (a int); create table t4 (a int);
show create table t4; show create table t4;
set global debug_dbug=@old_dbug;
drop table t1, t2, t3, t4; drop table t1, t2, t3, t4;
--echo #
--echo # MDEV-19525 remove ER_VERS_FIELD_WRONG_TYPE from init_from_binary_frm_image()
--echo #
create table t1 (x int) with system versioning;
set debug_dbug='+d,error_vers_wrong_type';
--replace_result $datadir ./
--error ER_NOT_FORM_FILE
show create table t1;
--replace_result $datadir ./
show warnings;
drop table t1;
set global debug_dbug=@old_dbug;

View File

@ -336,6 +336,19 @@ select row_start into @r from t1;
select check_row_ts(row_start, row_end) from t1 for system_time all where row_start = @r; select check_row_ts(row_start, row_end) from t1 for system_time all where row_start = @r;
drop table t1; drop table t1;
--echo #
--echo # MDEV-22973 Assertion in compare_record upon multi-update involving versioned table via view
--echo #
create or replace table t1 (a int, primary key (a)) engine=myisam;
insert into t1 values (0);
create or replace table t2 (pk int, b int, primary key (pk), key(b)) engine=innodb with system versioning;
insert into t2 values (1, 0), (2, 0);
create or replace view v as select a, b from t1, t2;
update v set b= null where a = 0 order by b;
# cleanup
drop view v;
drop table t1, t2;
--echo # --echo #
--echo # MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob --echo # MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob
--echo # --echo #
@ -360,4 +373,6 @@ update t1, t2 set t1.a = 3, t2.a = 3 where t1.b <= 10 and t2.b <= 10 and t1.b =
# cleanup # cleanup
drop tables t1, t2; drop tables t1, t2;
--echo # End of 10.4 tests
source suite/versioning/common_finish.inc; source suite/versioning/common_finish.inc;

View File

@ -30,7 +30,8 @@ template <TR_table::field_id_t TRT_FIELD>
class Create_func_trt : public Create_native_func class Create_func_trt : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_trt<TRT_FIELD> s_singleton; static Create_func_trt<TRT_FIELD> s_singleton;
@ -44,7 +45,7 @@ Create_func_trt<TRT_FIELD> Create_func_trt<TRT_FIELD>::s_singleton;
template <TR_table::field_id_t TRT_FIELD> template <TR_table::field_id_t TRT_FIELD>
Item* Item*
Create_func_trt<TRT_FIELD>::create_native(THD *thd, LEX_CSTRING *name, Create_func_trt<TRT_FIELD>::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -103,7 +104,8 @@ template <class Item_func_trt_trx_seesX>
class Create_func_trt_trx_sees : public Create_native_func class Create_func_trt_trx_sees : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list) virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
int arg_count= 0; int arg_count= 0;

View File

@ -35,17 +35,15 @@ set @had_db_table= @@warning_count != 0;
CREATE TABLE IF NOT EXISTS global_priv (Host char(60) binary DEFAULT '', User char(80) binary DEFAULT '', Priv JSON NOT NULL DEFAULT '{}' CHECK(JSON_VALID(Priv)), PRIMARY KEY (Host,User)) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; CREATE TABLE IF NOT EXISTS global_priv (Host char(60) binary DEFAULT '', User char(80) binary DEFAULT '', Priv JSON NOT NULL DEFAULT '{}' CHECK(JSON_VALID(Priv)), PRIMARY KEY (Host,User)) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
set @had_sys_user= 0 <> (select count(*) from mysql.global_priv where Host="localhost" and User="mariadb.sys");
set @exists_user_view= EXISTS (SELECT * FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user'); set @exists_user_view= EXISTS (SELECT * FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user');
set @exists_user_view_by_root= EXISTS (SELECT * FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost'); set @exists_user_view_by_root= EXISTS (SELECT * FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost');
set @need_sys_user_creation= (NOT @had_sys_user) AND (( NOT @exists_user_view) OR @exists_user_view_by_root); set @need_sys_user_creation= (( NOT @exists_user_view) OR @exists_user_view_by_root);
CREATE TEMPORARY TABLE tmp_user_sys LIKE global_priv; CREATE TEMPORARY TABLE tmp_user_sys LIKE global_priv;
INSERT INTO tmp_user_sys (Host,User,Priv) VALUES ('localhost','mariadb.sys','{"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":true,"password_last_changed":0}'); INSERT INTO tmp_user_sys (Host,User,Priv) VALUES ('localhost','mariadb.sys','{"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":true,"password_last_changed":0}');
INSERT INTO global_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation; INSERT IGNORE INTO global_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation;
DROP TABLE tmp_user_sys; DROP TABLE tmp_user_sys;
@ -117,7 +115,7 @@ CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NUL
CREATE TEMPORARY TABLE tmp_user_sys LIKE tables_priv; CREATE TEMPORARY TABLE tmp_user_sys LIKE tables_priv;
INSERT INTO tmp_user_sys (Host,Db,User,Table_name,Grantor,Timestamp,Table_priv) VALUES ('localhost','mysql','mariadb.sys','global_priv','root@localhost','0','Select,Delete'); INSERT INTO tmp_user_sys (Host,Db,User,Table_name,Grantor,Timestamp,Table_priv) VALUES ('localhost','mysql','mariadb.sys','global_priv','root@localhost','0','Select,Delete');
INSERT INTO tables_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation; INSERT IGNORE INTO tables_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation;
DROP TABLE tmp_user_sys; DROP TABLE tmp_user_sys;
CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges';

View File

@ -472,7 +472,7 @@ read_cnf()
encrypt=$(parse_cnf "$encgroups" 'encrypt' 0) encrypt=$(parse_cnf "$encgroups" 'encrypt' 0)
tmode=$(parse_cnf "$encgroups" 'ssl-mode' 'DISABLED' | \ tmode=$(parse_cnf "$encgroups" 'ssl-mode' 'DISABLED' | \
tr [:lower:] [:upper:]) tr '[[:lower:]]' '[[:upper:]]')
case "$tmode" in case "$tmode" in
'VERIFY_IDENTITY'|'VERIFY_CA'|'REQUIRED'|'DISABLED') 'VERIFY_IDENTITY'|'VERIFY_CA'|'REQUIRED'|'DISABLED')

View File

@ -224,7 +224,7 @@ SSTCERT="$tpem"
SSTCA="$tcert" SSTCA="$tcert"
SSTCAP="$tcap" SSTCAP="$tcap"
SSLMODE=$(parse_cnf "$encgroups" 'ssl-mode' | tr [:lower:] [:upper:]) SSLMODE=$(parse_cnf "$encgroups" 'ssl-mode' | tr '[[:lower:]]' '[[:upper:]]')
if [ -z "$SSLMODE" ]; then if [ -z "$SSLMODE" ]; then
# Implicit verification if CA is set and the SSL mode # Implicit verification if CA is set and the SSL mode

View File

@ -670,6 +670,7 @@ Events::drop_schema_events(THD *thd, const char *db)
{ {
db_repository->drop_schema_events(thd, &db_lex); db_repository->drop_schema_events(thd, &db_lex);
delete db_repository; delete db_repository;
db_repository= 0;
} }
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;

View File

@ -3,7 +3,7 @@
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. Copyright (c) 2005, 2012, Oracle and/or its affiliates.
Copyright (c) 2009, 2021, MariaDB Corporation. Copyright (c) 2009, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -1107,10 +1107,6 @@ public:
NOTE: This cannot be cached since it can depend on TRANSACTION ISOLATION NOTE: This cannot be cached since it can depend on TRANSACTION ISOLATION
LEVEL which is dynamic, see bug#39084. LEVEL which is dynamic, see bug#39084.
HA_READ_RND_SAME:
Not currently used. (Means that the handler supports the rnd_same() call)
(MyISAM, HEAP)
HA_TABLE_SCAN_ON_INDEX: HA_TABLE_SCAN_ON_INDEX:
Used to avoid scanning full tables on an index. If this flag is set then Used to avoid scanning full tables on an index. If this flag is set then
the handler always has a primary key (hidden if not defined) and this the handler always has a primary key (hidden if not defined) and this

View File

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. /* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
Copyright (c) 2009, 2021, MariaDB Corporation. Copyright (c) 2009, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -5776,6 +5776,8 @@ int ha_discover_table(THD *thd, TABLE_SHARE *share)
found= plugin_foreach(thd, discover_handlerton, found= plugin_foreach(thd, discover_handlerton,
MYSQL_STORAGE_ENGINE_PLUGIN, share); MYSQL_STORAGE_ENGINE_PLUGIN, share);
if (thd->lex->query_tables && thd->lex->query_tables->sequence && !found)
my_error(ER_UNKNOWN_SEQUENCES, MYF(0),share->table_name.str);
if (!found) if (!found)
open_table_error(share, OPEN_FRM_OPEN_ERROR, ENOENT); // not found open_table_error(share, OPEN_FRM_OPEN_ERROR, ENOENT); // not found
@ -7476,17 +7478,6 @@ void handler::unlock_shared_ha_data()
mysql_mutex_unlock(&table_share->LOCK_ha_data); mysql_mutex_unlock(&table_share->LOCK_ha_data);
} }
/** @brief
Dummy function which accept information about log files which is not need
by handlers
*/
void signal_log_not_needed(struct handlerton, char *log_file)
{
DBUG_ENTER("signal_log_not_needed");
DBUG_PRINT("enter", ("logfile '%s'", log_file));
DBUG_VOID_RETURN;
}
void handler::set_lock_type(enum thr_lock_type lock) void handler::set_lock_type(enum thr_lock_type lock)
{ {
table->reginfo.lock_type= lock; table->reginfo.lock_type= lock;
@ -7555,177 +7546,6 @@ int ha_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal)
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
#ifdef TRANS_LOG_MGM_EXAMPLE_CODE
/*
Example of transaction log management functions based on assumption that logs
placed into a directory
*/
#include <my_dir.h>
#include <my_sys.h>
int example_of_iterator_using_for_logs_cleanup(handlerton *hton)
{
void *buffer;
int res= 1;
struct handler_iterator iterator;
struct handler_log_file_data data;
if (!hton->create_iterator)
return 1; /* iterator creator is not supported */
if ((*hton->create_iterator)(hton, HA_TRANSACTLOG_ITERATOR, &iterator) !=
HA_ITERATOR_OK)
{
/* error during creation of log iterator or iterator is not supported */
return 1;
}
while((*iterator.next)(&iterator, (void*)&data) == 0)
{
printf("%s\n", data.filename.str);
if (data.status == HA_LOG_STATUS_FREE &&
mysql_file_delete(INSTRUMENT_ME,
data.filename.str, MYF(MY_WME)))
goto err;
}
res= 0;
err:
(*iterator.destroy)(&iterator);
return res;
}
/*
Here we should get info from handler where it save logs but here is
just example, so we use constant.
IMHO FN_ROOTDIR ("/") is safe enough for example, because nobody has
rights on it except root and it consist of directories only at lest for
*nix (sorry, can't find windows-safe solution here, but it is only example).
*/
#define fl_dir FN_ROOTDIR
/** @brief
Dummy function to return log status should be replaced by function which
really detect the log status and check that the file is a log of this
handler.
*/
enum log_status fl_get_log_status(char *log)
{
MY_STAT stat_buff;
if (mysql_file_stat(INSTRUMENT_ME, log, &stat_buff, MYF(0)))
return HA_LOG_STATUS_INUSE;
return HA_LOG_STATUS_NOSUCHLOG;
}
struct fl_buff
{
LEX_STRING *names;
enum log_status *statuses;
uint32 entries;
uint32 current;
};
int fl_log_iterator_next(struct handler_iterator *iterator,
void *iterator_object)
{
struct fl_buff *buff= (struct fl_buff *)iterator->buffer;
struct handler_log_file_data *data=
(struct handler_log_file_data *) iterator_object;
if (buff->current >= buff->entries)
return 1;
data->filename= buff->names[buff->current];
data->status= buff->statuses[buff->current];
buff->current++;
return 0;
}
void fl_log_iterator_destroy(struct handler_iterator *iterator)
{
my_free(iterator->buffer);
}
/** @brief
returns buffer, to be assigned in handler_iterator struct
*/
enum handler_create_iterator_result
fl_log_iterator_buffer_init(struct handler_iterator *iterator)
{
MY_DIR *dirp;
struct fl_buff *buff;
char *name_ptr;
uchar *ptr;
FILEINFO *file;
uint32 i;
/* to be able to make my_free without crash in case of error */
iterator->buffer= 0;
if (!(dirp = my_dir(fl_dir, MYF(MY_THREAD_SPECIFIC))))
{
return HA_ITERATOR_ERROR;
}
if ((ptr= (uchar*)my_malloc(ALIGN_SIZE(sizeof(fl_buff)) +
((ALIGN_SIZE(sizeof(LEX_STRING)) +
sizeof(enum log_status) +
+ FN_REFLEN + 1) *
(uint) dirp->number_off_files),
MYF(MY_THREAD_SPECIFIC))) == 0)
{
return HA_ITERATOR_ERROR;
}
buff= (struct fl_buff *)ptr;
buff->entries= buff->current= 0;
ptr= ptr + (ALIGN_SIZE(sizeof(fl_buff)));
buff->names= (LEX_STRING*) (ptr);
ptr= ptr + ((ALIGN_SIZE(sizeof(LEX_STRING)) *
(uint) dirp->number_off_files));
buff->statuses= (enum log_status *)(ptr);
name_ptr= (char *)(ptr + (sizeof(enum log_status) *
(uint) dirp->number_off_files));
for (i=0 ; i < (uint) dirp->number_off_files ; i++)
{
enum log_status st;
file= dirp->dir_entry + i;
if ((file->name[0] == '.' &&
((file->name[1] == '.' && file->name[2] == '\0') ||
file->name[1] == '\0')))
continue;
if ((st= fl_get_log_status(file->name)) == HA_LOG_STATUS_NOSUCHLOG)
continue;
name_ptr= strxnmov(buff->names[buff->entries].str= name_ptr,
FN_REFLEN, fl_dir, file->name, NullS);
buff->names[buff->entries].length= (name_ptr -
buff->names[buff->entries].str);
buff->statuses[buff->entries]= st;
buff->entries++;
}
iterator->buffer= buff;
iterator->next= &fl_log_iterator_next;
iterator->destroy= &fl_log_iterator_destroy;
my_dirend(dirp);
return HA_ITERATOR_OK;
}
/* An example of a iterator creator */
enum handler_create_iterator_result
fl_create_iterator(enum handler_iterator_type type,
struct handler_iterator *iterator)
{
switch(type) {
case HA_TRANSACTLOG_ITERATOR:
return fl_log_iterator_buffer_init(iterator);
default:
return HA_ITERATOR_UNSUPPORTED;
}
}
#endif /*TRANS_LOG_MGM_EXAMPLE_CODE*/
bool HA_CREATE_INFO::check_conflicting_charset_declarations(CHARSET_INFO *cs) bool HA_CREATE_INFO::check_conflicting_charset_declarations(CHARSET_INFO *cs)
{ {
if ((used_fields & HA_CREATE_USED_DEFAULT_CHARSET) && if ((used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&

View File

@ -1093,31 +1093,6 @@ typedef bool (stat_print_fn)(THD *thd, const char *type, size_t type_len,
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX }; enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
extern MYSQL_PLUGIN_IMPORT st_plugin_int *hton2plugin[MAX_HA]; extern MYSQL_PLUGIN_IMPORT st_plugin_int *hton2plugin[MAX_HA];
/* Transaction log maintains type definitions */
enum log_status
{
HA_LOG_STATUS_FREE= 0, /* log is free and can be deleted */
HA_LOG_STATUS_INUSE= 1, /* log can't be deleted because it is in use */
HA_LOG_STATUS_NOSUCHLOG= 2 /* no such log (can't be returned by
the log iterator status) */
};
/*
Function for signaling that the log file changed its state from
LOG_STATUS_INUSE to LOG_STATUS_FREE
Now it do nothing, will be implemented as part of new transaction
log management for engines.
TODO: implement the function.
*/
void signal_log_not_needed(struct handlerton, char *log_file);
/*
Data of transaction log iterator.
*/
struct handler_log_file_data {
LEX_STRING filename;
enum log_status status;
};
/* /*
Definitions for engine-specific table/field/index options in the CREATE TABLE. Definitions for engine-specific table/field/index options in the CREATE TABLE.
@ -1232,46 +1207,6 @@ typedef struct st_ha_create_table_option {
struct st_mysql_sys_var *var; struct st_mysql_sys_var *var;
} ha_create_table_option; } ha_create_table_option;
enum handler_iterator_type
{
/* request of transaction log iterator */
HA_TRANSACTLOG_ITERATOR= 1
};
enum handler_create_iterator_result
{
HA_ITERATOR_OK, /* iterator created */
HA_ITERATOR_UNSUPPORTED, /* such type of iterator is not supported */
HA_ITERATOR_ERROR /* error during iterator creation */
};
/*
Iterator structure. Can be used by handler/handlerton for different purposes.
Iterator should be created in the way to point "before" the first object
it iterate, so next() call move it to the first object or return !=0 if
there is nothing to iterate through.
*/
struct handler_iterator {
/*
Moves iterator to next record and return 0 or return !=0
if there is no records.
iterator_object will be filled by this function if next() returns 0.
Content of the iterator_object depend on iterator type.
*/
int (*next)(struct handler_iterator *, void *iterator_object);
/*
Free resources allocated by iterator, after this call iterator
is not usable.
*/
void (*destroy)(struct handler_iterator *);
/*
Pointer to buffer for the iterator to use.
Should be allocated by function which created the iterator and
destroyed by freed by above "destroy" call
*/
void *buffer;
};
class handler; class handler;
class group_by_handler; class group_by_handler;
class derived_handler; class derived_handler;
@ -1536,22 +1471,6 @@ struct handlerton
const char *query, uint query_length, const char *query, uint query_length,
const char *db, const char *table_name); const char *db, const char *table_name);
/*
Get log status.
If log_status is null then the handler do not support transaction
log information (i.e. log iterator can't be created).
(see example of implementation in handler.cc, TRANS_LOG_MGM_EXAMPLE_CODE)
*/
enum log_status (*get_log_status)(handlerton *hton, char *log);
/*
Iterators creator.
Presence of the pointer should be checked before using
*/
enum handler_create_iterator_result
(*create_iterator)(handlerton *hton, enum handler_iterator_type type,
struct handler_iterator *fill_this_in);
void (*abort_transaction)(handlerton *hton, THD *bf_thd, void (*abort_transaction)(handlerton *hton, THD *bf_thd,
THD *victim_thd, my_bool signal); THD *victim_thd, my_bool signal);
int (*set_checkpoint)(handlerton *hton, const XID* xid); int (*set_checkpoint)(handlerton *hton, const XID* xid);
@ -4002,15 +3921,13 @@ public:
inline int ha_read_first_row(uchar *buf, uint primary_key); inline int ha_read_first_row(uchar *buf, uint primary_key);
/** /**
The following 3 function is only needed for tables that may be The following 2 function is only needed for tables that may be
internal temporary tables during joins. internal temporary tables during joins.
*/ */
virtual int remember_rnd_pos() virtual int remember_rnd_pos()
{ return HA_ERR_WRONG_COMMAND; } { return HA_ERR_WRONG_COMMAND; }
virtual int restart_rnd_next(uchar *buf) virtual int restart_rnd_next(uchar *buf)
{ return HA_ERR_WRONG_COMMAND; } { return HA_ERR_WRONG_COMMAND; }
virtual int rnd_same(uchar *buf, uint inx)
{ return HA_ERR_WRONG_COMMAND; }
virtual ha_rows records_in_range(uint inx, const key_range *min_key, virtual ha_rows records_in_range(uint inx, const key_range *min_key,
const key_range *max_key, const key_range *max_key,

View File

@ -1,6 +1,6 @@
/* /*
Copyright (c) 2000, 2011, Oracle and/or its affiliates. Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2008, 2021, MariaDB Corporation. Copyright (c) 2008, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -80,7 +80,9 @@ extern Native_func_registry_array native_func_registry_array_geom;
class Create_sp_func : public Create_qfunc class Create_sp_func : public Create_qfunc
{ {
public: public:
virtual Item *create_with_db(THD *thd, LEX_CSTRING *db, LEX_CSTRING *name, virtual Item *create_with_db(THD *thd,
const LEX_CSTRING *db,
const LEX_CSTRING *name,
bool use_explicit_name, List<Item> *item_list); bool use_explicit_name, List<Item> *item_list);
static Create_sp_func s_singleton; static Create_sp_func s_singleton;
@ -180,7 +182,8 @@ protected:
class Create_func_atan : public Create_native_func class Create_func_atan : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_atan s_singleton; static Create_func_atan s_singleton;
@ -371,7 +374,8 @@ protected:
class Create_func_concat : public Create_native_func class Create_func_concat : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_concat s_singleton; static Create_func_concat s_singleton;
@ -384,7 +388,8 @@ protected:
class Create_func_concat_operator_oracle : public Create_native_func class Create_func_concat_operator_oracle : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_concat_operator_oracle s_singleton; static Create_func_concat_operator_oracle s_singleton;
@ -410,7 +415,8 @@ protected:
class Create_func_decode_oracle : public Create_native_func class Create_func_decode_oracle : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_decode_oracle s_singleton; static Create_func_decode_oracle s_singleton;
@ -423,7 +429,8 @@ protected:
class Create_func_concat_ws : public Create_native_func class Create_func_concat_ws : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_concat_ws s_singleton; static Create_func_concat_ws s_singleton;
@ -605,7 +612,8 @@ protected:
class Create_func_des_decrypt : public Create_native_func class Create_func_des_decrypt : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_des_decrypt s_singleton; static Create_func_des_decrypt s_singleton;
@ -618,7 +626,8 @@ protected:
class Create_func_des_encrypt : public Create_native_func class Create_func_des_encrypt : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_des_encrypt s_singleton; static Create_func_des_encrypt s_singleton;
@ -631,7 +640,8 @@ protected:
class Create_func_elt : public Create_native_func class Create_func_elt : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_elt s_singleton; static Create_func_elt s_singleton;
@ -657,7 +667,8 @@ protected:
class Create_func_encrypt : public Create_native_func class Create_func_encrypt : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_encrypt s_singleton; static Create_func_encrypt s_singleton;
@ -683,7 +694,8 @@ protected:
class Create_func_export_set : public Create_native_func class Create_func_export_set : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_export_set s_singleton; static Create_func_export_set s_singleton;
@ -696,7 +708,8 @@ protected:
class Create_func_field : public Create_native_func class Create_func_field : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_field s_singleton; static Create_func_field s_singleton;
@ -735,7 +748,8 @@ protected:
class Create_func_format : public Create_native_func class Create_func_format : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_format s_singleton; static Create_func_format s_singleton;
@ -787,7 +801,8 @@ protected:
class Create_func_from_unixtime : public Create_native_func class Create_func_from_unixtime : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_from_unixtime s_singleton; static Create_func_from_unixtime s_singleton;
@ -813,7 +828,8 @@ protected:
class Create_func_greatest : public Create_native_func class Create_func_greatest : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_greatest s_singleton; static Create_func_greatest s_singleton;
@ -956,7 +972,8 @@ protected:
class Create_func_json_detailed: public Create_native_func class Create_func_json_detailed: public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_detailed s_singleton; static Create_func_json_detailed s_singleton;
@ -1021,7 +1038,8 @@ protected:
class Create_func_json_keys: public Create_native_func class Create_func_json_keys: public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_keys s_singleton; static Create_func_json_keys s_singleton;
@ -1034,7 +1052,8 @@ protected:
class Create_func_json_contains: public Create_native_func class Create_func_json_contains: public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_contains s_singleton; static Create_func_json_contains s_singleton;
@ -1047,7 +1066,8 @@ protected:
class Create_func_json_contains_path : public Create_native_func class Create_func_json_contains_path : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_contains_path s_singleton; static Create_func_json_contains_path s_singleton;
@ -1060,7 +1080,8 @@ protected:
class Create_func_json_extract : public Create_native_func class Create_func_json_extract : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_extract s_singleton; static Create_func_json_extract s_singleton;
@ -1073,7 +1094,8 @@ protected:
class Create_func_json_search : public Create_native_func class Create_func_json_search : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_search s_singleton; static Create_func_json_search s_singleton;
@ -1086,7 +1108,8 @@ protected:
class Create_func_json_array : public Create_native_func class Create_func_json_array : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_array s_singleton; static Create_func_json_array s_singleton;
@ -1099,7 +1122,8 @@ protected:
class Create_func_json_array_append : public Create_native_func class Create_func_json_array_append : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_array_append s_singleton; static Create_func_json_array_append s_singleton;
@ -1112,7 +1136,8 @@ protected:
class Create_func_json_array_insert : public Create_native_func class Create_func_json_array_insert : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_array_insert s_singleton; static Create_func_json_array_insert s_singleton;
@ -1125,7 +1150,8 @@ protected:
class Create_func_json_insert : public Create_native_func class Create_func_json_insert : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_insert s_singleton; static Create_func_json_insert s_singleton;
@ -1138,7 +1164,8 @@ protected:
class Create_func_json_set : public Create_native_func class Create_func_json_set : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_set s_singleton; static Create_func_json_set s_singleton;
@ -1151,7 +1178,8 @@ protected:
class Create_func_json_replace : public Create_native_func class Create_func_json_replace : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_replace s_singleton; static Create_func_json_replace s_singleton;
@ -1164,7 +1192,8 @@ protected:
class Create_func_json_remove : public Create_native_func class Create_func_json_remove : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_remove s_singleton; static Create_func_json_remove s_singleton;
@ -1177,7 +1206,8 @@ protected:
class Create_func_json_object : public Create_native_func class Create_func_json_object : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_object s_singleton; static Create_func_json_object s_singleton;
@ -1190,7 +1220,8 @@ protected:
class Create_func_json_length : public Create_native_func class Create_func_json_length : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_length s_singleton; static Create_func_json_length s_singleton;
@ -1203,7 +1234,8 @@ protected:
class Create_func_json_merge : public Create_native_func class Create_func_json_merge : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_merge s_singleton; static Create_func_json_merge s_singleton;
@ -1216,7 +1248,8 @@ protected:
class Create_func_json_merge_patch : public Create_native_func class Create_func_json_merge_patch : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_json_merge_patch s_singleton; static Create_func_json_merge_patch s_singleton;
@ -1268,7 +1301,8 @@ protected:
class Create_func_last_insert_id : public Create_native_func class Create_func_last_insert_id : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_last_insert_id s_singleton; static Create_func_last_insert_id s_singleton;
@ -1294,7 +1328,8 @@ protected:
class Create_func_least : public Create_native_func class Create_func_least : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_least s_singleton; static Create_func_least s_singleton;
@ -1386,7 +1421,8 @@ protected:
class Create_func_locate : public Create_native_func class Create_func_locate : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_locate s_singleton; static Create_func_locate s_singleton;
@ -1399,7 +1435,8 @@ protected:
class Create_func_log : public Create_native_func class Create_func_log : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_log s_singleton; static Create_func_log s_singleton;
@ -1438,7 +1475,7 @@ protected:
class Create_func_lpad : public Create_native_func class Create_func_lpad : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
return thd->variables.sql_mode & MODE_ORACLE ? return thd->variables.sql_mode & MODE_ORACLE ?
@ -1450,15 +1487,18 @@ public:
protected: protected:
Create_func_lpad() {} Create_func_lpad() {}
virtual ~Create_func_lpad() {} virtual ~Create_func_lpad() {}
Item *create_native_std(THD *thd, LEX_CSTRING *name, List<Item> *items); Item *create_native_std(THD *thd, const LEX_CSTRING *name,
Item *create_native_oracle(THD *thd, LEX_CSTRING *name, List<Item> *items); List<Item> *items);
Item *create_native_oracle(THD *thd, const LEX_CSTRING *name,
List<Item> *items);
}; };
class Create_func_lpad_oracle : public Create_func_lpad class Create_func_lpad_oracle : public Create_func_lpad
{ {
public: public:
Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list) Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{ {
return create_native_oracle(thd, name, item_list); return create_native_oracle(thd, name, item_list);
} }
@ -1521,7 +1561,8 @@ protected:
class Create_func_make_set : public Create_native_func class Create_func_make_set : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_make_set s_singleton; static Create_func_make_set s_singleton;
@ -1534,7 +1575,8 @@ protected:
class Create_func_master_pos_wait : public Create_native_func class Create_func_master_pos_wait : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_master_pos_wait s_singleton; static Create_func_master_pos_wait s_singleton;
@ -1547,7 +1589,8 @@ protected:
class Create_func_master_gtid_wait : public Create_native_func class Create_func_master_gtid_wait : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_master_gtid_wait s_singleton; static Create_func_master_gtid_wait s_singleton;
@ -1755,7 +1798,8 @@ protected:
class Create_func_rand : public Create_native_func class Create_func_rand : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_rand s_singleton; static Create_func_rand s_singleton;
@ -1816,7 +1860,8 @@ protected:
class Create_func_round : public Create_native_func class Create_func_round : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_round s_singleton; static Create_func_round s_singleton;
@ -1829,7 +1874,7 @@ protected:
class Create_func_rpad : public Create_native_func class Create_func_rpad : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
return thd->variables.sql_mode & MODE_ORACLE ? return thd->variables.sql_mode & MODE_ORACLE ?
@ -1841,15 +1886,18 @@ public:
protected: protected:
Create_func_rpad() {} Create_func_rpad() {}
virtual ~Create_func_rpad() {} virtual ~Create_func_rpad() {}
Item *create_native_std(THD *thd, LEX_CSTRING *name, List<Item> *items); Item *create_native_std(THD *thd, const LEX_CSTRING *name,
Item *create_native_oracle(THD *thd, LEX_CSTRING *name, List<Item> *items); List<Item> *items);
Item *create_native_oracle(THD *thd, const LEX_CSTRING *name,
List<Item> *items);
}; };
class Create_func_rpad_oracle : public Create_func_rpad class Create_func_rpad_oracle : public Create_func_rpad
{ {
public: public:
Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list) Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{ {
return create_native_oracle(thd, name, item_list); return create_native_oracle(thd, name, item_list);
} }
@ -2042,7 +2090,7 @@ protected:
class Create_func_substr_oracle : public Create_native_func class Create_func_substr_oracle : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list); List<Item> *item_list);
static Create_func_substr_oracle s_singleton; static Create_func_substr_oracle s_singleton;
@ -2211,7 +2259,8 @@ protected:
class Create_func_unix_timestamp : public Create_native_func class Create_func_unix_timestamp : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_unix_timestamp s_singleton; static Create_func_unix_timestamp s_singleton;
@ -2316,7 +2365,8 @@ protected:
class Create_func_wsrep_sync_wait_upto : public Create_native_func class Create_func_wsrep_sync_wait_upto : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); Item *create_native(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
override;
static Create_func_wsrep_sync_wait_upto s_singleton; static Create_func_wsrep_sync_wait_upto s_singleton;
@ -2356,7 +2406,8 @@ protected:
class Create_func_year_week : public Create_native_func class Create_func_year_week : public Create_native_func
{ {
public: public:
virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
static Create_func_year_week s_singleton; static Create_func_year_week s_singleton;
@ -2397,7 +2448,8 @@ static bool has_named_parameters(List<Item> *params)
Item* Item*
Create_qfunc::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list) Create_qfunc::create_func(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{ {
LEX_CSTRING db; LEX_CSTRING db;
@ -2430,7 +2482,8 @@ Create_qfunc::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list)
Create_udf_func Create_udf_func::s_singleton; Create_udf_func Create_udf_func::s_singleton;
Item* Item*
Create_udf_func::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list) Create_udf_func::create_func(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{ {
udf_func *udf= find_udf(name->str, name->length); udf_func *udf= find_udf(name->str, name->length);
DBUG_ASSERT(udf); DBUG_ASSERT(udf);
@ -2540,7 +2593,9 @@ Create_udf_func::create(THD *thd, udf_func *udf, List<Item> *item_list)
Create_sp_func Create_sp_func::s_singleton; Create_sp_func Create_sp_func::s_singleton;
Item* Item*
Create_sp_func::create_with_db(THD *thd, LEX_CSTRING *db, LEX_CSTRING *name, Create_sp_func::create_with_db(THD *thd,
const LEX_CSTRING *db,
const LEX_CSTRING *name,
bool use_explicit_name, List<Item> *item_list) bool use_explicit_name, List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -2587,7 +2642,8 @@ Create_sp_func::create_with_db(THD *thd, LEX_CSTRING *db, LEX_CSTRING *name,
Item* Item*
Create_native_func::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list) Create_native_func::create_func(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{ {
if (unlikely(has_named_parameters(item_list))) if (unlikely(has_named_parameters(item_list)))
{ {
@ -2600,7 +2656,8 @@ Create_native_func::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_li
Item* Item*
Create_func_arg0::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list) Create_func_arg0::create_func(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -2618,7 +2675,8 @@ Create_func_arg0::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list
Item* Item*
Create_func_arg1::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list) Create_func_arg1::create_func(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -2644,7 +2702,8 @@ Create_func_arg1::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list
Item* Item*
Create_func_arg2::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list) Create_func_arg2::create_func(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -2672,7 +2731,8 @@ Create_func_arg2::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list
Item* Item*
Create_func_arg3::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list) Create_func_arg3::create_func(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -2758,7 +2818,7 @@ Create_func_asin::create_1_arg(THD *thd, Item *arg1)
Create_func_atan Create_func_atan::s_singleton; Create_func_atan Create_func_atan::s_singleton;
Item* Item*
Create_func_atan::create_native(THD *thd, LEX_CSTRING *name, Create_func_atan::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item* func= NULL; Item* func= NULL;
@ -2920,7 +2980,7 @@ Create_func_dyncol_json::create_1_arg(THD *thd, Item *arg1)
Create_func_concat Create_func_concat::s_singleton; Create_func_concat Create_func_concat::s_singleton;
Item* Item*
Create_func_concat::create_native(THD *thd, LEX_CSTRING *name, Create_func_concat::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -2943,7 +3003,7 @@ Create_func_concat_operator_oracle
Create_func_concat_operator_oracle::s_singleton; Create_func_concat_operator_oracle::s_singleton;
Item* Item*
Create_func_concat_operator_oracle::create_native(THD *thd, LEX_CSTRING *name, Create_func_concat_operator_oracle::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -2971,7 +3031,7 @@ Create_func_decode_histogram::create_2_arg(THD *thd, Item *arg1, Item *arg2)
Create_func_decode_oracle Create_func_decode_oracle::s_singleton; Create_func_decode_oracle Create_func_decode_oracle::s_singleton;
Item* Item*
Create_func_decode_oracle::create_native(THD *thd, LEX_CSTRING *name, Create_func_decode_oracle::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
uint arg_count= item_list ? item_list->elements : 0; uint arg_count= item_list ? item_list->elements : 0;
@ -2986,7 +3046,7 @@ Create_func_decode_oracle::create_native(THD *thd, LEX_CSTRING *name,
Create_func_concat_ws Create_func_concat_ws::s_singleton; Create_func_concat_ws Create_func_concat_ws::s_singleton;
Item* Item*
Create_func_concat_ws::create_native(THD *thd, LEX_CSTRING *name, Create_func_concat_ws::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -3138,7 +3198,7 @@ Create_func_degrees::create_1_arg(THD *thd, Item *arg1)
Create_func_des_decrypt Create_func_des_decrypt::s_singleton; Create_func_des_decrypt Create_func_des_decrypt::s_singleton;
Item* Item*
Create_func_des_decrypt::create_native(THD *thd, LEX_CSTRING *name, Create_func_des_decrypt::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -3175,7 +3235,7 @@ Create_func_des_decrypt::create_native(THD *thd, LEX_CSTRING *name,
Create_func_des_encrypt Create_func_des_encrypt::s_singleton; Create_func_des_encrypt Create_func_des_encrypt::s_singleton;
Item* Item*
Create_func_des_encrypt::create_native(THD *thd, LEX_CSTRING *name, Create_func_des_encrypt::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -3212,7 +3272,7 @@ Create_func_des_encrypt::create_native(THD *thd, LEX_CSTRING *name,
Create_func_elt Create_func_elt::s_singleton; Create_func_elt Create_func_elt::s_singleton;
Item* Item*
Create_func_elt::create_native(THD *thd, LEX_CSTRING *name, Create_func_elt::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -3242,7 +3302,7 @@ Create_func_encode::create_2_arg(THD *thd, Item *arg1, Item *arg2)
Create_func_encrypt Create_func_encrypt::s_singleton; Create_func_encrypt Create_func_encrypt::s_singleton;
Item* Item*
Create_func_encrypt::create_native(THD *thd, LEX_CSTRING *name, Create_func_encrypt::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -3289,7 +3349,7 @@ Create_func_exp::create_1_arg(THD *thd, Item *arg1)
Create_func_export_set Create_func_export_set::s_singleton; Create_func_export_set Create_func_export_set::s_singleton;
Item* Item*
Create_func_export_set::create_native(THD *thd, LEX_CSTRING *name, Create_func_export_set::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -3342,7 +3402,7 @@ Create_func_export_set::create_native(THD *thd, LEX_CSTRING *name,
Create_func_field Create_func_field::s_singleton; Create_func_field Create_func_field::s_singleton;
Item* Item*
Create_func_field::create_native(THD *thd, LEX_CSTRING *name, Create_func_field::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -3381,7 +3441,7 @@ Create_func_floor::create_1_arg(THD *thd, Item *arg1)
Create_func_format Create_func_format::s_singleton; Create_func_format Create_func_format::s_singleton;
Item* Item*
Create_func_format::create_native(THD *thd, LEX_CSTRING *name, Create_func_format::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -3446,7 +3506,7 @@ Create_func_from_days::create_1_arg(THD *thd, Item *arg1)
Create_func_from_unixtime Create_func_from_unixtime::s_singleton; Create_func_from_unixtime Create_func_from_unixtime::s_singleton;
Item* Item*
Create_func_from_unixtime::create_native(THD *thd, LEX_CSTRING *name, Create_func_from_unixtime::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -3496,7 +3556,7 @@ Create_func_get_lock::create_2_arg(THD *thd, Item *arg1, Item *arg2)
Create_func_greatest Create_func_greatest::s_singleton; Create_func_greatest Create_func_greatest::s_singleton;
Item* Item*
Create_func_greatest::create_native(THD *thd, LEX_CSTRING *name, Create_func_greatest::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -3585,8 +3645,8 @@ Create_func_json_exists::create_2_arg(THD *thd, Item *arg1, Item *arg2)
Create_func_json_detailed Create_func_json_detailed::s_singleton; Create_func_json_detailed Create_func_json_detailed::s_singleton;
Item* Item*
Create_func_json_detailed::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_detailed::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
int arg_count= 0; int arg_count= 0;
@ -3712,7 +3772,7 @@ Create_func_last_day::create_1_arg(THD *thd, Item *arg1)
Create_func_json_array Create_func_json_array::s_singleton; Create_func_json_array Create_func_json_array::s_singleton;
Item* Item*
Create_func_json_array::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_array::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func; Item *func;
@ -3734,8 +3794,8 @@ Create_func_json_array::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_array_append Create_func_json_array_append::s_singleton; Create_func_json_array_append Create_func_json_array_append::s_singleton;
Item* Item*
Create_func_json_array_append::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_array_append::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
int arg_count= 0; int arg_count= 0;
@ -3760,8 +3820,8 @@ Create_func_json_array_append::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_array_insert Create_func_json_array_insert::s_singleton; Create_func_json_array_insert Create_func_json_array_insert::s_singleton;
Item* Item*
Create_func_json_array_insert::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_array_insert::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
int arg_count= 0; int arg_count= 0;
@ -3786,8 +3846,8 @@ Create_func_json_array_insert::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_insert Create_func_json_insert::s_singleton; Create_func_json_insert Create_func_json_insert::s_singleton;
Item* Item*
Create_func_json_insert::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_insert::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
int arg_count= 0; int arg_count= 0;
@ -3813,7 +3873,7 @@ Create_func_json_insert::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_set Create_func_json_set::s_singleton; Create_func_json_set Create_func_json_set::s_singleton;
Item* Item*
Create_func_json_set::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_set::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -3840,7 +3900,7 @@ Create_func_json_set::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_replace Create_func_json_replace::s_singleton; Create_func_json_replace Create_func_json_replace::s_singleton;
Item* Item*
Create_func_json_replace::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_replace::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -3867,7 +3927,7 @@ Create_func_json_replace::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_remove Create_func_json_remove::s_singleton; Create_func_json_remove Create_func_json_remove::s_singleton;
Item* Item*
Create_func_json_remove::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_remove::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -3893,7 +3953,7 @@ Create_func_json_remove::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_object Create_func_json_object::s_singleton; Create_func_json_object Create_func_json_object::s_singleton;
Item* Item*
Create_func_json_object::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_object::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func; Item *func;
@ -3926,7 +3986,7 @@ Create_func_json_object::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_length Create_func_json_length::s_singleton; Create_func_json_length Create_func_json_length::s_singleton;
Item* Item*
Create_func_json_length::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_length::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func; Item *func;
@ -3951,7 +4011,7 @@ Create_func_json_length::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_merge Create_func_json_merge::s_singleton; Create_func_json_merge Create_func_json_merge::s_singleton;
Item* Item*
Create_func_json_merge::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_merge::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func; Item *func;
@ -3976,8 +4036,8 @@ Create_func_json_merge::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_merge_patch Create_func_json_merge_patch::s_singleton; Create_func_json_merge_patch Create_func_json_merge_patch::s_singleton;
Item* Item*
Create_func_json_merge_patch::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_merge_patch::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func; Item *func;
int arg_count; int arg_count;
@ -4000,7 +4060,7 @@ Create_func_json_merge_patch::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_contains Create_func_json_contains::s_singleton; Create_func_json_contains Create_func_json_contains::s_singleton;
Item* Item*
Create_func_json_contains::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_contains::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -4026,7 +4086,7 @@ Create_func_json_contains::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_keys Create_func_json_keys::s_singleton; Create_func_json_keys Create_func_json_keys::s_singleton;
Item* Item*
Create_func_json_keys::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_keys::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -4052,8 +4112,8 @@ Create_func_json_keys::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_contains_path Create_func_json_contains_path::s_singleton; Create_func_json_contains_path Create_func_json_contains_path::s_singleton;
Item* Item*
Create_func_json_contains_path::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_contains_path::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
int arg_count= 0; int arg_count= 0;
@ -4078,8 +4138,8 @@ Create_func_json_contains_path::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_extract Create_func_json_extract::s_singleton; Create_func_json_extract Create_func_json_extract::s_singleton;
Item* Item*
Create_func_json_extract::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_extract::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
int arg_count= 0; int arg_count= 0;
@ -4104,7 +4164,7 @@ Create_func_json_extract::create_native(THD *thd, LEX_CSTRING *name,
Create_func_json_search Create_func_json_search::s_singleton; Create_func_json_search Create_func_json_search::s_singleton;
Item* Item*
Create_func_json_search::create_native(THD *thd, LEX_CSTRING *name, Create_func_json_search::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -4130,7 +4190,7 @@ Create_func_json_search::create_native(THD *thd, LEX_CSTRING *name,
Create_func_last_insert_id Create_func_last_insert_id::s_singleton; Create_func_last_insert_id Create_func_last_insert_id::s_singleton;
Item* Item*
Create_func_last_insert_id::create_native(THD *thd, LEX_CSTRING *name, Create_func_last_insert_id::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -4176,7 +4236,7 @@ Create_func_lcase::create_1_arg(THD *thd, Item *arg1)
Create_func_least Create_func_least::s_singleton; Create_func_least Create_func_least::s_singleton;
Item* Item*
Create_func_least::create_native(THD *thd, LEX_CSTRING *name, Create_func_least::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -4258,7 +4318,7 @@ Create_func_load_file::create_1_arg(THD *thd, Item *arg1)
Create_func_locate Create_func_locate::s_singleton; Create_func_locate Create_func_locate::s_singleton;
Item* Item*
Create_func_locate::create_native(THD *thd, LEX_CSTRING *name, Create_func_locate::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -4299,7 +4359,7 @@ Create_func_locate::create_native(THD *thd, LEX_CSTRING *name,
Create_func_log Create_func_log::s_singleton; Create_func_log Create_func_log::s_singleton;
Item* Item*
Create_func_log::create_native(THD *thd, LEX_CSTRING *name, Create_func_log::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -4356,7 +4416,7 @@ Create_func_lpad Create_func_lpad::s_singleton;
Create_func_lpad_oracle Create_func_lpad_oracle::s_singleton; Create_func_lpad_oracle Create_func_lpad_oracle::s_singleton;
Item* Item*
Create_func_lpad::create_native_std(THD *thd, LEX_CSTRING *name, Create_func_lpad::create_native_std(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -4388,7 +4448,7 @@ Create_func_lpad::create_native_std(THD *thd, LEX_CSTRING *name,
Item* Item*
Create_func_lpad::create_native_oracle(THD *thd, LEX_CSTRING *name, Create_func_lpad::create_native_oracle(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
int arg_count= item_list ? item_list->elements : 0; int arg_count= item_list ? item_list->elements : 0;
@ -4454,7 +4514,7 @@ Create_func_maketime::create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3)
Create_func_make_set Create_func_make_set::s_singleton; Create_func_make_set Create_func_make_set::s_singleton;
Item* Item*
Create_func_make_set::create_native(THD *thd, LEX_CSTRING *name, Create_func_make_set::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -4475,7 +4535,7 @@ Create_func_make_set::create_native(THD *thd, LEX_CSTRING *name,
Create_func_master_pos_wait Create_func_master_pos_wait::s_singleton; Create_func_master_pos_wait Create_func_master_pos_wait::s_singleton;
Item* Item*
Create_func_master_pos_wait::create_native(THD *thd, LEX_CSTRING *name, Create_func_master_pos_wait::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
@ -4526,7 +4586,7 @@ Create_func_master_pos_wait::create_native(THD *thd, LEX_CSTRING *name,
Create_func_master_gtid_wait Create_func_master_gtid_wait::s_singleton; Create_func_master_gtid_wait Create_func_master_gtid_wait::s_singleton;
Item* Item*
Create_func_master_gtid_wait::create_native(THD *thd, LEX_CSTRING *name, Create_func_master_gtid_wait::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -4724,7 +4784,7 @@ Create_func_radians::create_1_arg(THD *thd, Item *arg1)
Create_func_rand Create_func_rand::s_singleton; Create_func_rand Create_func_rand::s_singleton;
Item* Item*
Create_func_rand::create_native(THD *thd, LEX_CSTRING *name, Create_func_rand::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -4815,7 +4875,7 @@ Create_func_reverse::create_1_arg(THD *thd, Item *arg1)
Create_func_round Create_func_round::s_singleton; Create_func_round Create_func_round::s_singleton;
Item* Item*
Create_func_round::create_native(THD *thd, LEX_CSTRING *name, Create_func_round::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -4855,7 +4915,7 @@ Create_func_rpad Create_func_rpad::s_singleton;
Create_func_rpad_oracle Create_func_rpad_oracle::s_singleton; Create_func_rpad_oracle Create_func_rpad_oracle::s_singleton;
Item* Item*
Create_func_rpad::create_native_std(THD *thd, LEX_CSTRING *name, Create_func_rpad::create_native_std(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -4887,7 +4947,7 @@ Create_func_rpad::create_native_std(THD *thd, LEX_CSTRING *name,
Item* Item*
Create_func_rpad::create_native_oracle(THD *thd, LEX_CSTRING *name, Create_func_rpad::create_native_oracle(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
int arg_count= item_list ? item_list->elements : 0; int arg_count= item_list ? item_list->elements : 0;
@ -5045,8 +5105,8 @@ Create_func_substr_index::create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *a
Create_func_substr_oracle Create_func_substr_oracle::s_singleton; Create_func_substr_oracle Create_func_substr_oracle::s_singleton;
Item* Item*
Create_func_substr_oracle::create_native(THD *thd, LEX_CSTRING *name, Create_func_substr_oracle::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
int arg_count= item_list ? item_list->elements : 0; int arg_count= item_list ? item_list->elements : 0;
@ -5187,7 +5247,7 @@ Create_func_unhex::create_1_arg(THD *thd, Item *arg1)
Create_func_unix_timestamp Create_func_unix_timestamp::s_singleton; Create_func_unix_timestamp Create_func_unix_timestamp::s_singleton;
Item* Item*
Create_func_unix_timestamp::create_native(THD *thd, LEX_CSTRING *name, Create_func_unix_timestamp::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -5305,8 +5365,8 @@ Create_func_wsrep_sync_wait_upto::s_singleton;
Item* Item*
Create_func_wsrep_sync_wait_upto::create_native(THD *thd, Create_func_wsrep_sync_wait_upto::create_native(THD *thd,
LEX_CSTRING *name, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
int arg_count= 0; int arg_count= 0;
@ -5356,7 +5416,7 @@ Create_func_xml_update::create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg
Create_func_year_week Create_func_year_week::s_singleton; Create_func_year_week Create_func_year_week::s_singleton;
Item* Item*
Create_func_year_week::create_native(THD *thd, LEX_CSTRING *name, Create_func_year_week::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;

View File

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. /* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2008-2011 Monty Program Ab Copyright (c) 2008, 2022, MariaDB
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -58,7 +58,8 @@ public:
@param item_list The list of arguments to the function, can be NULL @param item_list The list of arguments to the function, can be NULL
@return An item representing the parsed function call, or NULL @return An item representing the parsed function call, or NULL
*/ */
virtual Item *create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list) = 0; virtual Item *create_func(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) = 0;
protected: protected:
/** Constructor */ /** Constructor */
@ -75,8 +76,8 @@ protected:
class Create_func_arg0 : public Create_func class Create_func_arg0 : public Create_func
{ {
public: public:
virtual Item *create_func(THD *thd, LEX_CSTRING *name, Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
List<Item> *item_list); override;
/** /**
Builder method, with no arguments. Builder method, with no arguments.
@ -100,7 +101,8 @@ protected:
class Create_func_arg1 : public Create_func class Create_func_arg1 : public Create_func
{ {
public: public:
virtual Item *create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list); Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
override;
/** /**
Builder method, with one argument. Builder method, with one argument.
@ -125,7 +127,8 @@ protected:
class Create_func_arg2 : public Create_func class Create_func_arg2 : public Create_func
{ {
public: public:
virtual Item *create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list); Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
override;
/** /**
Builder method, with two arguments. Builder method, with two arguments.
@ -151,7 +154,8 @@ protected:
class Create_func_arg3 : public Create_func class Create_func_arg3 : public Create_func
{ {
public: public:
virtual Item *create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list); Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
override;
/** /**
Builder method, with three arguments. Builder method, with three arguments.
@ -184,8 +188,8 @@ protected:
class Create_native_func : public Create_func class Create_native_func : public Create_func
{ {
public: public:
virtual Item *create_func(THD *thd, LEX_CSTRING *name, Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
List<Item> *item_list); override;
/** /**
Builder method, with no arguments. Builder method, with no arguments.
@ -194,7 +198,7 @@ public:
@param item_list The function parameters, none of which are named @param item_list The function parameters, none of which are named
@return An item representing the function call @return An item representing the function call
*/ */
virtual Item *create_native(THD *thd, LEX_CSTRING *name, virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) = 0; List<Item> *item_list) = 0;
protected: protected:
@ -222,8 +226,8 @@ public:
@param item_list The list of arguments to the function, can be NULL @param item_list The list of arguments to the function, can be NULL
@return An item representing the parsed function call @return An item representing the parsed function call
*/ */
virtual Item *create_func(THD *thd, LEX_CSTRING *name, Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
List<Item> *item_list); override;
/** /**
The builder create method, for qualified functions. The builder create method, for qualified functions.
@ -234,7 +238,9 @@ public:
@param item_list The list of arguments to the function, can be NULL @param item_list The list of arguments to the function, can be NULL
@return An item representing the parsed function call @return An item representing the parsed function call
*/ */
virtual Item *create_with_db(THD *thd, LEX_CSTRING *db, LEX_CSTRING *name, virtual Item *create_with_db(THD *thd,
const LEX_CSTRING *db,
const LEX_CSTRING *name,
bool use_explicit_name, bool use_explicit_name,
List<Item> *item_list) = 0; List<Item> *item_list) = 0;
@ -272,8 +278,8 @@ extern Create_qfunc * find_qualified_function_builder(THD *thd);
class Create_udf_func : public Create_func class Create_udf_func : public Create_func
{ {
public: public:
virtual Item *create_func(THD *thd, LEX_CSTRING *name, Item *create_func(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
List<Item> *item_list); override;
/** /**
The builder create method, for User Defined Functions. The builder create method, for User Defined Functions.

View File

@ -1,5 +1,5 @@
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. /* Copyright (c) 2003, 2016, Oracle and/or its affiliates.
Copyright (c) 2011, 2021, MariaDB Copyright (c) 2011, 2022, MariaDB
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -2993,19 +2993,19 @@ protected:
class Create_func_distance_sphere: public Create_native_func class Create_func_distance_sphere: public Create_native_func
{ {
public: public:
Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list) Item *create_native(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
override; override;
static Create_func_distance_sphere s_singleton; static Create_func_distance_sphere s_singleton;
protected: protected:
Create_func_distance_sphere() {} Create_func_distance_sphere() {}
virtual ~Create_func_distance_sphere() {} virtual ~Create_func_distance_sphere() {}
}; };
Item* Item*
Create_func_distance_sphere::create_native(THD *thd, LEX_CSTRING *name, Create_func_distance_sphere::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
int arg_count= 0; int arg_count= 0;
@ -3125,7 +3125,8 @@ protected:
class Create_func_geometry_from_text : public Create_native_func class Create_func_geometry_from_text : public Create_native_func
{ {
public: public:
Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); Item *create_native(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
override;
static Create_func_geometry_from_text s_singleton; static Create_func_geometry_from_text s_singleton;
@ -3136,7 +3137,8 @@ protected:
Item* Item*
Create_func_geometry_from_text::create_native(THD *thd, LEX_CSTRING *name, Create_func_geometry_from_text::create_native(THD *thd,
const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -3174,7 +3176,8 @@ Create_func_geometry_from_text::create_native(THD *thd, LEX_CSTRING *name,
class Create_func_geometry_from_wkb : public Create_native_func class Create_func_geometry_from_wkb : public Create_native_func
{ {
public: public:
Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); Item *create_native(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
override;
static Create_func_geometry_from_wkb s_singleton; static Create_func_geometry_from_wkb s_singleton;
@ -3185,7 +3188,7 @@ protected:
Item* Item*
Create_func_geometry_from_wkb::create_native(THD *thd, LEX_CSTRING *name, Create_func_geometry_from_wkb::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
@ -3223,7 +3226,8 @@ Create_func_geometry_from_wkb::create_native(THD *thd, LEX_CSTRING *name,
class Create_func_geometry_from_json : public Create_native_func class Create_func_geometry_from_json : public Create_native_func
{ {
public: public:
Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); Item *create_native(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
override;
static Create_func_geometry_from_json s_singleton; static Create_func_geometry_from_json s_singleton;
@ -3234,8 +3238,9 @@ protected:
Item* Item*
Create_func_geometry_from_json::create_native(THD *thd, LEX_CSTRING *name, Create_func_geometry_from_json::create_native(THD *thd,
List<Item> *item_list) const LEX_CSTRING *name,
List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
int arg_count= 0; int arg_count= 0;
@ -3281,7 +3286,8 @@ Create_func_geometry_from_json::create_native(THD *thd, LEX_CSTRING *name,
class Create_func_as_geojson : public Create_native_func class Create_func_as_geojson : public Create_native_func
{ {
public: public:
Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); Item *create_native(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
override;
static Create_func_as_geojson s_singleton; static Create_func_as_geojson s_singleton;
@ -3292,8 +3298,8 @@ protected:
Item* Item*
Create_func_as_geojson::create_native(THD *thd, LEX_CSTRING *name, Create_func_as_geojson::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list) List<Item> *item_list)
{ {
Item *func= NULL; Item *func= NULL;
int arg_count= 0; int arg_count= 0;

View File

@ -5421,8 +5421,8 @@ ER_TRG_DOES_NOT_EXIST
ger "Trigger existiert nicht" ger "Trigger existiert nicht"
hindi "TRIGGER मौजूद नहीं है" hindi "TRIGGER मौजूद नहीं है"
ER_TRG_ON_VIEW_OR_TEMP_TABLE ER_TRG_ON_VIEW_OR_TEMP_TABLE
eng "Trigger's '%-.192s' is view or temporary table" eng "Trigger's '%-.192s' is view, temporary table or sequence"
ger "'%-.192s' des Triggers ist View oder temporäre Tabelle" hindi "'%-.192s' एक व्यू, टेम्पररी टेबल या सीक्वेंस है"
ER_TRG_CANT_CHANGE_ROW ER_TRG_CANT_CHANGE_ROW
eng "Updating of %s row is not allowed in %strigger" eng "Updating of %s row is not allowed in %strigger"
ger "Aktualisieren einer %s-Zeile ist in einem %s-Trigger nicht erlaubt" ger "Aktualisieren einer %s-Zeile ist in einem %s-Trigger nicht erlaubt"
@ -7760,7 +7760,7 @@ ER_END_IDENTIFIER_DOES_NOT_MATCH
ER_SEQUENCE_RUN_OUT ER_SEQUENCE_RUN_OUT
eng "Sequence '%-.64s.%-.64s' has run out" eng "Sequence '%-.64s.%-.64s' has run out"
ER_SEQUENCE_INVALID_DATA ER_SEQUENCE_INVALID_DATA
eng "Sequence '%-.64s.%-.64s' values are conflicting" eng "Sequence '%-.64s.%-.64s' has out of range value for options"
ER_SEQUENCE_INVALID_TABLE_STRUCTURE ER_SEQUENCE_INVALID_TABLE_STRUCTURE
eng "Sequence '%-.64s.%-.64s' table structure is invalid (%s)" eng "Sequence '%-.64s.%-.64s' table structure is invalid (%s)"
ER_SEQUENCE_ACCESS_ERROR ER_SEQUENCE_ACCESS_ERROR

View File

@ -9180,18 +9180,18 @@ bool LEX::call_statement_start(THD *thd,
(static_cast<const LEX_CSTRING*>(db))))) (static_cast<const LEX_CSTRING*>(db)))))
{ {
my_error(ER_WRONG_DB_NAME, MYF(0), db->str); my_error(ER_WRONG_DB_NAME, MYF(0), db->str);
return NULL; return true;
} }
if (check_routine_name(pkg) || if (check_routine_name(pkg) ||
check_routine_name(proc)) check_routine_name(proc))
return NULL; return true;
// Concat `pkg` and `name` to `pkg.name` // Concat `pkg` and `name` to `pkg.name`
LEX_CSTRING pkg_dot_proc; LEX_CSTRING pkg_dot_proc;
if (q_pkg_proc.make_qname(thd->mem_root, &pkg_dot_proc) || if (q_pkg_proc.make_qname(thd->mem_root, &pkg_dot_proc) ||
check_ident_length(&pkg_dot_proc) || check_ident_length(&pkg_dot_proc) ||
!(spname= new (thd->mem_root) sp_name(db, &pkg_dot_proc, true))) !(spname= new (thd->mem_root) sp_name(db, &pkg_dot_proc, true)))
return NULL; return true;
sp_handler_package_function.add_used_routine(thd->lex, thd, spname); sp_handler_package_function.add_used_routine(thd->lex, thd, spname);
sp_handler_package_body.add_used_routine(thd->lex, thd, &q_db_pkg); sp_handler_package_body.add_used_routine(thd->lex, thd, &q_db_pkg);

View File

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. /* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
Copyright (c) 2008, 2021, MariaDB Copyright (c) 2008, 2022, MariaDB
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -9280,7 +9280,7 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ
THD *tmp; THD *tmp;
uint error= (type == KILL_TYPE_QUERY ? ER_NO_SUCH_QUERY : ER_NO_SUCH_THREAD); uint error= (type == KILL_TYPE_QUERY ? ER_NO_SUCH_QUERY : ER_NO_SUCH_THREAD);
DBUG_ENTER("kill_one_thread"); DBUG_ENTER("kill_one_thread");
DBUG_PRINT("enter", ("id: %lld signal: %u", id, (uint) kill_signal)); DBUG_PRINT("enter", ("id: %lld signal: %d", id, kill_signal));
tmp= find_thread_by_id(id, type == KILL_TYPE_QUERY); tmp= find_thread_by_id(id, type == KILL_TYPE_QUERY);
if (!tmp) if (!tmp)
DBUG_RETURN(error); DBUG_RETURN(error);
@ -9324,14 +9324,15 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ
if (tmp->wsrep_aborter && tmp->wsrep_aborter != thd->thread_id) if (tmp->wsrep_aborter && tmp->wsrep_aborter != thd->thread_id)
{ {
/* victim is in hit list already, bail out */ /* victim is in hit list already, bail out */
WSREP_DEBUG("victim %llu has wsrep aborter: %lu, skipping awake()", WSREP_DEBUG("victim %lld has wsrep aborter: %lu, skipping awake()",
id, tmp->wsrep_aborter); id, tmp->wsrep_aborter);
error= 0; error= 0;
} }
else else
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
{ {
WSREP_DEBUG("kill_one_thread victim: %llu wsrep_aborter %lu by signal %d", WSREP_DEBUG("kill_one_thread victim: %lld wsrep_aborter %lu"
" by signal %d",
id, tmp->wsrep_aborter, kill_signal); id, tmp->wsrep_aborter, kill_signal);
tmp->awake_no_mutex(kill_signal); tmp->awake_no_mutex(kill_signal);
error= 0; error= 0;
@ -9344,7 +9345,7 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ
mysql_mutex_unlock(&tmp->LOCK_thd_data); mysql_mutex_unlock(&tmp->LOCK_thd_data);
} }
mysql_mutex_unlock(&tmp->LOCK_thd_kill); mysql_mutex_unlock(&tmp->LOCK_thd_kill);
DBUG_PRINT("exit", ("%d", error)); DBUG_PRINT("exit", ("%u", error));
DBUG_RETURN(error); DBUG_RETURN(error);
} }

View File

@ -27533,8 +27533,11 @@ bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
if (unit->is_unit_op() || unit->fake_select_lex) if (unit->is_unit_op() || unit->fake_select_lex)
{ {
ulonglong save_options= 0;
if (unit->union_needs_tmp_table() && unit->fake_select_lex) if (unit->union_needs_tmp_table() && unit->fake_select_lex)
{ {
save_options= unit->fake_select_lex->options;
unit->fake_select_lex->select_number= FAKE_SELECT_LEX_ID; // just for initialization unit->fake_select_lex->select_number= FAKE_SELECT_LEX_ID; // just for initialization
unit->fake_select_lex->type= unit_operation_text[unit->common_op()]; unit->fake_select_lex->type= unit_operation_text[unit->common_op()];
unit->fake_select_lex->options|= SELECT_DESCRIBE; unit->fake_select_lex->options|= SELECT_DESCRIBE;
@ -27545,6 +27548,9 @@ bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
if (!is_pushed_union) if (!is_pushed_union)
res= unit->exec(); res= unit->exec();
} }
if (unit->union_needs_tmp_table() && unit->fake_select_lex)
unit->fake_select_lex->options= save_options;
} }
else else
{ {

View File

@ -122,7 +122,7 @@ bool sequence_definition::check_and_adjust(bool set_reserved_until)
start >= min_value && start >= min_value &&
max_value != LONGLONG_MAX && max_value != LONGLONG_MAX &&
min_value != LONGLONG_MIN && min_value != LONGLONG_MIN &&
cache < (LONGLONG_MAX - max_increment) / max_increment && cache >= 0 && cache < (LONGLONG_MAX - max_increment) / max_increment &&
((real_increment > 0 && reserved_until >= min_value) || ((real_increment > 0 && reserved_until >= min_value) ||
(real_increment < 0 && reserved_until <= max_value))) (real_increment < 0 && reserved_until <= max_value)))
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);

View File

@ -3296,16 +3296,6 @@ static my_bool processlist_callback(THD *tmp, processlist_callback_arg *arg)
arg->table->field[11]->store((double) tmp->progress.counter / arg->table->field[11]->store((double) tmp->progress.counter /
(double) max_counter*100.0); (double) max_counter*100.0);
} }
else
{
/*
This is a DECIMAL column without DEFAULT.
restore_record() fills its Field::ptr to zero bytes,
according to pack_length(). But an array of zero bytes
is not a valid decimal. Set it explicitly to 0.
*/
arg->table->field[11]->store((longlong) 0, true);
}
mysql_mutex_unlock(&tmp->LOCK_thd_data); mysql_mutex_unlock(&tmp->LOCK_thd_data);
} }
@ -8633,6 +8623,7 @@ bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables)
if (bitmap_is_set(table->read_set, i)) if (bitmap_is_set(table->read_set, i))
{ {
field->move_field(cur); field->move_field(cur);
field->reset();
*to_recinfo++= *from_recinfo; *to_recinfo++= *from_recinfo;
cur+= from_recinfo->length; cur+= from_recinfo->length;
} }
@ -8654,6 +8645,7 @@ bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables)
to_recinfo->type= FIELD_NORMAL; to_recinfo->type= FIELD_NORMAL;
to_recinfo++; to_recinfo++;
} }
store_record(table, s->default_values);
p->recinfo= to_recinfo; p->recinfo= to_recinfo;
// TODO switch from Aria to Memory if all blobs were optimized away? // TODO switch from Aria to Memory if all blobs were optimized away?

View File

@ -1,6 +1,6 @@
/* /*
Copyright (c) 2004, 2012, Oracle and/or its affiliates. Copyright (c) 2004, 2012, Oracle and/or its affiliates.
Copyright (c) 2010, 2021, MariaDB Copyright (c) 2010, 2022, MariaDB
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -415,6 +415,10 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
MDL_ticket *mdl_ticket= NULL; MDL_ticket *mdl_ticket= NULL;
MDL_request mdl_request_for_trn; MDL_request mdl_request_for_trn;
Query_tables_list backup; Query_tables_list backup;
char path[FN_REFLEN + 1];
char engine_name_buf[NAME_CHAR_LEN + 1];
LEX_CSTRING engine_name= { engine_name_buf, 0 };
DBUG_ENTER("mysql_create_or_drop_trigger"); DBUG_ENTER("mysql_create_or_drop_trigger");
/* Charset of the buffer for statement must be system one. */ /* Charset of the buffer for statement must be system one. */
@ -540,8 +544,12 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
/* We should have only one table in table list. */ /* We should have only one table in table list. */
DBUG_ASSERT(tables->next_global == 0); DBUG_ASSERT(tables->next_global == 0);
/* We do not allow creation of triggers on temporary tables. */ build_table_filename(path, sizeof(path) - 1, tables->db.str, tables->alias.str, ".frm", 0);
if (create && thd->find_tmp_table_share(tables)) tables->required_type= dd_frm_type(NULL, path, &engine_name);
/* We do not allow creation of triggers on temporary tables or sequence. */
if (tables->required_type == TABLE_TYPE_SEQUENCE ||
(create && thd->find_tmp_table_share(tables)))
{ {
my_error(ER_TRG_ON_VIEW_OR_TEMP_TABLE, MYF(0), tables->alias.str); my_error(ER_TRG_ON_VIEW_OR_TEMP_TABLE, MYF(0), tables->alias.str);
goto end; goto end;

View File

@ -2632,7 +2632,7 @@ sequence_def:
if (unlikely(Lex->sql_command != SQLCOM_ALTER_SEQUENCE)) if (unlikely(Lex->sql_command != SQLCOM_ALTER_SEQUENCE))
{ {
thd->parse_error(ER_SYNTAX_ERROR, "RESTART"); thd->parse_error(ER_SYNTAX_ERROR, "RESTART");
YYABORT; MYSQL_YYABORT;
} }
if (unlikely(Lex->create_info.seq_create_info->used_fields & if (unlikely(Lex->create_info.seq_create_info->used_fields &
seq_field_used_restart)) seq_field_used_restart))
@ -2644,7 +2644,7 @@ sequence_def:
if (unlikely(Lex->sql_command != SQLCOM_ALTER_SEQUENCE)) if (unlikely(Lex->sql_command != SQLCOM_ALTER_SEQUENCE))
{ {
thd->parse_error(ER_SYNTAX_ERROR, "RESTART"); thd->parse_error(ER_SYNTAX_ERROR, "RESTART");
YYABORT; MYSQL_YYABORT;
} }
if (unlikely(Lex->create_info.seq_create_info->used_fields & if (unlikely(Lex->create_info.seq_create_info->used_fields &
seq_field_used_restart)) seq_field_used_restart))
@ -8904,7 +8904,7 @@ subselect:
query_expression query_expression
{ {
if (!($$= Lex->parsed_subselect($1))) if (!($$= Lex->parsed_subselect($1)))
YYABORT; MYSQL_YYABORT;
} }
; ;
@ -8949,14 +8949,14 @@ subquery:
else else
$1->fake_select_lex->braces= false; $1->fake_select_lex->braces= false;
if (!($$= Lex->parsed_subselect($1))) if (!($$= Lex->parsed_subselect($1)))
YYABORT; MYSQL_YYABORT;
} }
| '(' with_clause query_expression_no_with_clause ')' | '(' with_clause query_expression_no_with_clause ')'
{ {
$3->set_with_clause($2); $3->set_with_clause($2);
$2->attach_to($3->first_select()); $2->attach_to($3->first_select());
if (!($$= Lex->parsed_subselect($3))) if (!($$= Lex->parsed_subselect($3)))
YYABORT; MYSQL_YYABORT;
} }
; ;

View File

@ -2596,7 +2596,12 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
if (flags & VERS_SYSTEM_FIELD) if (flags & VERS_SYSTEM_FIELD)
{ {
switch (handler->real_field_type()) auto field_type= handler->real_field_type();
if (DBUG_EVALUATE_IF("error_vers_wrong_type", 1, 0))
field_type= MYSQL_TYPE_BLOB;
switch (field_type)
{ {
case MYSQL_TYPE_TIMESTAMP2: case MYSQL_TYPE_TIMESTAMP2:
break; break;
@ -2608,9 +2613,13 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
} }
/* Fallthrough */ /* Fallthrough */
default: default:
my_error(ER_VERS_FIELD_WRONG_TYPE, MYF(0), fieldnames.type_names[i], my_error(ER_VERS_FIELD_WRONG_TYPE,
versioned == VERS_TIMESTAMP ? "TIMESTAMP(6)" : "BIGINT(20) UNSIGNED", (field_type == MYSQL_TYPE_LONGLONG ?
table_name.str); MYF(0) : MYF(ME_WARNING)),
fieldnames.type_names[i],
(versioned == VERS_TIMESTAMP ?
"TIMESTAMP(6)" : "BIGINT(20) UNSIGNED"),
table_name.str);
goto err; goto err;
} }
} }
@ -8897,9 +8906,6 @@ bool TABLE::check_period_overlaps(const KEY &key,
void TABLE::vers_update_fields() void TABLE::vers_update_fields()
{ {
bitmap_set_bit(write_set, vers_start_field()->field_index);
bitmap_set_bit(write_set, vers_end_field()->field_index);
if (!vers_write) if (!vers_write)
{ {
file->column_bitmaps_signal(); file->column_bitmaps_signal();
@ -8908,17 +8914,21 @@ void TABLE::vers_update_fields()
if (versioned(VERS_TIMESTAMP)) if (versioned(VERS_TIMESTAMP))
{ {
bitmap_set_bit(write_set, vers_start_field()->field_index);
if (vers_start_field()->store_timestamp(in_use->query_start(), if (vers_start_field()->store_timestamp(in_use->query_start(),
in_use->query_start_sec_part())) in_use->query_start_sec_part()))
{ {
DBUG_ASSERT(0); DBUG_ASSERT(0);
} }
vers_start_field()->set_has_explicit_value(); vers_start_field()->set_has_explicit_value();
bitmap_set_bit(read_set, vers_start_field()->field_index);
} }
bitmap_set_bit(write_set, vers_end_field()->field_index);
vers_end_field()->set_max(); vers_end_field()->set_max();
vers_end_field()->set_has_explicit_value(); vers_end_field()->set_has_explicit_value();
bitmap_set_bit(read_set, vers_end_field()->field_index); bitmap_set_bit(read_set, vers_end_field()->field_index);
file->column_bitmaps_signal(); file->column_bitmaps_signal();
if (vfield) if (vfield)
update_virtual_fields(file, VCOL_UPDATE_FOR_READ); update_virtual_fields(file, VCOL_UPDATE_FOR_READ);

View File

@ -297,6 +297,13 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2,
PTDB utp; PTDB utp;
if (!(utp = tdbp->Duplicate(g))) { if (!(utp = tdbp->Duplicate(g))) {
/* If table type is of type virtual retrieve global parameter as it was.*/
if (tdbp->GetAmType() == TYPE_AM_VIR) {
if (tdbp->OpenDB(g)) {
printf("%s\n", g->Message);
throw 7;
}
}
sprintf(g->Message, MSG(INV_UPDT_TABLE), tdbp->GetName()); sprintf(g->Message, MSG(INV_UPDT_TABLE), tdbp->GetName());
throw 4; throw 4;
} // endif tp } // endif tp

View File

@ -16,3 +16,17 @@ SELECT * FROM t1;
a a
10 10
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-23626: CONNECT VIR tables return inconsistent error for UPDATE
#
CREATE TABLE numbers
ENGINE=CONNECT,
TABLE_TYPE=VIR,
BLOCK_SIZE=3;
TRUNCATE TABLE numbers;
ERROR HY000: Got error 174 'Virtual tables are read only' from CONNECT
DELETE FROM numbers WHERE n = 1;
ERROR HY000: Got error 174 'Virtual tables are read only' from CONNECT
UPDATE numbers SET n = 10 WHERE n = 1;
ERROR HY000: Got error 174 'Virtual tables are read only' from CONNECT
DROP TABLE numbers;

View File

@ -14,3 +14,20 @@ SELECT * FROM t1;
ALTER TABLE t1 TABLE_TYPE=NON_EXISTING; ALTER TABLE t1 TABLE_TYPE=NON_EXISTING;
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-23626: CONNECT VIR tables return inconsistent error for UPDATE
--echo #
CREATE TABLE numbers
ENGINE=CONNECT,
TABLE_TYPE=VIR,
BLOCK_SIZE=3;
--error ER_GET_ERRMSG
TRUNCATE TABLE numbers;
--error ER_GET_ERRMSG
DELETE FROM numbers WHERE n = 1;
--error ER_GET_ERRMSG
UPDATE numbers SET n = 10 WHERE n = 1;
DROP TABLE numbers;

View File

@ -1,6 +1,6 @@
/* /*
Copyright (c) 2008-2009, Patrick Galbraith & Antony Curtis Copyright (c) 2008-2009, Patrick Galbraith & Antony Curtis
Copyright (c) 2020, MariaDB Corporation. Copyright (c) 2020, 2022, MariaDB Corporation.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@ -1014,6 +1014,9 @@ fil_space_t *fil_space_t::create(const char *name, ulint id, ulint flags,
if (UNIV_LIKELY(id <= fil_system.max_assigned_id)) { if (UNIV_LIKELY(id <= fil_system.max_assigned_id)) {
break; break;
} }
if (UNIV_UNLIKELY(srv_operation == SRV_OPERATION_BACKUP)) {
break;
}
if (!fil_system.space_id_reuse_warned) { if (!fil_system.space_id_reuse_warned) {
ib::warn() << "Allocated tablespace ID " << id ib::warn() << "Allocated tablespace ID " << id
<< " for " << name << ", old maximum was " << " for " << name << ", old maximum was "

View File

@ -8937,20 +8937,23 @@ void translog_hard_group_commit(my_bool mode)
void translog_sync() void translog_sync()
{ {
uint32 max= get_current_logfile()->number;
uint32 min;
DBUG_ENTER("ma_translog_sync"); DBUG_ENTER("ma_translog_sync");
min= soft_sync_min; /* The following is only true if initalization of translog succeded */
if (!min) if (log_descriptor.open_files.elements != 0)
min= max; {
uint32 max= get_current_logfile()->number;
uint32 min;
translog_sync_files(min, max, sync_log_dir >= TRANSLOG_SYNC_DIR_ALWAYS); min= soft_sync_min;
if (!min)
min= max;
translog_sync_files(min, max, sync_log_dir >= TRANSLOG_SYNC_DIR_ALWAYS);
}
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
/** /**
@brief set rate for group commit @brief set rate for group commit

@ -1 +1 @@
Subproject commit edd141127c11d78ef073f9f3ca61708821f20b32 Subproject commit 23fb8624624c9144c77f3874647fa0f7394b0aa8