mirror of
https://github.com/MariaDB/server.git
synced 2025-01-28 17:54:16 +01:00
Merge 10.2 into 10.3
This commit is contained in:
commit
0a20e5ab77
46 changed files with 2708 additions and 2933 deletions
|
@ -515,9 +515,9 @@ static int DbugParse(CODE_STATE *cs, const char *control)
|
|||
{
|
||||
/* never share with the global parent - it can change under your feet */
|
||||
stack->functions= ListCopy(init_settings.functions);
|
||||
LockIfInitSettings(cs);
|
||||
LockMutex(cs);
|
||||
stack->keywords= ListCopy(init_settings.keywords);
|
||||
UnlockIfInitSettings(cs);
|
||||
UnlockMutex(cs);
|
||||
stack->processes= ListCopy(init_settings.processes);
|
||||
}
|
||||
else
|
||||
|
@ -1621,7 +1621,10 @@ static void FreeState(CODE_STATE *cs, int free_state)
|
|||
struct settings *state= cs->stack;
|
||||
LockIfInitSettings(cs);
|
||||
if (!is_shared(state, keywords))
|
||||
{
|
||||
FreeList(state->keywords);
|
||||
state->keywords= NULL;
|
||||
}
|
||||
UnlockIfInitSettings(cs);
|
||||
if (!is_shared(state, functions))
|
||||
FreeList(state->functions);
|
||||
|
|
|
@ -102,6 +102,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
|
|||
#include <srv0srv.h>
|
||||
#include <crc_glue.h>
|
||||
#include <log.h>
|
||||
#include <derror.h>
|
||||
|
||||
int sys_var_init();
|
||||
|
||||
|
@ -2754,7 +2755,7 @@ static bool xtrabackup_copy_logfile(bool last = false)
|
|||
log_mutex_exit();
|
||||
|
||||
if (!start_lsn) {
|
||||
msg(recv_sys->found_corrupt_log
|
||||
die(recv_sys->found_corrupt_log
|
||||
? "xtrabackup_copy_logfile() failed: corrupt log."
|
||||
: "xtrabackup_copy_logfile() failed.");
|
||||
return true;
|
||||
|
@ -4226,6 +4227,8 @@ fail_before_log_copying_thread_start:
|
|||
if (xtrabackup_copy_logfile())
|
||||
goto fail_before_log_copying_thread_start;
|
||||
|
||||
DBUG_MARIABACKUP_EVENT("before_innodb_log_copy_thread_started",0);
|
||||
|
||||
log_copying_stop = os_event_create(0);
|
||||
os_thread_create(log_copying_thread, NULL, &log_copying_thread_id);
|
||||
|
||||
|
@ -5851,41 +5854,12 @@ extern void init_signals(void);
|
|||
|
||||
#include <sql_locale.h>
|
||||
|
||||
/* Messages . Avoid loading errmsg.sys file */
|
||||
|
||||
void setup_error_messages()
|
||||
{
|
||||
static const char *my_msgs[ERRORS_PER_RANGE];
|
||||
static const char **all_msgs[] = { my_msgs, my_msgs, my_msgs, my_msgs };
|
||||
my_default_lc_messages = &my_locale_en_US;
|
||||
my_default_lc_messages->errmsgs->errmsgs = all_msgs;
|
||||
|
||||
/* Populate the necessary error messages */
|
||||
struct {
|
||||
int id;
|
||||
const char *fmt;
|
||||
}
|
||||
xb_msgs[] =
|
||||
{
|
||||
{ ER_DATABASE_NAME,"Database" },
|
||||
{ ER_TABLE_NAME,"Table"},
|
||||
{ ER_PARTITION_NAME, "Partition" },
|
||||
{ ER_SUBPARTITION_NAME, "Subpartition" },
|
||||
{ ER_TEMPORARY_NAME, "Temporary"},
|
||||
{ ER_RENAMED_NAME, "Renamed"},
|
||||
{ ER_CANT_FIND_DL_ENTRY, "Can't find symbol '%-.128s' in library"},
|
||||
{ ER_CANT_OPEN_LIBRARY, "Can't open shared library '%-.192s' (errno: %d, %-.128s)" },
|
||||
{ ER_OUTOFMEMORY, "Out of memory; restart server and try again (needed %d bytes)" },
|
||||
{ ER_CANT_OPEN_LIBRARY, "Can't open shared library '%-.192s' (errno: %d, %-.128s)" },
|
||||
{ ER_UDF_NO_PATHS, "No paths allowed for shared library" },
|
||||
{ ER_CANT_INITIALIZE_UDF,"Can't initialize function '%-.192s'; %-.80s"},
|
||||
{ ER_PLUGIN_IS_NOT_LOADED,"Plugin '%-.192s' is not loaded" }
|
||||
};
|
||||
|
||||
for (int i = 0; i < (int)array_elements(all_msgs); i++)
|
||||
all_msgs[0][i] = "Unknown error";
|
||||
|
||||
for (int i = 0; i < (int)array_elements(xb_msgs); i++)
|
||||
all_msgs[0][xb_msgs[i].id - ER_ERROR_FIRST] = xb_msgs[i].fmt;
|
||||
if (init_errmessage())
|
||||
die("could not initialize error messages");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -6157,6 +6131,8 @@ int main(int argc, char **argv)
|
|||
(void) pthread_key_delete(THR_THD);
|
||||
|
||||
logger.cleanup_base();
|
||||
cleanup_errmsgs();
|
||||
free_error_messages();
|
||||
mysql_mutex_destroy(&LOCK_error_log);
|
||||
|
||||
if (status == EXIT_SUCCESS) {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
opt_use_ssl= 1;
|
||||
/* crl has no effect in yaSSL */
|
||||
#ifdef HAVE_YASSL
|
||||
#if defined (HAVE_YASSL) && (!defined (_WIN32) || defined (MYSQL_SERVER))
|
||||
opt_ssl_crl= NULL;
|
||||
opt_ssl_crlpath= NULL;
|
||||
#endif
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c8833751cf48d0085d9d7a4285aafdc967a63a4d
|
||||
Subproject commit 63df45ce3df3fbc04d8fab9bceb77f9d1cccd4aa
|
|
@ -1673,3 +1673,21 @@ with columns as (select 1 as t) select * from columns;
|
|||
t
|
||||
1
|
||||
use test;
|
||||
#
|
||||
# MDEV-18460: Server crashed in strmake / tdc_create_key /
|
||||
# THD::create_tmp_table_def_key
|
||||
#
|
||||
connect con1,localhost,root,,;
|
||||
CREATE TEMPORARY TABLE test.t (a INT);
|
||||
WITH cte AS (SELECT 1) SELECT * FROM cte;
|
||||
1
|
||||
1
|
||||
WITH t AS (SELECT 1) SELECT * FROM t;
|
||||
1
|
||||
1
|
||||
WITH cte AS (SELECT 1) SELECT * FROM t;
|
||||
ERROR 3D000: No database selected
|
||||
DROP TABLE test.t;
|
||||
connection default;
|
||||
disconnect con1;
|
||||
# End of 10.2 tests
|
||||
|
|
|
@ -1182,3 +1182,23 @@ with t as (select 1 as t) select * from t;
|
|||
with columns as (select 1 as t) select * from columns;
|
||||
|
||||
use test;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18460: Server crashed in strmake / tdc_create_key /
|
||||
--echo # THD::create_tmp_table_def_key
|
||||
--echo #
|
||||
|
||||
--connect con1,localhost,root,,
|
||||
--change_user root,,
|
||||
|
||||
CREATE TEMPORARY TABLE test.t (a INT);
|
||||
WITH cte AS (SELECT 1) SELECT * FROM cte;
|
||||
WITH t AS (SELECT 1) SELECT * FROM t;
|
||||
--error ER_NO_DB_ERROR
|
||||
WITH cte AS (SELECT 1) SELECT * FROM t;
|
||||
DROP TABLE test.t;
|
||||
|
||||
--connection default
|
||||
--disconnect con1
|
||||
|
||||
--echo # End of 10.2 tests
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
create table t1(c1 integer not null,c2 integer not null, key (c1)) engine=InnoDb;
|
||||
create table t1(c1 integer not null,c2 integer not null, key (c1))
|
||||
ENGINE=InnoDB STATS_PERSISTENT=1;
|
||||
create view v1 as select * from t1 where c1 in (0,1);
|
||||
insert t1 select 0,seq from seq_1_to_500;
|
||||
insert t1 select 1,seq from seq_1_to_100;
|
||||
|
@ -47,8 +48,8 @@ rollback;
|
|||
start transaction;
|
||||
explain delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL c1 NULL NULL NULL 502 Using where
|
||||
2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 58 Using index
|
||||
1 PRIMARY t1 range c1 c1 4 NULL 600 Using where
|
||||
2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 83 Using index
|
||||
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
|
||||
affected rows: 1
|
||||
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
|
||||
|
@ -63,8 +64,8 @@ rollback;
|
|||
start transaction;
|
||||
explain delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL c1 NULL NULL NULL 502 Using where
|
||||
2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 58 Using index
|
||||
1 PRIMARY t1 ALL c1 NULL NULL NULL 670 Using where
|
||||
2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 83 Using index
|
||||
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 ;
|
||||
affected rows: 500
|
||||
select count(*) from v1 where c1=0;
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
--source include/have_innodb.inc
|
||||
# This test is slow on buildbot.
|
||||
--source include/big_test.inc
|
||||
create table t1(c1 integer not null,c2 integer not null, key (c1)) engine=InnoDb;
|
||||
create table t1(c1 integer not null,c2 integer not null, key (c1))
|
||||
ENGINE=InnoDB STATS_PERSISTENT=1;
|
||||
create view v1 as select * from t1 where c1 in (0,1);
|
||||
|
||||
insert t1 select 0,seq from seq_1_to_500;
|
||||
|
|
|
@ -82,3 +82,29 @@ add foreign key (a) references t3 (a)
|
|||
on update set default on update set default);
|
||||
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 'update set default)' at line 3
|
||||
drop table t_34455;
|
||||
#
|
||||
# MDEV-18460 Don't allow multiple table CONSTRAINTs with the same name.
|
||||
#
|
||||
CREATE TABLE tpk (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,name VARCHAR(100) NOT NULL) ENGINE=Innodb;
|
||||
CREATE TABLE tfk (c1 INT, c2 INT, CONSTRAINT sid UNIQUE (c1), CONSTRAINT sid CHECK (c2>15));
|
||||
ERROR HY000: Duplicate CHECK constraint name 'sid'
|
||||
CREATE TABLE tfk (c1 INT, c2 INT, CONSTRAINT sid UNIQUE (c1));
|
||||
ALTER TABLE tfk ADD CONSTRAINT sid CHECK (c2>15);
|
||||
ERROR HY000: Duplicate CHECK constraint name 'sid'
|
||||
DROP TABLE tfk;
|
||||
CREATE TABLE tfk (c1 INT, c2 INT,
|
||||
CONSTRAINT sid FOREIGN KEY (c1) REFERENCES tpk (id)) ENGINE=Innodb;
|
||||
show create table tfk;
|
||||
Table Create Table
|
||||
tfk CREATE TABLE `tfk` (
|
||||
`c1` int(11) DEFAULT NULL,
|
||||
`c2` int(11) DEFAULT NULL,
|
||||
KEY `sid` (`c1`),
|
||||
CONSTRAINT `sid` FOREIGN KEY (`c1`) REFERENCES `tpk` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
ALTER TABLE tfk ADD CONSTRAINT sid CHECK (c2>15);
|
||||
ERROR HY000: Duplicate CHECK constraint name 'sid'
|
||||
ALTER TABLE tfk ADD CONSTRAINT sid UNIQUE(c2);
|
||||
ERROR 42000: Duplicate key name 'sid'
|
||||
DROP TABLE tfk;
|
||||
DROP TABLE tpk;
|
||||
|
|
|
@ -117,4 +117,28 @@ alter table t_34455
|
|||
|
||||
drop table t_34455;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18460 Don't allow multiple table CONSTRAINTs with the same name.
|
||||
--echo #
|
||||
|
||||
CREATE TABLE tpk (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,name VARCHAR(100) NOT NULL) ENGINE=Innodb;
|
||||
--error ER_DUP_CONSTRAINT_NAME
|
||||
CREATE TABLE tfk (c1 INT, c2 INT, CONSTRAINT sid UNIQUE (c1), CONSTRAINT sid CHECK (c2>15));
|
||||
|
||||
CREATE TABLE tfk (c1 INT, c2 INT, CONSTRAINT sid UNIQUE (c1));
|
||||
--error ER_DUP_CONSTRAINT_NAME
|
||||
ALTER TABLE tfk ADD CONSTRAINT sid CHECK (c2>15);
|
||||
DROP TABLE tfk;
|
||||
|
||||
CREATE TABLE tfk (c1 INT, c2 INT,
|
||||
CONSTRAINT sid FOREIGN KEY (c1) REFERENCES tpk (id)) ENGINE=Innodb;
|
||||
show create table tfk;
|
||||
--error ER_DUP_CONSTRAINT_NAME
|
||||
ALTER TABLE tfk ADD CONSTRAINT sid CHECK (c2>15);
|
||||
--error ER_DUP_KEYNAME
|
||||
ALTER TABLE tfk ADD CONSTRAINT sid UNIQUE(c2);
|
||||
DROP TABLE tfk;
|
||||
|
||||
DROP TABLE tpk;
|
||||
|
||||
|
||||
|
|
|
@ -21,15 +21,6 @@ create procedure have_ssl()
|
|||
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
|
||||
|
||||
--echo mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()"
|
||||
# this is the test where certificate verification fails.
|
||||
# but yassl doesn't support certificate verification, so
|
||||
# we fake the test result for yassl
|
||||
let yassl=`select variable_value='Unknown' from information_schema.session_status where variable_name='Ssl_session_cache_mode'`;
|
||||
if (!$yassl) {
|
||||
--replace_result "self signed certificate in certificate chain" "Failed to verify the server certificate" "Error in the certificate." "Failed to verify the server certificate"
|
||||
--exec $MYSQL --ssl --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
|
||||
}
|
||||
if ($yassl) {
|
||||
--echo ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate
|
||||
}
|
||||
--replace_regex /SSL connection error.*certificate[^\n]*/SSL connection error: Failed to verify the server certificate/
|
||||
--exec $MYSQL --ssl --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
|
||||
drop procedure have_ssl;
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
# schannel does not support keys longer than 4k
|
||||
-- source include/not_windows.inc
|
||||
|
||||
-- source include/have_ssl_communication.inc
|
||||
#
|
||||
# Bug#29784 YaSSL assertion failure when reading 8k key.
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
# This test should work in embedded server after we fix mysqltest
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_openssl.inc
|
||||
|
||||
if (`SELECT COUNT(*) = 0 FROM information_schema.GLOBAL_VARIABLES
|
||||
WHERE (VARIABLE_NAME ='version_compile_os' AND VARIABLE_VALUE LIKE 'Win%' OR
|
||||
VARIABLE_NAME='have_openssl' AND VARIABLE_VALUE='YES')`)
|
||||
{
|
||||
skip Need openssl or Windows;
|
||||
}
|
||||
|
||||
--echo # Test clients with and without CRL lists
|
||||
|
||||
|
@ -14,10 +20,12 @@ copy_file $MYSQL_TEST_DIR/std_data/server-cert.crl $MYSQL_TMP_DIR/ed1f42db.r0;
|
|||
--echo ############ Test mysql ##############
|
||||
|
||||
--echo # Test mysql connecting to a server with a certificate revoked by -crl
|
||||
--replace_result "Server certificate validation failed. The certificate is revoked. Error 0x80092010(CRYPT_E_REVOKED)" "certificate revoked"
|
||||
--error 1
|
||||
--exec $MYSQL $ssl_crl test -e "SHOW STATUS LIKE 'Ssl_version'" 2>&1
|
||||
|
||||
--echo # Test mysql connecting to a server with a certificate revoked by -crlpath
|
||||
--replace_result "Server certificate validation failed. The certificate is revoked. Error 0x80092010(CRYPT_E_REVOKED)" "certificate revoked"
|
||||
--error 1
|
||||
--exec $MYSQL $ssl_crlpath test -e "SHOW STATUS LIKE 'Ssl_version'" 2>&1
|
||||
|
||||
|
@ -26,11 +34,11 @@ copy_file $MYSQL_TEST_DIR/std_data/server-cert.crl $MYSQL_TMP_DIR/ed1f42db.r0;
|
|||
let $admin_suffix = --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping;
|
||||
|
||||
--echo # Test mysqladmin connecting to a server with a certificate revoked by -crl
|
||||
--replace_regex /.*mysqladmin.*:/mysqladmin:/
|
||||
--replace_regex /.*mysqladmin.*:/mysqladmin:/ /SSL connection error: .*CRYPT_E_REVOKED./SSL connection error: certificate revoked/
|
||||
--error 1
|
||||
--exec $MYSQLADMIN $ssl_crl $admin_suffix 2>&1
|
||||
|
||||
--echo # Test mysqladmin connecting to a server with a certificate revoked by -crlpath
|
||||
--replace_regex /.*mysqladmin.*:/mysqladmin:/
|
||||
--replace_regex /.*mysqladmin.*:/mysqladmin:/ /SSL connection error: .*CRYPT_E_REVOKED./SSL connection error: certificate revoked/
|
||||
--error 1
|
||||
--exec $MYSQLADMIN $ssl_crlpath $admin_suffix 2>&1
|
||||
|
|
|
@ -3634,6 +3634,15 @@ rank() over (partition by 'abc' order by 'xyz')
|
|||
1
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-19380: ASAN heap-use-after-free in Protocol::net_store_data
|
||||
#
|
||||
CREATE TABLE t1 (i int);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SELECT (SELECT MIN('foo') OVER() FROM t1 LIMIT 1) as x;
|
||||
x
|
||||
foo
|
||||
drop table t1;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
|
|
@ -2341,6 +2341,16 @@ select rank() over (partition by 'abc' order by 'xyz') from t1;
|
|||
select rank() over (partition by 'abc' order by 'xyz') from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-19380: ASAN heap-use-after-free in Protocol::net_store_data
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (i int);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
|
||||
SELECT (SELECT MIN('foo') OVER() FROM t1 LIMIT 1) as x;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.2 tests
|
||||
--echo #
|
||||
|
|
|
@ -16,6 +16,7 @@ wsrep-sync-wait=15
|
|||
#galera_port=@OPT.port
|
||||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep-on=1
|
||||
wsrep-cluster-address=gcomm://
|
||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
|
||||
|
@ -25,6 +26,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
|
|||
#galera_port=@OPT.port
|
||||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep-on=1
|
||||
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
|
||||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
|
||||
|
@ -35,6 +37,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
|
|||
#galera_port=@OPT.port
|
||||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep-on=1
|
||||
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
|
||||
wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
|
||||
|
@ -45,6 +48,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
|
|||
#galera_port=@OPT.port
|
||||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep-on=1
|
||||
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
|
||||
wsrep_provider_options='base_port=@mysqld.4.#galera_port;gcache.size=10M'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
|
||||
|
|
424
mysql-test/suite/galera/r/galera_partition.result
Normal file
424
mysql-test/suite/galera/r/galera_partition.result
Normal file
|
@ -0,0 +1,424 @@
|
|||
connection node_1;
|
||||
call mtr.add_suppression("WSREP: RSU failed due to pending transactions, schema: test, query ALTER.*");
|
||||
call mtr.add_suppression("WSREP: ALTER TABLE isolation failure");
|
||||
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
|
||||
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
connection node_1;
|
||||
CREATE TABLE t1(
|
||||
id bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
dt datetime NOT NULL,
|
||||
PRIMARY KEY (id,dt),
|
||||
KEY dt_idx (dt)
|
||||
) ENGINE=InnoDB
|
||||
PARTITION BY RANGE( TO_DAYS(dt) ) (
|
||||
PARTITION rx2009xx VALUES LESS THAN( TO_DAYS('2010-01-01 00:00:00') ),
|
||||
PARTITION rx201001 VALUES LESS THAN( TO_DAYS('2010-02-01 00:00:00') ),
|
||||
PARTITION rx201002 VALUES LESS THAN( TO_DAYS('2010-03-01 00:00:00') ),
|
||||
PARTITION rx201003 VALUES LESS THAN( TO_DAYS('2010-04-01 00:00:00') ),
|
||||
PARTITION rx201004 VALUES LESS THAN( TO_DAYS('2010-05-01 00:00:00') ),
|
||||
PARTITION rx201005 VALUES LESS THAN( TO_DAYS('2010-06-01 00:00:00') ),
|
||||
PARTITION rx201006 VALUES LESS THAN( TO_DAYS('2010-07-01 00:00:00') ),
|
||||
PARTITION rx201007 VALUES LESS THAN( TO_DAYS('2010-08-01 00:00:00') ),
|
||||
PARTITION rx201008 VALUES LESS THAN( TO_DAYS('2010-09-01 00:00:00') ),
|
||||
PARTITION rx201009 VALUES LESS THAN( TO_DAYS('2010-10-01 00:00:00') ),
|
||||
PARTITION rx201010 VALUES LESS THAN( TO_DAYS('2010-11-01 00:00:00') ),
|
||||
PARTITION rx201011 VALUES LESS THAN( TO_DAYS('2010-12-01 00:00:00') ),
|
||||
PARTITION rx201012 VALUES LESS THAN( TO_DAYS('2011-01-01 00:00:00') ),
|
||||
PARTITION rx2011 VALUES LESS THAN MAXVALUE);
|
||||
CREATE PROCEDURE p1 (repeat_count int)
|
||||
BEGIN
|
||||
DECLARE current_num int;
|
||||
SET current_num = 0;
|
||||
WHILE current_num < repeat_count do
|
||||
INSERT INTO t1 VALUES (NULL, '2010-10-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2010-02-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2010-03-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2010-04-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2010-06-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2010-10-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2012-02-21 00:00:00');
|
||||
COMMIT;
|
||||
SET current_num = current_num + 1;
|
||||
END WHILE;
|
||||
END|
|
||||
insert into t1 (id, dt) values (1, '2010-01-02 00:00:00');
|
||||
insert into t1 (id, dt) values (2, '2010-01-03 00:00:00');
|
||||
insert into t1 (id, dt) values (3, '2010-01-04 00:00:00');
|
||||
insert into t1 (id, dt) values (4, '2010-01-05 00:00:00');
|
||||
insert into t1 (id, dt) values (5, '2010-01-06 00:00:00');
|
||||
insert into t1 (id, dt) values (6, '2010-01-07 00:00:00');
|
||||
insert into t1 (id, dt) values (7, '2010-01-08 00:00:00');
|
||||
insert into t1 (id, dt) values (8, '2010-01-09 00:00:00');
|
||||
insert into t1 (id, dt) values (9, '2010-01-10 00:00:00');
|
||||
insert into t1 (id, dt) values (10, '2010-01-11 00:00:00');
|
||||
insert into t1 (id, dt) values (11, '2010-01-12 00:00:00');
|
||||
insert into t1 (id, dt) values (12, '2010-01-13 00:00:00');
|
||||
insert into t1 (id, dt) values (13, '2010-01-14 00:00:00');
|
||||
insert into t1 (id, dt) values (14, '2010-01-15 00:00:00');
|
||||
insert into t1 (id, dt) values (15, '2010-01-16 00:00:00');
|
||||
insert into t1 (id, dt) values (16, '2010-01-17 00:00:00');
|
||||
insert into t1 (id, dt) values (17, '2010-01-18 00:00:00');
|
||||
insert into t1 (id, dt) values (18, '2010-01-19 00:00:00');
|
||||
insert into t1 (id, dt) values (19, '2010-01-20 00:00:00');
|
||||
insert into t1 (id, dt) values (20, '2010-01-21 00:00:00');
|
||||
insert into t1 (id, dt) values (21, '2010-01-22 00:00:00');
|
||||
insert into t1 (id, dt) values (22, '2010-01-23 00:00:00');
|
||||
insert into t1 (id, dt) values (23, '2010-01-24 00:00:00');
|
||||
insert into t1 (id, dt) values (24, '2010-01-25 00:00:00');
|
||||
insert into t1 (id, dt) values (25, '2010-01-26 00:00:00');
|
||||
insert into t1 (id, dt) values (26, '2010-01-27 00:00:00');
|
||||
insert into t1 (id, dt) values (27, '2010-01-28 00:00:00');
|
||||
insert into t1 (id, dt) values (28, '2010-01-29 00:00:00');
|
||||
insert into t1 (id, dt) values (29, '2010-01-30 00:00:00');
|
||||
insert into t1 (id, dt) values (30, '2010-01-31 00:00:00');
|
||||
insert into t1 (id, dt) values (31, '2010-02-01 00:00:00');
|
||||
insert into t1 (id, dt) values (32, '2010-02-02 00:00:00');
|
||||
insert into t1 (id, dt) values (33, '2010-02-03 00:00:00');
|
||||
insert into t1 (id, dt) values (34, '2010-02-04 00:00:00');
|
||||
insert into t1 (id, dt) values (35, '2010-02-05 00:00:00');
|
||||
insert into t1 (id, dt) values (36, '2010-02-06 00:00:00');
|
||||
insert into t1 (id, dt) values (37, '2010-02-07 00:00:00');
|
||||
insert into t1 (id, dt) values (38, '2010-02-08 00:00:00');
|
||||
insert into t1 (id, dt) values (39, '2010-02-09 00:00:00');
|
||||
insert into t1 (id, dt) values (40, '2010-02-10 00:00:00');
|
||||
insert into t1 (id, dt) values (41, '2010-02-11 00:00:00');
|
||||
insert into t1 (id, dt) values (42, '2010-02-12 00:00:00');
|
||||
insert into t1 (id, dt) values (43, '2010-02-13 00:00:00');
|
||||
insert into t1 (id, dt) values (44, '2010-02-14 00:00:00');
|
||||
insert into t1 (id, dt) values (45, '2010-02-15 00:00:00');
|
||||
insert into t1 (id, dt) values (46, '2010-02-16 00:00:00');
|
||||
insert into t1 (id, dt) values (47, '2010-02-17 00:00:00');
|
||||
insert into t1 (id, dt) values (48, '2010-02-18 00:00:00');
|
||||
insert into t1 (id, dt) values (49, '2010-02-19 00:00:00');
|
||||
insert into t1 (id, dt) values (50, '2010-02-20 00:00:00');
|
||||
insert into t1 (id, dt) values (51, '2010-02-21 00:00:00');
|
||||
insert into t1 (id, dt) values (52, '2010-02-22 00:00:00');
|
||||
insert into t1 (id, dt) values (53, '2010-02-23 00:00:00');
|
||||
insert into t1 (id, dt) values (54, '2010-02-24 00:00:00');
|
||||
insert into t1 (id, dt) values (55, '2010-02-25 00:00:00');
|
||||
insert into t1 (id, dt) values (56, '2010-02-26 00:00:00');
|
||||
insert into t1 (id, dt) values (57, '2010-02-27 00:00:00');
|
||||
insert into t1 (id, dt) values (58, '2010-02-28 00:00:00');
|
||||
insert into t1 (id, dt) values (59, '2010-03-01 00:00:00');
|
||||
insert into t1 (id, dt) values (60, '2010-03-02 00:00:00');
|
||||
insert into t1 (id, dt) values (61, '2010-03-03 00:00:00');
|
||||
insert into t1 (id, dt) values (62, '2010-03-04 00:00:00');
|
||||
insert into t1 (id, dt) values (63, '2010-03-05 00:00:00');
|
||||
insert into t1 (id, dt) values (64, '2010-03-06 00:00:00');
|
||||
insert into t1 (id, dt) values (65, '2010-03-07 00:00:00');
|
||||
insert into t1 (id, dt) values (66, '2010-03-08 00:00:00');
|
||||
insert into t1 (id, dt) values (67, '2010-03-09 00:00:00');
|
||||
insert into t1 (id, dt) values (68, '2010-03-10 00:00:00');
|
||||
insert into t1 (id, dt) values (69, '2010-03-11 00:00:00');
|
||||
insert into t1 (id, dt) values (70, '2010-03-12 00:00:00');
|
||||
insert into t1 (id, dt) values (71, '2010-03-13 00:00:00');
|
||||
insert into t1 (id, dt) values (72, '2010-03-14 00:00:00');
|
||||
insert into t1 (id, dt) values (73, '2010-03-15 00:00:00');
|
||||
insert into t1 (id, dt) values (74, '2010-03-16 00:00:00');
|
||||
insert into t1 (id, dt) values (75, '2010-03-17 00:00:00');
|
||||
insert into t1 (id, dt) values (76, '2010-03-18 00:00:00');
|
||||
insert into t1 (id, dt) values (77, '2010-03-19 00:00:00');
|
||||
insert into t1 (id, dt) values (78, '2010-03-20 00:00:00');
|
||||
insert into t1 (id, dt) values (79, '2010-03-21 00:00:00');
|
||||
insert into t1 (id, dt) values (80, '2010-03-22 00:00:00');
|
||||
insert into t1 (id, dt) values (81, '2010-03-23 00:00:00');
|
||||
insert into t1 (id, dt) values (82, '2010-03-24 00:00:00');
|
||||
insert into t1 (id, dt) values (83, '2010-03-25 00:00:00');
|
||||
insert into t1 (id, dt) values (84, '2010-03-26 00:00:00');
|
||||
insert into t1 (id, dt) values (85, '2010-03-27 00:00:00');
|
||||
insert into t1 (id, dt) values (86, '2010-03-28 00:00:00');
|
||||
insert into t1 (id, dt) values (87, '2010-03-29 00:00:00');
|
||||
insert into t1 (id, dt) values (88, '2010-03-30 00:00:00');
|
||||
insert into t1 (id, dt) values (89, '2010-03-31 00:00:00');
|
||||
insert into t1 (id, dt) values (90, '2010-04-01 00:00:00');
|
||||
insert into t1 (id, dt) values (91, '2010-04-02 00:00:00');
|
||||
insert into t1 (id, dt) values (92, '2010-04-03 00:00:00');
|
||||
insert into t1 (id, dt) values (93, '2010-04-04 00:00:00');
|
||||
insert into t1 (id, dt) values (94, '2010-04-05 00:00:00');
|
||||
insert into t1 (id, dt) values (95, '2010-04-06 00:00:00');
|
||||
insert into t1 (id, dt) values (96, '2010-04-07 00:00:00');
|
||||
insert into t1 (id, dt) values (97, '2010-04-08 00:00:00');
|
||||
insert into t1 (id, dt) values (98, '2010-04-09 00:00:00');
|
||||
insert into t1 (id, dt) values (99, '2010-04-10 00:00:00');
|
||||
insert into t1 (id, dt) values (100, '2010-04-11 00:00:00');
|
||||
insert into t1 (id, dt) values (101, '2010-04-12 00:00:00');
|
||||
insert into t1 (id, dt) values (102, '2010-04-13 00:00:00');
|
||||
insert into t1 (id, dt) values (103, '2010-04-14 00:00:00');
|
||||
insert into t1 (id, dt) values (104, '2010-04-15 00:00:00');
|
||||
insert into t1 (id, dt) values (105, '2010-04-16 00:00:00');
|
||||
insert into t1 (id, dt) values (106, '2010-04-17 00:00:00');
|
||||
insert into t1 (id, dt) values (107, '2010-04-18 00:00:00');
|
||||
insert into t1 (id, dt) values (108, '2010-04-19 00:00:00');
|
||||
insert into t1 (id, dt) values (109, '2010-04-20 00:00:00');
|
||||
insert into t1 (id, dt) values (110, '2010-04-21 00:00:00');
|
||||
insert into t1 (id, dt) values (111, '2010-04-22 00:00:00');
|
||||
insert into t1 (id, dt) values (112, '2010-04-23 00:00:00');
|
||||
insert into t1 (id, dt) values (113, '2010-04-24 00:00:00');
|
||||
insert into t1 (id, dt) values (114, '2010-04-25 00:00:00');
|
||||
insert into t1 (id, dt) values (115, '2010-04-26 00:00:00');
|
||||
insert into t1 (id, dt) values (116, '2010-04-27 00:00:00');
|
||||
insert into t1 (id, dt) values (117, '2010-04-28 00:00:00');
|
||||
insert into t1 (id, dt) values (118, '2010-04-29 00:00:00');
|
||||
insert into t1 (id, dt) values (119, '2010-04-30 00:00:00');
|
||||
insert into t1 (id, dt) values (120, '2010-05-01 00:00:00');
|
||||
insert into t1 (id, dt) values (121, '2010-05-02 00:00:00');
|
||||
insert into t1 (id, dt) values (122, '2010-05-03 00:00:00');
|
||||
insert into t1 (id, dt) values (123, '2010-05-04 00:00:00');
|
||||
insert into t1 (id, dt) values (124, '2010-05-05 00:00:00');
|
||||
insert into t1 (id, dt) values (125, '2010-05-06 00:00:00');
|
||||
insert into t1 (id, dt) values (126, '2010-05-07 00:00:00');
|
||||
insert into t1 (id, dt) values (127, '2010-05-08 00:00:00');
|
||||
insert into t1 (id, dt) values (128, '2010-05-09 00:00:00');
|
||||
insert into t1 (id, dt) values (129, '2010-05-10 00:00:00');
|
||||
insert into t1 (id, dt) values (130, '2010-05-11 00:00:00');
|
||||
insert into t1 (id, dt) values (131, '2010-05-12 00:00:00');
|
||||
insert into t1 (id, dt) values (132, '2010-05-13 00:00:00');
|
||||
insert into t1 (id, dt) values (133, '2010-05-14 00:00:00');
|
||||
insert into t1 (id, dt) values (134, '2010-05-15 00:00:00');
|
||||
insert into t1 (id, dt) values (135, '2010-05-16 00:00:00');
|
||||
insert into t1 (id, dt) values (136, '2010-05-17 00:00:00');
|
||||
insert into t1 (id, dt) values (137, '2010-05-18 00:00:00');
|
||||
insert into t1 (id, dt) values (138, '2010-05-19 00:00:00');
|
||||
insert into t1 (id, dt) values (139, '2010-05-20 00:00:00');
|
||||
insert into t1 (id, dt) values (140, '2010-05-21 00:00:00');
|
||||
insert into t1 (id, dt) values (141, '2010-05-22 00:00:00');
|
||||
insert into t1 (id, dt) values (142, '2010-05-23 00:00:00');
|
||||
insert into t1 (id, dt) values (143, '2010-05-24 00:00:00');
|
||||
insert into t1 (id, dt) values (144, '2010-05-25 00:00:00');
|
||||
insert into t1 (id, dt) values (145, '2010-05-26 00:00:00');
|
||||
insert into t1 (id, dt) values (146, '2010-05-27 00:00:00');
|
||||
insert into t1 (id, dt) values (147, '2010-05-28 00:00:00');
|
||||
insert into t1 (id, dt) values (148, '2010-05-29 00:00:00');
|
||||
insert into t1 (id, dt) values (149, '2010-05-30 00:00:00');
|
||||
insert into t1 (id, dt) values (150, '2010-05-31 00:00:00');
|
||||
insert into t1 (id, dt) values (151, '2010-06-01 00:00:00');
|
||||
insert into t1 (id, dt) values (152, '2010-06-02 00:00:00');
|
||||
insert into t1 (id, dt) values (153, '2010-06-03 00:00:00');
|
||||
insert into t1 (id, dt) values (154, '2010-06-04 00:00:00');
|
||||
insert into t1 (id, dt) values (155, '2010-06-05 00:00:00');
|
||||
insert into t1 (id, dt) values (156, '2010-06-06 00:00:00');
|
||||
insert into t1 (id, dt) values (157, '2010-06-07 00:00:00');
|
||||
insert into t1 (id, dt) values (158, '2010-06-08 00:00:00');
|
||||
insert into t1 (id, dt) values (159, '2010-06-09 00:00:00');
|
||||
insert into t1 (id, dt) values (160, '2010-06-10 00:00:00');
|
||||
insert into t1 (id, dt) values (161, '2010-06-11 00:00:00');
|
||||
insert into t1 (id, dt) values (162, '2010-06-12 00:00:00');
|
||||
insert into t1 (id, dt) values (163, '2010-06-13 00:00:00');
|
||||
insert into t1 (id, dt) values (164, '2010-06-14 00:00:00');
|
||||
insert into t1 (id, dt) values (165, '2010-06-15 00:00:00');
|
||||
insert into t1 (id, dt) values (166, '2010-06-16 00:00:00');
|
||||
insert into t1 (id, dt) values (167, '2010-06-17 00:00:00');
|
||||
insert into t1 (id, dt) values (168, '2010-06-18 00:00:00');
|
||||
insert into t1 (id, dt) values (169, '2010-06-19 00:00:00');
|
||||
insert into t1 (id, dt) values (170, '2010-06-20 00:00:00');
|
||||
insert into t1 (id, dt) values (171, '2010-06-21 00:00:00');
|
||||
insert into t1 (id, dt) values (172, '2010-06-22 00:00:00');
|
||||
insert into t1 (id, dt) values (173, '2010-06-23 00:00:00');
|
||||
insert into t1 (id, dt) values (174, '2010-06-24 00:00:00');
|
||||
insert into t1 (id, dt) values (175, '2010-06-25 00:00:00');
|
||||
insert into t1 (id, dt) values (176, '2010-06-26 00:00:00');
|
||||
insert into t1 (id, dt) values (177, '2010-06-27 00:00:00');
|
||||
insert into t1 (id, dt) values (178, '2010-06-28 00:00:00');
|
||||
insert into t1 (id, dt) values (179, '2010-06-29 00:00:00');
|
||||
insert into t1 (id, dt) values (180, '2010-06-30 00:00:00');
|
||||
insert into t1 (id, dt) values (181, '2010-07-01 00:00:00');
|
||||
insert into t1 (id, dt) values (182, '2010-07-02 00:00:00');
|
||||
insert into t1 (id, dt) values (183, '2010-07-03 00:00:00');
|
||||
insert into t1 (id, dt) values (184, '2010-07-04 00:00:00');
|
||||
insert into t1 (id, dt) values (185, '2010-07-05 00:00:00');
|
||||
insert into t1 (id, dt) values (186, '2010-07-06 00:00:00');
|
||||
insert into t1 (id, dt) values (187, '2010-07-07 00:00:00');
|
||||
insert into t1 (id, dt) values (188, '2010-07-08 00:00:00');
|
||||
insert into t1 (id, dt) values (189, '2010-07-09 00:00:00');
|
||||
insert into t1 (id, dt) values (190, '2010-07-10 00:00:00');
|
||||
insert into t1 (id, dt) values (191, '2010-07-11 00:00:00');
|
||||
insert into t1 (id, dt) values (192, '2010-07-12 00:00:00');
|
||||
insert into t1 (id, dt) values (193, '2010-07-13 00:00:00');
|
||||
insert into t1 (id, dt) values (194, '2010-07-14 00:00:00');
|
||||
insert into t1 (id, dt) values (195, '2010-07-15 00:00:00');
|
||||
insert into t1 (id, dt) values (196, '2010-07-16 00:00:00');
|
||||
insert into t1 (id, dt) values (197, '2010-07-17 00:00:00');
|
||||
insert into t1 (id, dt) values (198, '2010-07-18 00:00:00');
|
||||
insert into t1 (id, dt) values (199, '2010-07-19 00:00:00');
|
||||
insert into t1 (id, dt) values (200, '2010-07-20 00:00:00');
|
||||
insert into t1 (id, dt) values (201, '2010-07-21 00:00:00');
|
||||
insert into t1 (id, dt) values (202, '2010-07-22 00:00:00');
|
||||
insert into t1 (id, dt) values (203, '2010-07-23 00:00:00');
|
||||
insert into t1 (id, dt) values (204, '2010-07-24 00:00:00');
|
||||
insert into t1 (id, dt) values (205, '2010-07-25 00:00:00');
|
||||
insert into t1 (id, dt) values (206, '2010-07-26 00:00:00');
|
||||
insert into t1 (id, dt) values (207, '2010-07-27 00:00:00');
|
||||
insert into t1 (id, dt) values (208, '2010-07-28 00:00:00');
|
||||
insert into t1 (id, dt) values (209, '2010-07-29 00:00:00');
|
||||
insert into t1 (id, dt) values (210, '2010-07-30 00:00:00');
|
||||
insert into t1 (id, dt) values (211, '2010-07-31 00:00:00');
|
||||
insert into t1 (id, dt) values (212, '2010-08-01 00:00:00');
|
||||
insert into t1 (id, dt) values (213, '2010-08-02 00:00:00');
|
||||
insert into t1 (id, dt) values (214, '2010-08-03 00:00:00');
|
||||
insert into t1 (id, dt) values (215, '2010-08-04 00:00:00');
|
||||
insert into t1 (id, dt) values (216, '2010-08-05 00:00:00');
|
||||
insert into t1 (id, dt) values (217, '2010-08-06 00:00:00');
|
||||
insert into t1 (id, dt) values (218, '2010-08-07 00:00:00');
|
||||
insert into t1 (id, dt) values (219, '2010-08-08 00:00:00');
|
||||
insert into t1 (id, dt) values (220, '2010-08-09 00:00:00');
|
||||
insert into t1 (id, dt) values (221, '2010-08-10 00:00:00');
|
||||
insert into t1 (id, dt) values (222, '2010-08-11 00:00:00');
|
||||
insert into t1 (id, dt) values (223, '2010-08-12 00:00:00');
|
||||
insert into t1 (id, dt) values (224, '2010-08-13 00:00:00');
|
||||
insert into t1 (id, dt) values (225, '2010-08-14 00:00:00');
|
||||
insert into t1 (id, dt) values (226, '2010-08-15 00:00:00');
|
||||
insert into t1 (id, dt) values (227, '2010-08-16 00:00:00');
|
||||
insert into t1 (id, dt) values (228, '2010-08-17 00:00:00');
|
||||
insert into t1 (id, dt) values (229, '2010-08-18 00:00:00');
|
||||
insert into t1 (id, dt) values (230, '2010-08-19 00:00:00');
|
||||
insert into t1 (id, dt) values (231, '2010-08-20 00:00:00');
|
||||
insert into t1 (id, dt) values (232, '2010-08-21 00:00:00');
|
||||
insert into t1 (id, dt) values (233, '2010-08-22 00:00:00');
|
||||
insert into t1 (id, dt) values (234, '2010-08-23 00:00:00');
|
||||
insert into t1 (id, dt) values (235, '2010-08-24 00:00:00');
|
||||
insert into t1 (id, dt) values (236, '2010-08-25 00:00:00');
|
||||
insert into t1 (id, dt) values (237, '2010-08-26 00:00:00');
|
||||
insert into t1 (id, dt) values (238, '2010-08-27 00:00:00');
|
||||
insert into t1 (id, dt) values (239, '2010-08-28 00:00:00');
|
||||
insert into t1 (id, dt) values (240, '2010-08-29 00:00:00');
|
||||
insert into t1 (id, dt) values (241, '2010-08-30 00:00:00');
|
||||
insert into t1 (id, dt) values (242, '2010-08-31 00:00:00');
|
||||
insert into t1 (id, dt) values (243, '2010-09-01 00:00:00');
|
||||
insert into t1 (id, dt) values (244, '2010-09-02 00:00:00');
|
||||
insert into t1 (id, dt) values (245, '2010-09-03 00:00:00');
|
||||
insert into t1 (id, dt) values (246, '2010-09-04 00:00:00');
|
||||
insert into t1 (id, dt) values (247, '2010-09-05 00:00:00');
|
||||
insert into t1 (id, dt) values (248, '2010-09-06 00:00:00');
|
||||
insert into t1 (id, dt) values (249, '2010-09-07 00:00:00');
|
||||
insert into t1 (id, dt) values (250, '2010-09-08 00:00:00');
|
||||
insert into t1 (id, dt) values (251, '2010-09-09 00:00:00');
|
||||
insert into t1 (id, dt) values (252, '2010-09-10 00:00:00');
|
||||
insert into t1 (id, dt) values (253, '2010-09-11 00:00:00');
|
||||
insert into t1 (id, dt) values (254, '2010-09-12 00:00:00');
|
||||
insert into t1 (id, dt) values (255, '2010-09-13 00:00:00');
|
||||
insert into t1 (id, dt) values (256, '2010-09-14 00:00:00');
|
||||
insert into t1 (id, dt) values (257, '2010-09-15 00:00:00');
|
||||
insert into t1 (id, dt) values (258, '2010-09-16 00:00:00');
|
||||
insert into t1 (id, dt) values (259, '2010-09-17 00:00:00');
|
||||
insert into t1 (id, dt) values (260, '2010-09-18 00:00:00');
|
||||
insert into t1 (id, dt) values (261, '2010-09-19 00:00:00');
|
||||
insert into t1 (id, dt) values (262, '2010-09-20 00:00:00');
|
||||
insert into t1 (id, dt) values (263, '2010-09-21 00:00:00');
|
||||
insert into t1 (id, dt) values (264, '2010-09-22 00:00:00');
|
||||
insert into t1 (id, dt) values (265, '2010-09-23 00:00:00');
|
||||
insert into t1 (id, dt) values (266, '2010-09-24 00:00:00');
|
||||
insert into t1 (id, dt) values (267, '2010-09-25 00:00:00');
|
||||
insert into t1 (id, dt) values (268, '2010-09-26 00:00:00');
|
||||
insert into t1 (id, dt) values (269, '2010-09-27 00:00:00');
|
||||
insert into t1 (id, dt) values (270, '2010-09-28 00:00:00');
|
||||
insert into t1 (id, dt) values (271, '2010-09-29 00:00:00');
|
||||
insert into t1 (id, dt) values (272, '2010-09-30 00:00:00');
|
||||
insert into t1 (id, dt) values (273, '2010-10-01 00:00:00');
|
||||
insert into t1 (id, dt) values (274, '2010-10-02 00:00:00');
|
||||
insert into t1 (id, dt) values (275, '2010-10-03 00:00:00');
|
||||
insert into t1 (id, dt) values (276, '2010-10-04 00:00:00');
|
||||
insert into t1 (id, dt) values (277, '2010-10-05 00:00:00');
|
||||
insert into t1 (id, dt) values (278, '2010-10-06 00:00:00');
|
||||
insert into t1 (id, dt) values (279, '2010-10-07 00:00:00');
|
||||
insert into t1 (id, dt) values (280, '2010-10-08 00:00:00');
|
||||
insert into t1 (id, dt) values (281, '2010-10-09 00:00:00');
|
||||
insert into t1 (id, dt) values (282, '2010-10-10 00:00:00');
|
||||
insert into t1 (id, dt) values (283, '2010-10-11 00:00:00');
|
||||
insert into t1 (id, dt) values (284, '2010-10-12 00:00:00');
|
||||
insert into t1 (id, dt) values (285, '2010-10-13 00:00:00');
|
||||
insert into t1 (id, dt) values (286, '2010-10-14 00:00:00');
|
||||
insert into t1 (id, dt) values (287, '2010-10-15 00:00:00');
|
||||
insert into t1 (id, dt) values (288, '2010-10-16 00:00:00');
|
||||
insert into t1 (id, dt) values (289, '2010-10-17 00:00:00');
|
||||
insert into t1 (id, dt) values (290, '2010-10-18 00:00:00');
|
||||
insert into t1 (id, dt) values (291, '2010-10-19 00:00:00');
|
||||
insert into t1 (id, dt) values (292, '2010-10-20 00:00:00');
|
||||
insert into t1 (id, dt) values (293, '2010-10-21 00:00:00');
|
||||
insert into t1 (id, dt) values (294, '2010-10-22 00:00:00');
|
||||
insert into t1 (id, dt) values (295, '2010-10-23 00:00:00');
|
||||
insert into t1 (id, dt) values (296, '2010-10-24 00:00:00');
|
||||
insert into t1 (id, dt) values (297, '2010-10-25 00:00:00');
|
||||
insert into t1 (id, dt) values (298, '2010-10-26 00:00:00');
|
||||
insert into t1 (id, dt) values (299, '2010-10-27 00:00:00');
|
||||
insert into t1 (id, dt) values (300, '2010-10-28 00:00:00');
|
||||
insert into t1 (id, dt) values (301, '2010-10-29 00:00:00');
|
||||
insert into t1 (id, dt) values (302, '2010-10-30 00:00:00');
|
||||
insert into t1 (id, dt) values (303, '2010-10-31 00:00:00');
|
||||
insert into t1 (id, dt) values (304, '2010-11-01 00:00:00');
|
||||
insert into t1 (id, dt) values (305, '2010-11-02 00:00:00');
|
||||
insert into t1 (id, dt) values (306, '2010-11-03 00:00:00');
|
||||
insert into t1 (id, dt) values (307, '2010-11-04 00:00:00');
|
||||
insert into t1 (id, dt) values (308, '2010-11-05 00:00:00');
|
||||
insert into t1 (id, dt) values (309, '2010-11-06 00:00:00');
|
||||
insert into t1 (id, dt) values (310, '2010-11-07 00:00:00');
|
||||
insert into t1 (id, dt) values (311, '2010-11-08 00:00:00');
|
||||
insert into t1 (id, dt) values (312, '2010-11-09 00:00:00');
|
||||
insert into t1 (id, dt) values (313, '2010-11-10 00:00:00');
|
||||
insert into t1 (id, dt) values (314, '2010-11-11 00:00:00');
|
||||
insert into t1 (id, dt) values (315, '2010-11-12 00:00:00');
|
||||
insert into t1 (id, dt) values (316, '2010-11-13 00:00:00');
|
||||
insert into t1 (id, dt) values (317, '2010-11-14 00:00:00');
|
||||
insert into t1 (id, dt) values (318, '2010-11-15 00:00:00');
|
||||
insert into t1 (id, dt) values (319, '2010-11-16 00:00:00');
|
||||
insert into t1 (id, dt) values (320, '2010-11-17 00:00:00');
|
||||
insert into t1 (id, dt) values (321, '2010-11-18 00:00:00');
|
||||
insert into t1 (id, dt) values (322, '2010-11-19 00:00:00');
|
||||
insert into t1 (id, dt) values (323, '2010-11-20 00:00:00');
|
||||
insert into t1 (id, dt) values (324, '2010-11-21 00:00:00');
|
||||
insert into t1 (id, dt) values (325, '2010-11-22 00:00:00');
|
||||
insert into t1 (id, dt) values (326, '2010-11-23 00:00:00');
|
||||
insert into t1 (id, dt) values (327, '2010-11-24 00:00:00');
|
||||
insert into t1 (id, dt) values (328, '2010-11-25 00:00:00');
|
||||
insert into t1 (id, dt) values (329, '2010-11-26 00:00:00');
|
||||
insert into t1 (id, dt) values (330, '2010-11-27 00:00:00');
|
||||
insert into t1 (id, dt) values (331, '2010-11-28 00:00:00');
|
||||
insert into t1 (id, dt) values (332, '2010-11-29 00:00:00');
|
||||
insert into t1 (id, dt) values (333, '2010-11-30 00:00:00');
|
||||
insert into t1 (id, dt) values (334, '2010-12-01 00:00:00');
|
||||
insert into t1 (id, dt) values (335, '2010-12-02 00:00:00');
|
||||
insert into t1 (id, dt) values (336, '2010-12-03 00:00:00');
|
||||
insert into t1 (id, dt) values (337, '2010-12-04 00:00:00');
|
||||
insert into t1 (id, dt) values (338, '2010-12-05 00:00:00');
|
||||
insert into t1 (id, dt) values (339, '2010-12-06 00:00:00');
|
||||
insert into t1 (id, dt) values (340, '2010-12-07 00:00:00');
|
||||
insert into t1 (id, dt) values (341, '2010-12-08 00:00:00');
|
||||
insert into t1 (id, dt) values (342, '2010-12-09 00:00:00');
|
||||
insert into t1 (id, dt) values (343, '2010-12-10 00:00:00');
|
||||
insert into t1 (id, dt) values (344, '2010-12-11 00:00:00');
|
||||
insert into t1 (id, dt) values (345, '2010-12-12 00:00:00');
|
||||
insert into t1 (id, dt) values (346, '2010-12-13 00:00:00');
|
||||
insert into t1 (id, dt) values (347, '2010-12-14 00:00:00');
|
||||
insert into t1 (id, dt) values (348, '2010-12-15 00:00:00');
|
||||
insert into t1 (id, dt) values (349, '2010-12-16 00:00:00');
|
||||
insert into t1 (id, dt) values (350, '2010-12-17 00:00:00');
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
350
|
||||
connection node_2;
|
||||
call p1(100);;
|
||||
connection node_1a;
|
||||
call p1(100);;
|
||||
connection node_3;
|
||||
call p1(100);;
|
||||
connection node_4;
|
||||
call p1(100);;
|
||||
connection node_1;
|
||||
SET SESSION wsrep_OSU_method='RSU';
|
||||
SELECT @@wsrep_OSU_method;
|
||||
@@wsrep_OSU_method
|
||||
RSU
|
||||
SET SESSION sql_log_bin = 0;
|
||||
ALTER TABLE t1 DROP PARTITION rx2009xx;
|
||||
ALTER TABLE t1 DROP PARTITION rx201004;
|
||||
ALTER TABLE t1 DROP PARTITION rx201008;
|
||||
SET SESSION wsrep_OSU_METHOD='TOI';
|
||||
SELECT @@wsrep_OSU_method;
|
||||
@@wsrep_OSU_method
|
||||
TOI
|
||||
connection node_2;
|
||||
connection node_3;
|
||||
connection node_4;
|
||||
connection node_1a;
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
18
mysql-test/suite/galera/t/galera_partition.cnf
Normal file
18
mysql-test/suite/galera/t/galera_partition.cnf
Normal file
|
@ -0,0 +1,18 @@
|
|||
!include ../galera_4nodes.cnf
|
||||
|
||||
[mysqld.1]
|
||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;gmcast.segment=1'
|
||||
wsrep_slave_threads=10
|
||||
|
||||
[mysqld.2]
|
||||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M;gmcast.segment=1'
|
||||
wsrep_slave_threads=10
|
||||
|
||||
[mysqld.3]
|
||||
wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M;gmcast.segment=2'
|
||||
wsrep_slave_threads=10
|
||||
|
||||
[mysqld.4]
|
||||
wsrep_provider_options='base_port=@mysqld.4.#galera_port;gcache.size=10M;gmcast.segment=3'
|
||||
wsrep_slave_threads=10
|
||||
|
453
mysql-test/suite/galera/t/galera_partition.test
Normal file
453
mysql-test/suite/galera/t/galera_partition.test
Normal file
|
@ -0,0 +1,453 @@
|
|||
--source include/galera_cluster.inc
|
||||
--source include/have_partition.inc
|
||||
|
||||
--connection node_1
|
||||
|
||||
call mtr.add_suppression("WSREP: RSU failed due to pending transactions, schema: test, query ALTER.*");
|
||||
call mtr.add_suppression("WSREP: ALTER TABLE isolation failure");
|
||||
|
||||
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
||||
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
|
||||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
|
||||
--connection node_1
|
||||
|
||||
CREATE TABLE t1(
|
||||
id bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
dt datetime NOT NULL,
|
||||
PRIMARY KEY (id,dt),
|
||||
KEY dt_idx (dt)
|
||||
) ENGINE=InnoDB
|
||||
PARTITION BY RANGE( TO_DAYS(dt) ) (
|
||||
PARTITION rx2009xx VALUES LESS THAN( TO_DAYS('2010-01-01 00:00:00') ),
|
||||
PARTITION rx201001 VALUES LESS THAN( TO_DAYS('2010-02-01 00:00:00') ),
|
||||
PARTITION rx201002 VALUES LESS THAN( TO_DAYS('2010-03-01 00:00:00') ),
|
||||
PARTITION rx201003 VALUES LESS THAN( TO_DAYS('2010-04-01 00:00:00') ),
|
||||
PARTITION rx201004 VALUES LESS THAN( TO_DAYS('2010-05-01 00:00:00') ),
|
||||
PARTITION rx201005 VALUES LESS THAN( TO_DAYS('2010-06-01 00:00:00') ),
|
||||
PARTITION rx201006 VALUES LESS THAN( TO_DAYS('2010-07-01 00:00:00') ),
|
||||
PARTITION rx201007 VALUES LESS THAN( TO_DAYS('2010-08-01 00:00:00') ),
|
||||
PARTITION rx201008 VALUES LESS THAN( TO_DAYS('2010-09-01 00:00:00') ),
|
||||
PARTITION rx201009 VALUES LESS THAN( TO_DAYS('2010-10-01 00:00:00') ),
|
||||
PARTITION rx201010 VALUES LESS THAN( TO_DAYS('2010-11-01 00:00:00') ),
|
||||
PARTITION rx201011 VALUES LESS THAN( TO_DAYS('2010-12-01 00:00:00') ),
|
||||
PARTITION rx201012 VALUES LESS THAN( TO_DAYS('2011-01-01 00:00:00') ),
|
||||
PARTITION rx2011 VALUES LESS THAN MAXVALUE);
|
||||
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE p1 (repeat_count int)
|
||||
BEGIN
|
||||
DECLARE current_num int;
|
||||
SET current_num = 0;
|
||||
WHILE current_num < repeat_count do
|
||||
INSERT INTO t1 VALUES (NULL, '2010-10-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2010-02-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2010-03-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2010-04-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2010-06-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2010-10-21 00:00:00');
|
||||
INSERT INTO t1 VALUES (NULL, '2012-02-21 00:00:00');
|
||||
COMMIT;
|
||||
SET current_num = current_num + 1;
|
||||
END WHILE;
|
||||
END|
|
||||
DELIMITER ;|
|
||||
|
||||
insert into t1 (id, dt) values (1, '2010-01-02 00:00:00');
|
||||
insert into t1 (id, dt) values (2, '2010-01-03 00:00:00');
|
||||
insert into t1 (id, dt) values (3, '2010-01-04 00:00:00');
|
||||
insert into t1 (id, dt) values (4, '2010-01-05 00:00:00');
|
||||
insert into t1 (id, dt) values (5, '2010-01-06 00:00:00');
|
||||
insert into t1 (id, dt) values (6, '2010-01-07 00:00:00');
|
||||
insert into t1 (id, dt) values (7, '2010-01-08 00:00:00');
|
||||
insert into t1 (id, dt) values (8, '2010-01-09 00:00:00');
|
||||
insert into t1 (id, dt) values (9, '2010-01-10 00:00:00');
|
||||
insert into t1 (id, dt) values (10, '2010-01-11 00:00:00');
|
||||
insert into t1 (id, dt) values (11, '2010-01-12 00:00:00');
|
||||
insert into t1 (id, dt) values (12, '2010-01-13 00:00:00');
|
||||
insert into t1 (id, dt) values (13, '2010-01-14 00:00:00');
|
||||
insert into t1 (id, dt) values (14, '2010-01-15 00:00:00');
|
||||
insert into t1 (id, dt) values (15, '2010-01-16 00:00:00');
|
||||
insert into t1 (id, dt) values (16, '2010-01-17 00:00:00');
|
||||
insert into t1 (id, dt) values (17, '2010-01-18 00:00:00');
|
||||
insert into t1 (id, dt) values (18, '2010-01-19 00:00:00');
|
||||
insert into t1 (id, dt) values (19, '2010-01-20 00:00:00');
|
||||
insert into t1 (id, dt) values (20, '2010-01-21 00:00:00');
|
||||
insert into t1 (id, dt) values (21, '2010-01-22 00:00:00');
|
||||
insert into t1 (id, dt) values (22, '2010-01-23 00:00:00');
|
||||
insert into t1 (id, dt) values (23, '2010-01-24 00:00:00');
|
||||
insert into t1 (id, dt) values (24, '2010-01-25 00:00:00');
|
||||
insert into t1 (id, dt) values (25, '2010-01-26 00:00:00');
|
||||
insert into t1 (id, dt) values (26, '2010-01-27 00:00:00');
|
||||
insert into t1 (id, dt) values (27, '2010-01-28 00:00:00');
|
||||
insert into t1 (id, dt) values (28, '2010-01-29 00:00:00');
|
||||
insert into t1 (id, dt) values (29, '2010-01-30 00:00:00');
|
||||
insert into t1 (id, dt) values (30, '2010-01-31 00:00:00');
|
||||
insert into t1 (id, dt) values (31, '2010-02-01 00:00:00');
|
||||
insert into t1 (id, dt) values (32, '2010-02-02 00:00:00');
|
||||
insert into t1 (id, dt) values (33, '2010-02-03 00:00:00');
|
||||
insert into t1 (id, dt) values (34, '2010-02-04 00:00:00');
|
||||
insert into t1 (id, dt) values (35, '2010-02-05 00:00:00');
|
||||
insert into t1 (id, dt) values (36, '2010-02-06 00:00:00');
|
||||
insert into t1 (id, dt) values (37, '2010-02-07 00:00:00');
|
||||
insert into t1 (id, dt) values (38, '2010-02-08 00:00:00');
|
||||
insert into t1 (id, dt) values (39, '2010-02-09 00:00:00');
|
||||
insert into t1 (id, dt) values (40, '2010-02-10 00:00:00');
|
||||
insert into t1 (id, dt) values (41, '2010-02-11 00:00:00');
|
||||
insert into t1 (id, dt) values (42, '2010-02-12 00:00:00');
|
||||
insert into t1 (id, dt) values (43, '2010-02-13 00:00:00');
|
||||
insert into t1 (id, dt) values (44, '2010-02-14 00:00:00');
|
||||
insert into t1 (id, dt) values (45, '2010-02-15 00:00:00');
|
||||
insert into t1 (id, dt) values (46, '2010-02-16 00:00:00');
|
||||
insert into t1 (id, dt) values (47, '2010-02-17 00:00:00');
|
||||
insert into t1 (id, dt) values (48, '2010-02-18 00:00:00');
|
||||
insert into t1 (id, dt) values (49, '2010-02-19 00:00:00');
|
||||
insert into t1 (id, dt) values (50, '2010-02-20 00:00:00');
|
||||
insert into t1 (id, dt) values (51, '2010-02-21 00:00:00');
|
||||
insert into t1 (id, dt) values (52, '2010-02-22 00:00:00');
|
||||
insert into t1 (id, dt) values (53, '2010-02-23 00:00:00');
|
||||
insert into t1 (id, dt) values (54, '2010-02-24 00:00:00');
|
||||
insert into t1 (id, dt) values (55, '2010-02-25 00:00:00');
|
||||
insert into t1 (id, dt) values (56, '2010-02-26 00:00:00');
|
||||
insert into t1 (id, dt) values (57, '2010-02-27 00:00:00');
|
||||
insert into t1 (id, dt) values (58, '2010-02-28 00:00:00');
|
||||
insert into t1 (id, dt) values (59, '2010-03-01 00:00:00');
|
||||
insert into t1 (id, dt) values (60, '2010-03-02 00:00:00');
|
||||
insert into t1 (id, dt) values (61, '2010-03-03 00:00:00');
|
||||
insert into t1 (id, dt) values (62, '2010-03-04 00:00:00');
|
||||
insert into t1 (id, dt) values (63, '2010-03-05 00:00:00');
|
||||
insert into t1 (id, dt) values (64, '2010-03-06 00:00:00');
|
||||
insert into t1 (id, dt) values (65, '2010-03-07 00:00:00');
|
||||
insert into t1 (id, dt) values (66, '2010-03-08 00:00:00');
|
||||
insert into t1 (id, dt) values (67, '2010-03-09 00:00:00');
|
||||
insert into t1 (id, dt) values (68, '2010-03-10 00:00:00');
|
||||
insert into t1 (id, dt) values (69, '2010-03-11 00:00:00');
|
||||
insert into t1 (id, dt) values (70, '2010-03-12 00:00:00');
|
||||
insert into t1 (id, dt) values (71, '2010-03-13 00:00:00');
|
||||
insert into t1 (id, dt) values (72, '2010-03-14 00:00:00');
|
||||
insert into t1 (id, dt) values (73, '2010-03-15 00:00:00');
|
||||
insert into t1 (id, dt) values (74, '2010-03-16 00:00:00');
|
||||
insert into t1 (id, dt) values (75, '2010-03-17 00:00:00');
|
||||
insert into t1 (id, dt) values (76, '2010-03-18 00:00:00');
|
||||
insert into t1 (id, dt) values (77, '2010-03-19 00:00:00');
|
||||
insert into t1 (id, dt) values (78, '2010-03-20 00:00:00');
|
||||
insert into t1 (id, dt) values (79, '2010-03-21 00:00:00');
|
||||
insert into t1 (id, dt) values (80, '2010-03-22 00:00:00');
|
||||
insert into t1 (id, dt) values (81, '2010-03-23 00:00:00');
|
||||
insert into t1 (id, dt) values (82, '2010-03-24 00:00:00');
|
||||
insert into t1 (id, dt) values (83, '2010-03-25 00:00:00');
|
||||
insert into t1 (id, dt) values (84, '2010-03-26 00:00:00');
|
||||
insert into t1 (id, dt) values (85, '2010-03-27 00:00:00');
|
||||
insert into t1 (id, dt) values (86, '2010-03-28 00:00:00');
|
||||
insert into t1 (id, dt) values (87, '2010-03-29 00:00:00');
|
||||
insert into t1 (id, dt) values (88, '2010-03-30 00:00:00');
|
||||
insert into t1 (id, dt) values (89, '2010-03-31 00:00:00');
|
||||
insert into t1 (id, dt) values (90, '2010-04-01 00:00:00');
|
||||
insert into t1 (id, dt) values (91, '2010-04-02 00:00:00');
|
||||
insert into t1 (id, dt) values (92, '2010-04-03 00:00:00');
|
||||
insert into t1 (id, dt) values (93, '2010-04-04 00:00:00');
|
||||
insert into t1 (id, dt) values (94, '2010-04-05 00:00:00');
|
||||
insert into t1 (id, dt) values (95, '2010-04-06 00:00:00');
|
||||
insert into t1 (id, dt) values (96, '2010-04-07 00:00:00');
|
||||
insert into t1 (id, dt) values (97, '2010-04-08 00:00:00');
|
||||
insert into t1 (id, dt) values (98, '2010-04-09 00:00:00');
|
||||
insert into t1 (id, dt) values (99, '2010-04-10 00:00:00');
|
||||
insert into t1 (id, dt) values (100, '2010-04-11 00:00:00');
|
||||
insert into t1 (id, dt) values (101, '2010-04-12 00:00:00');
|
||||
insert into t1 (id, dt) values (102, '2010-04-13 00:00:00');
|
||||
insert into t1 (id, dt) values (103, '2010-04-14 00:00:00');
|
||||
insert into t1 (id, dt) values (104, '2010-04-15 00:00:00');
|
||||
insert into t1 (id, dt) values (105, '2010-04-16 00:00:00');
|
||||
insert into t1 (id, dt) values (106, '2010-04-17 00:00:00');
|
||||
insert into t1 (id, dt) values (107, '2010-04-18 00:00:00');
|
||||
insert into t1 (id, dt) values (108, '2010-04-19 00:00:00');
|
||||
insert into t1 (id, dt) values (109, '2010-04-20 00:00:00');
|
||||
insert into t1 (id, dt) values (110, '2010-04-21 00:00:00');
|
||||
insert into t1 (id, dt) values (111, '2010-04-22 00:00:00');
|
||||
insert into t1 (id, dt) values (112, '2010-04-23 00:00:00');
|
||||
insert into t1 (id, dt) values (113, '2010-04-24 00:00:00');
|
||||
insert into t1 (id, dt) values (114, '2010-04-25 00:00:00');
|
||||
insert into t1 (id, dt) values (115, '2010-04-26 00:00:00');
|
||||
insert into t1 (id, dt) values (116, '2010-04-27 00:00:00');
|
||||
insert into t1 (id, dt) values (117, '2010-04-28 00:00:00');
|
||||
insert into t1 (id, dt) values (118, '2010-04-29 00:00:00');
|
||||
insert into t1 (id, dt) values (119, '2010-04-30 00:00:00');
|
||||
insert into t1 (id, dt) values (120, '2010-05-01 00:00:00');
|
||||
insert into t1 (id, dt) values (121, '2010-05-02 00:00:00');
|
||||
insert into t1 (id, dt) values (122, '2010-05-03 00:00:00');
|
||||
insert into t1 (id, dt) values (123, '2010-05-04 00:00:00');
|
||||
insert into t1 (id, dt) values (124, '2010-05-05 00:00:00');
|
||||
insert into t1 (id, dt) values (125, '2010-05-06 00:00:00');
|
||||
insert into t1 (id, dt) values (126, '2010-05-07 00:00:00');
|
||||
insert into t1 (id, dt) values (127, '2010-05-08 00:00:00');
|
||||
insert into t1 (id, dt) values (128, '2010-05-09 00:00:00');
|
||||
insert into t1 (id, dt) values (129, '2010-05-10 00:00:00');
|
||||
insert into t1 (id, dt) values (130, '2010-05-11 00:00:00');
|
||||
insert into t1 (id, dt) values (131, '2010-05-12 00:00:00');
|
||||
insert into t1 (id, dt) values (132, '2010-05-13 00:00:00');
|
||||
insert into t1 (id, dt) values (133, '2010-05-14 00:00:00');
|
||||
insert into t1 (id, dt) values (134, '2010-05-15 00:00:00');
|
||||
insert into t1 (id, dt) values (135, '2010-05-16 00:00:00');
|
||||
insert into t1 (id, dt) values (136, '2010-05-17 00:00:00');
|
||||
insert into t1 (id, dt) values (137, '2010-05-18 00:00:00');
|
||||
insert into t1 (id, dt) values (138, '2010-05-19 00:00:00');
|
||||
insert into t1 (id, dt) values (139, '2010-05-20 00:00:00');
|
||||
insert into t1 (id, dt) values (140, '2010-05-21 00:00:00');
|
||||
insert into t1 (id, dt) values (141, '2010-05-22 00:00:00');
|
||||
insert into t1 (id, dt) values (142, '2010-05-23 00:00:00');
|
||||
insert into t1 (id, dt) values (143, '2010-05-24 00:00:00');
|
||||
insert into t1 (id, dt) values (144, '2010-05-25 00:00:00');
|
||||
insert into t1 (id, dt) values (145, '2010-05-26 00:00:00');
|
||||
insert into t1 (id, dt) values (146, '2010-05-27 00:00:00');
|
||||
insert into t1 (id, dt) values (147, '2010-05-28 00:00:00');
|
||||
insert into t1 (id, dt) values (148, '2010-05-29 00:00:00');
|
||||
insert into t1 (id, dt) values (149, '2010-05-30 00:00:00');
|
||||
insert into t1 (id, dt) values (150, '2010-05-31 00:00:00');
|
||||
insert into t1 (id, dt) values (151, '2010-06-01 00:00:00');
|
||||
insert into t1 (id, dt) values (152, '2010-06-02 00:00:00');
|
||||
insert into t1 (id, dt) values (153, '2010-06-03 00:00:00');
|
||||
insert into t1 (id, dt) values (154, '2010-06-04 00:00:00');
|
||||
insert into t1 (id, dt) values (155, '2010-06-05 00:00:00');
|
||||
insert into t1 (id, dt) values (156, '2010-06-06 00:00:00');
|
||||
insert into t1 (id, dt) values (157, '2010-06-07 00:00:00');
|
||||
insert into t1 (id, dt) values (158, '2010-06-08 00:00:00');
|
||||
insert into t1 (id, dt) values (159, '2010-06-09 00:00:00');
|
||||
insert into t1 (id, dt) values (160, '2010-06-10 00:00:00');
|
||||
insert into t1 (id, dt) values (161, '2010-06-11 00:00:00');
|
||||
insert into t1 (id, dt) values (162, '2010-06-12 00:00:00');
|
||||
insert into t1 (id, dt) values (163, '2010-06-13 00:00:00');
|
||||
insert into t1 (id, dt) values (164, '2010-06-14 00:00:00');
|
||||
insert into t1 (id, dt) values (165, '2010-06-15 00:00:00');
|
||||
insert into t1 (id, dt) values (166, '2010-06-16 00:00:00');
|
||||
insert into t1 (id, dt) values (167, '2010-06-17 00:00:00');
|
||||
insert into t1 (id, dt) values (168, '2010-06-18 00:00:00');
|
||||
insert into t1 (id, dt) values (169, '2010-06-19 00:00:00');
|
||||
insert into t1 (id, dt) values (170, '2010-06-20 00:00:00');
|
||||
insert into t1 (id, dt) values (171, '2010-06-21 00:00:00');
|
||||
insert into t1 (id, dt) values (172, '2010-06-22 00:00:00');
|
||||
insert into t1 (id, dt) values (173, '2010-06-23 00:00:00');
|
||||
insert into t1 (id, dt) values (174, '2010-06-24 00:00:00');
|
||||
insert into t1 (id, dt) values (175, '2010-06-25 00:00:00');
|
||||
insert into t1 (id, dt) values (176, '2010-06-26 00:00:00');
|
||||
insert into t1 (id, dt) values (177, '2010-06-27 00:00:00');
|
||||
insert into t1 (id, dt) values (178, '2010-06-28 00:00:00');
|
||||
insert into t1 (id, dt) values (179, '2010-06-29 00:00:00');
|
||||
insert into t1 (id, dt) values (180, '2010-06-30 00:00:00');
|
||||
insert into t1 (id, dt) values (181, '2010-07-01 00:00:00');
|
||||
insert into t1 (id, dt) values (182, '2010-07-02 00:00:00');
|
||||
insert into t1 (id, dt) values (183, '2010-07-03 00:00:00');
|
||||
insert into t1 (id, dt) values (184, '2010-07-04 00:00:00');
|
||||
insert into t1 (id, dt) values (185, '2010-07-05 00:00:00');
|
||||
insert into t1 (id, dt) values (186, '2010-07-06 00:00:00');
|
||||
insert into t1 (id, dt) values (187, '2010-07-07 00:00:00');
|
||||
insert into t1 (id, dt) values (188, '2010-07-08 00:00:00');
|
||||
insert into t1 (id, dt) values (189, '2010-07-09 00:00:00');
|
||||
insert into t1 (id, dt) values (190, '2010-07-10 00:00:00');
|
||||
insert into t1 (id, dt) values (191, '2010-07-11 00:00:00');
|
||||
insert into t1 (id, dt) values (192, '2010-07-12 00:00:00');
|
||||
insert into t1 (id, dt) values (193, '2010-07-13 00:00:00');
|
||||
insert into t1 (id, dt) values (194, '2010-07-14 00:00:00');
|
||||
insert into t1 (id, dt) values (195, '2010-07-15 00:00:00');
|
||||
insert into t1 (id, dt) values (196, '2010-07-16 00:00:00');
|
||||
insert into t1 (id, dt) values (197, '2010-07-17 00:00:00');
|
||||
insert into t1 (id, dt) values (198, '2010-07-18 00:00:00');
|
||||
insert into t1 (id, dt) values (199, '2010-07-19 00:00:00');
|
||||
insert into t1 (id, dt) values (200, '2010-07-20 00:00:00');
|
||||
insert into t1 (id, dt) values (201, '2010-07-21 00:00:00');
|
||||
insert into t1 (id, dt) values (202, '2010-07-22 00:00:00');
|
||||
insert into t1 (id, dt) values (203, '2010-07-23 00:00:00');
|
||||
insert into t1 (id, dt) values (204, '2010-07-24 00:00:00');
|
||||
insert into t1 (id, dt) values (205, '2010-07-25 00:00:00');
|
||||
insert into t1 (id, dt) values (206, '2010-07-26 00:00:00');
|
||||
insert into t1 (id, dt) values (207, '2010-07-27 00:00:00');
|
||||
insert into t1 (id, dt) values (208, '2010-07-28 00:00:00');
|
||||
insert into t1 (id, dt) values (209, '2010-07-29 00:00:00');
|
||||
insert into t1 (id, dt) values (210, '2010-07-30 00:00:00');
|
||||
insert into t1 (id, dt) values (211, '2010-07-31 00:00:00');
|
||||
insert into t1 (id, dt) values (212, '2010-08-01 00:00:00');
|
||||
insert into t1 (id, dt) values (213, '2010-08-02 00:00:00');
|
||||
insert into t1 (id, dt) values (214, '2010-08-03 00:00:00');
|
||||
insert into t1 (id, dt) values (215, '2010-08-04 00:00:00');
|
||||
insert into t1 (id, dt) values (216, '2010-08-05 00:00:00');
|
||||
insert into t1 (id, dt) values (217, '2010-08-06 00:00:00');
|
||||
insert into t1 (id, dt) values (218, '2010-08-07 00:00:00');
|
||||
insert into t1 (id, dt) values (219, '2010-08-08 00:00:00');
|
||||
insert into t1 (id, dt) values (220, '2010-08-09 00:00:00');
|
||||
insert into t1 (id, dt) values (221, '2010-08-10 00:00:00');
|
||||
insert into t1 (id, dt) values (222, '2010-08-11 00:00:00');
|
||||
insert into t1 (id, dt) values (223, '2010-08-12 00:00:00');
|
||||
insert into t1 (id, dt) values (224, '2010-08-13 00:00:00');
|
||||
insert into t1 (id, dt) values (225, '2010-08-14 00:00:00');
|
||||
insert into t1 (id, dt) values (226, '2010-08-15 00:00:00');
|
||||
insert into t1 (id, dt) values (227, '2010-08-16 00:00:00');
|
||||
insert into t1 (id, dt) values (228, '2010-08-17 00:00:00');
|
||||
insert into t1 (id, dt) values (229, '2010-08-18 00:00:00');
|
||||
insert into t1 (id, dt) values (230, '2010-08-19 00:00:00');
|
||||
insert into t1 (id, dt) values (231, '2010-08-20 00:00:00');
|
||||
insert into t1 (id, dt) values (232, '2010-08-21 00:00:00');
|
||||
insert into t1 (id, dt) values (233, '2010-08-22 00:00:00');
|
||||
insert into t1 (id, dt) values (234, '2010-08-23 00:00:00');
|
||||
insert into t1 (id, dt) values (235, '2010-08-24 00:00:00');
|
||||
insert into t1 (id, dt) values (236, '2010-08-25 00:00:00');
|
||||
insert into t1 (id, dt) values (237, '2010-08-26 00:00:00');
|
||||
insert into t1 (id, dt) values (238, '2010-08-27 00:00:00');
|
||||
insert into t1 (id, dt) values (239, '2010-08-28 00:00:00');
|
||||
insert into t1 (id, dt) values (240, '2010-08-29 00:00:00');
|
||||
insert into t1 (id, dt) values (241, '2010-08-30 00:00:00');
|
||||
insert into t1 (id, dt) values (242, '2010-08-31 00:00:00');
|
||||
insert into t1 (id, dt) values (243, '2010-09-01 00:00:00');
|
||||
insert into t1 (id, dt) values (244, '2010-09-02 00:00:00');
|
||||
insert into t1 (id, dt) values (245, '2010-09-03 00:00:00');
|
||||
insert into t1 (id, dt) values (246, '2010-09-04 00:00:00');
|
||||
insert into t1 (id, dt) values (247, '2010-09-05 00:00:00');
|
||||
insert into t1 (id, dt) values (248, '2010-09-06 00:00:00');
|
||||
insert into t1 (id, dt) values (249, '2010-09-07 00:00:00');
|
||||
insert into t1 (id, dt) values (250, '2010-09-08 00:00:00');
|
||||
insert into t1 (id, dt) values (251, '2010-09-09 00:00:00');
|
||||
insert into t1 (id, dt) values (252, '2010-09-10 00:00:00');
|
||||
insert into t1 (id, dt) values (253, '2010-09-11 00:00:00');
|
||||
insert into t1 (id, dt) values (254, '2010-09-12 00:00:00');
|
||||
insert into t1 (id, dt) values (255, '2010-09-13 00:00:00');
|
||||
insert into t1 (id, dt) values (256, '2010-09-14 00:00:00');
|
||||
insert into t1 (id, dt) values (257, '2010-09-15 00:00:00');
|
||||
insert into t1 (id, dt) values (258, '2010-09-16 00:00:00');
|
||||
insert into t1 (id, dt) values (259, '2010-09-17 00:00:00');
|
||||
insert into t1 (id, dt) values (260, '2010-09-18 00:00:00');
|
||||
insert into t1 (id, dt) values (261, '2010-09-19 00:00:00');
|
||||
insert into t1 (id, dt) values (262, '2010-09-20 00:00:00');
|
||||
insert into t1 (id, dt) values (263, '2010-09-21 00:00:00');
|
||||
insert into t1 (id, dt) values (264, '2010-09-22 00:00:00');
|
||||
insert into t1 (id, dt) values (265, '2010-09-23 00:00:00');
|
||||
insert into t1 (id, dt) values (266, '2010-09-24 00:00:00');
|
||||
insert into t1 (id, dt) values (267, '2010-09-25 00:00:00');
|
||||
insert into t1 (id, dt) values (268, '2010-09-26 00:00:00');
|
||||
insert into t1 (id, dt) values (269, '2010-09-27 00:00:00');
|
||||
insert into t1 (id, dt) values (270, '2010-09-28 00:00:00');
|
||||
insert into t1 (id, dt) values (271, '2010-09-29 00:00:00');
|
||||
insert into t1 (id, dt) values (272, '2010-09-30 00:00:00');
|
||||
insert into t1 (id, dt) values (273, '2010-10-01 00:00:00');
|
||||
insert into t1 (id, dt) values (274, '2010-10-02 00:00:00');
|
||||
insert into t1 (id, dt) values (275, '2010-10-03 00:00:00');
|
||||
insert into t1 (id, dt) values (276, '2010-10-04 00:00:00');
|
||||
insert into t1 (id, dt) values (277, '2010-10-05 00:00:00');
|
||||
insert into t1 (id, dt) values (278, '2010-10-06 00:00:00');
|
||||
insert into t1 (id, dt) values (279, '2010-10-07 00:00:00');
|
||||
insert into t1 (id, dt) values (280, '2010-10-08 00:00:00');
|
||||
insert into t1 (id, dt) values (281, '2010-10-09 00:00:00');
|
||||
insert into t1 (id, dt) values (282, '2010-10-10 00:00:00');
|
||||
insert into t1 (id, dt) values (283, '2010-10-11 00:00:00');
|
||||
insert into t1 (id, dt) values (284, '2010-10-12 00:00:00');
|
||||
insert into t1 (id, dt) values (285, '2010-10-13 00:00:00');
|
||||
insert into t1 (id, dt) values (286, '2010-10-14 00:00:00');
|
||||
insert into t1 (id, dt) values (287, '2010-10-15 00:00:00');
|
||||
insert into t1 (id, dt) values (288, '2010-10-16 00:00:00');
|
||||
insert into t1 (id, dt) values (289, '2010-10-17 00:00:00');
|
||||
insert into t1 (id, dt) values (290, '2010-10-18 00:00:00');
|
||||
insert into t1 (id, dt) values (291, '2010-10-19 00:00:00');
|
||||
insert into t1 (id, dt) values (292, '2010-10-20 00:00:00');
|
||||
insert into t1 (id, dt) values (293, '2010-10-21 00:00:00');
|
||||
insert into t1 (id, dt) values (294, '2010-10-22 00:00:00');
|
||||
insert into t1 (id, dt) values (295, '2010-10-23 00:00:00');
|
||||
insert into t1 (id, dt) values (296, '2010-10-24 00:00:00');
|
||||
insert into t1 (id, dt) values (297, '2010-10-25 00:00:00');
|
||||
insert into t1 (id, dt) values (298, '2010-10-26 00:00:00');
|
||||
insert into t1 (id, dt) values (299, '2010-10-27 00:00:00');
|
||||
insert into t1 (id, dt) values (300, '2010-10-28 00:00:00');
|
||||
insert into t1 (id, dt) values (301, '2010-10-29 00:00:00');
|
||||
insert into t1 (id, dt) values (302, '2010-10-30 00:00:00');
|
||||
insert into t1 (id, dt) values (303, '2010-10-31 00:00:00');
|
||||
insert into t1 (id, dt) values (304, '2010-11-01 00:00:00');
|
||||
insert into t1 (id, dt) values (305, '2010-11-02 00:00:00');
|
||||
insert into t1 (id, dt) values (306, '2010-11-03 00:00:00');
|
||||
insert into t1 (id, dt) values (307, '2010-11-04 00:00:00');
|
||||
insert into t1 (id, dt) values (308, '2010-11-05 00:00:00');
|
||||
insert into t1 (id, dt) values (309, '2010-11-06 00:00:00');
|
||||
insert into t1 (id, dt) values (310, '2010-11-07 00:00:00');
|
||||
insert into t1 (id, dt) values (311, '2010-11-08 00:00:00');
|
||||
insert into t1 (id, dt) values (312, '2010-11-09 00:00:00');
|
||||
insert into t1 (id, dt) values (313, '2010-11-10 00:00:00');
|
||||
insert into t1 (id, dt) values (314, '2010-11-11 00:00:00');
|
||||
insert into t1 (id, dt) values (315, '2010-11-12 00:00:00');
|
||||
insert into t1 (id, dt) values (316, '2010-11-13 00:00:00');
|
||||
insert into t1 (id, dt) values (317, '2010-11-14 00:00:00');
|
||||
insert into t1 (id, dt) values (318, '2010-11-15 00:00:00');
|
||||
insert into t1 (id, dt) values (319, '2010-11-16 00:00:00');
|
||||
insert into t1 (id, dt) values (320, '2010-11-17 00:00:00');
|
||||
insert into t1 (id, dt) values (321, '2010-11-18 00:00:00');
|
||||
insert into t1 (id, dt) values (322, '2010-11-19 00:00:00');
|
||||
insert into t1 (id, dt) values (323, '2010-11-20 00:00:00');
|
||||
insert into t1 (id, dt) values (324, '2010-11-21 00:00:00');
|
||||
insert into t1 (id, dt) values (325, '2010-11-22 00:00:00');
|
||||
insert into t1 (id, dt) values (326, '2010-11-23 00:00:00');
|
||||
insert into t1 (id, dt) values (327, '2010-11-24 00:00:00');
|
||||
insert into t1 (id, dt) values (328, '2010-11-25 00:00:00');
|
||||
insert into t1 (id, dt) values (329, '2010-11-26 00:00:00');
|
||||
insert into t1 (id, dt) values (330, '2010-11-27 00:00:00');
|
||||
insert into t1 (id, dt) values (331, '2010-11-28 00:00:00');
|
||||
insert into t1 (id, dt) values (332, '2010-11-29 00:00:00');
|
||||
insert into t1 (id, dt) values (333, '2010-11-30 00:00:00');
|
||||
insert into t1 (id, dt) values (334, '2010-12-01 00:00:00');
|
||||
insert into t1 (id, dt) values (335, '2010-12-02 00:00:00');
|
||||
insert into t1 (id, dt) values (336, '2010-12-03 00:00:00');
|
||||
insert into t1 (id, dt) values (337, '2010-12-04 00:00:00');
|
||||
insert into t1 (id, dt) values (338, '2010-12-05 00:00:00');
|
||||
insert into t1 (id, dt) values (339, '2010-12-06 00:00:00');
|
||||
insert into t1 (id, dt) values (340, '2010-12-07 00:00:00');
|
||||
insert into t1 (id, dt) values (341, '2010-12-08 00:00:00');
|
||||
insert into t1 (id, dt) values (342, '2010-12-09 00:00:00');
|
||||
insert into t1 (id, dt) values (343, '2010-12-10 00:00:00');
|
||||
insert into t1 (id, dt) values (344, '2010-12-11 00:00:00');
|
||||
insert into t1 (id, dt) values (345, '2010-12-12 00:00:00');
|
||||
insert into t1 (id, dt) values (346, '2010-12-13 00:00:00');
|
||||
insert into t1 (id, dt) values (347, '2010-12-14 00:00:00');
|
||||
insert into t1 (id, dt) values (348, '2010-12-15 00:00:00');
|
||||
insert into t1 (id, dt) values (349, '2010-12-16 00:00:00');
|
||||
insert into t1 (id, dt) values (350, '2010-12-17 00:00:00');
|
||||
|
||||
SELECT COUNT(*) FROM t1;
|
||||
|
||||
--connection node_2
|
||||
--send call p1(100);
|
||||
|
||||
--connection node_1a
|
||||
--send call p1(100);
|
||||
|
||||
--connection node_3
|
||||
--send call p1(100);
|
||||
|
||||
--connection node_4
|
||||
--send call p1(100);
|
||||
|
||||
--connection node_1
|
||||
SET SESSION wsrep_OSU_method='RSU';
|
||||
SELECT @@wsrep_OSU_method;
|
||||
SET SESSION sql_log_bin = 0;
|
||||
|
||||
--error 0,ER_LOCK_DEADLOCK
|
||||
ALTER TABLE t1 DROP PARTITION rx2009xx;
|
||||
--error 0,ER_LOCK_DEADLOCK
|
||||
ALTER TABLE t1 DROP PARTITION rx201004;
|
||||
--error 0,ER_LOCK_DEADLOCK
|
||||
ALTER TABLE t1 DROP PARTITION rx201008;
|
||||
|
||||
SET SESSION wsrep_OSU_METHOD='TOI';
|
||||
SELECT @@wsrep_OSU_method;
|
||||
|
||||
--connection node_2
|
||||
--error 0,ER_LOCK_DEADLOCK
|
||||
reap;
|
||||
|
||||
--connection node_3
|
||||
--error 0,ER_LOCK_DEADLOCK
|
||||
reap;
|
||||
|
||||
--connection node_4
|
||||
--error 0,ER_LOCK_DEADLOCK
|
||||
reap;
|
||||
|
||||
--connection node_1a
|
||||
--error 0,ER_LOCK_DEADLOCK
|
||||
reap;
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
SET @save_enabled= @@GLOBAL.innodb_cmp_per_index_enabled;
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
SELECT * FROM information_schema.innodb_cmp_per_index;
|
||||
CREATE TABLE t (
|
||||
|
@ -72,33 +71,5 @@ index_name PRIMARY
|
|||
compress_ops 65
|
||||
compress_ops_ok 65
|
||||
uncompress_ops 0
|
||||
SHOW CREATE TABLE t;
|
||||
Table t
|
||||
Create Table CREATE TABLE `t` (
|
||||
`a` int(11) NOT NULL,
|
||||
`b` varchar(512) DEFAULT NULL,
|
||||
`c` varchar(16) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`),
|
||||
KEY `b` (`b`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
SELECT COUNT(*) FROM t IGNORE INDEX(b);
|
||||
COUNT(*) 128
|
||||
SELECT
|
||||
database_name,
|
||||
table_name,
|
||||
index_name,
|
||||
compress_ops,
|
||||
compress_ops_ok,
|
||||
CASE WHEN uncompress_ops=6 and @@innodb_compression_level IN (4,8,9) THEN 9
|
||||
ELSE uncompress_ops END as uncompress_ops
|
||||
FROM information_schema.innodb_cmp_per_index
|
||||
ORDER BY 1, 2, 3;
|
||||
database_name test
|
||||
table_name t
|
||||
index_name PRIMARY
|
||||
compress_ops 0
|
||||
compress_ops_ok 0
|
||||
uncompress_ops 4
|
||||
DROP TABLE t;
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=default;
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=@save_enabled;
|
||||
|
|
|
@ -19,12 +19,9 @@ if (`SELECT @@innodb_log_compressed_pages = 0`)
|
|||
# include/restart_mysqld.inc does not work in embedded mode
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# ensure that all history gets purged on shutdown
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
|
||||
-- vertical_results
|
||||
|
||||
SET @save_enabled= @@GLOBAL.innodb_cmp_per_index_enabled;
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
|
||||
# reset any leftover stats from previous tests
|
||||
|
@ -96,29 +93,6 @@ ELSE compress_ops_ok END as compress_ops_ok,
|
|||
uncompress_ops
|
||||
FROM information_schema.innodb_cmp_per_index
|
||||
ORDER BY 1, 2, 3;
|
||||
|
||||
# restart mysqld and see that uncompress ops also gets increased when
|
||||
# selecting from the table again
|
||||
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
SHOW CREATE TABLE t;
|
||||
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
|
||||
SELECT COUNT(*) FROM t IGNORE INDEX(b);
|
||||
|
||||
SELECT
|
||||
database_name,
|
||||
table_name,
|
||||
index_name,
|
||||
compress_ops,
|
||||
compress_ops_ok,
|
||||
CASE WHEN uncompress_ops=6 and @@innodb_compression_level IN (4,8,9) THEN 9
|
||||
ELSE uncompress_ops END as uncompress_ops
|
||||
FROM information_schema.innodb_cmp_per_index
|
||||
ORDER BY 1, 2, 3;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=default;
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=@save_enabled;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
--loose-innodb-log-file-size=1048576 --loose-innodb-log-files-in-group=2
|
|
@ -0,0 +1,2 @@
|
|||
CREATE TABLE t(i INT) ENGINE=INNODB;
|
||||
DROP TABLE t;
|
20
mysql-test/suite/mariabackup/innodb_redo_log_overwrite.test
Normal file
20
mysql-test/suite/mariabackup/innodb_redo_log_overwrite.test
Normal file
|
@ -0,0 +1,20 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_sequence.inc
|
||||
|
||||
CREATE TABLE t(i INT) ENGINE=INNODB;
|
||||
|
||||
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
|
||||
|
||||
# Generate enough redo log records to make at least one loop in log group
|
||||
--let before_innodb_log_copy_thread_started=INSERT INTO test.t SELECT * from test.seq_1_to_102400
|
||||
|
||||
--disable_result_log
|
||||
# mariabackup must exit with error instead of hanging
|
||||
--error 1
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events;
|
||||
--enable_result_log
|
||||
|
||||
DROP TABLE t;
|
||||
--rmdir $targetdir
|
||||
|
|
@ -50,5 +50,3 @@ COUNT(@@GLOBAL.innodb_buffer_pool_size)
|
|||
1 Expected
|
||||
SELECT innodb_buffer_pool_size = @@SESSION.innodb_buffer_pool_size;
|
||||
ERROR 42S22: Unknown column 'innodb_buffer_pool_size' in 'field list'
|
||||
Expected error 'Readonly variable'
|
||||
SET @@GLOBAL.innodb_buffer_pool_size = @start_buffer_pool_size;
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
--disable_query_log
|
||||
if (`select (version() like '%debug%') > 0`)
|
||||
{
|
||||
set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug;
|
||||
set global innodb_disable_resize_buffer_pool_debug = OFF;
|
||||
}
|
||||
--enable_query_log
|
||||
|
@ -116,15 +115,7 @@ SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size);
|
|||
|
||||
--Error ER_BAD_FIELD_ERROR
|
||||
SELECT innodb_buffer_pool_size = @@SESSION.innodb_buffer_pool_size;
|
||||
--echo Expected error 'Readonly variable'
|
||||
|
||||
|
||||
SET @@GLOBAL.innodb_buffer_pool_size = @start_buffer_pool_size;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--disable_query_log
|
||||
if (`select (version() like '%debug%') > 0`)
|
||||
{
|
||||
set global innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
|
||||
}
|
||||
--enable_query_log
|
||||
# Restore the original buffer pool size.
|
||||
--source include/restart_mysqld.inc
|
||||
|
|
|
@ -69,6 +69,9 @@ bool init_errmessage(void)
|
|||
{
|
||||
const char **errmsgs;
|
||||
bool error= FALSE;
|
||||
const char *lang= my_default_lc_messages->errmsgs->language;
|
||||
my_bool use_english;
|
||||
|
||||
DBUG_ENTER("init_errmessage");
|
||||
|
||||
free_error_messages();
|
||||
|
@ -77,37 +80,65 @@ bool init_errmessage(void)
|
|||
|
||||
error_message_charset_info= system_charset_info;
|
||||
|
||||
/* Read messages from file. */
|
||||
if (read_texts(ERRMSG_FILE, my_default_lc_messages->errmsgs->language,
|
||||
&original_error_messages))
|
||||
use_english= !strcmp(lang, "english");
|
||||
if (!use_english)
|
||||
{
|
||||
/*
|
||||
No error messages. Create a temporary empty error message so
|
||||
that we don't get a crash if some code wrongly tries to access
|
||||
a non existing error message.
|
||||
*/
|
||||
if (!(original_error_messages= (const char***)
|
||||
my_malloc(MAX_ERROR_RANGES * sizeof(char**) +
|
||||
(ERRORS_PER_RANGE * sizeof(char*)),
|
||||
MYF(0))))
|
||||
DBUG_RETURN(TRUE);
|
||||
errmsgs= (const char**) (original_error_messages + MAX_ERROR_RANGES);
|
||||
|
||||
for (uint i=0 ; i < MAX_ERROR_RANGES ; i++)
|
||||
{
|
||||
original_error_messages[i]= errmsgs;
|
||||
errors_per_range[i]= ERRORS_PER_RANGE;
|
||||
}
|
||||
errors_per_range[2]= 0; // MYSYS error messages
|
||||
|
||||
for (const char **ptr= errmsgs;
|
||||
ptr < errmsgs + ERRORS_PER_RANGE ;
|
||||
ptr++)
|
||||
*ptr= "";
|
||||
|
||||
/* Read messages from file. */
|
||||
use_english= !read_texts(ERRMSG_FILE,lang, &original_error_messages);
|
||||
error= TRUE;
|
||||
}
|
||||
|
||||
if (use_english)
|
||||
{
|
||||
static const struct
|
||||
{
|
||||
const char* name;
|
||||
uint id;
|
||||
const char* fmt;
|
||||
}
|
||||
english_msgs[]=
|
||||
{
|
||||
#include <mysqld_ername.h>
|
||||
};
|
||||
|
||||
memset(errors_per_range, 0, sizeof(errors_per_range));
|
||||
/* Calculate nr of messages per range. */
|
||||
for (size_t i= 0; i < array_elements(english_msgs); i++)
|
||||
{
|
||||
uint id= english_msgs[i].id;
|
||||
|
||||
// We rely on the fact the array is sorted by id.
|
||||
DBUG_ASSERT(i == 0 || english_msgs[i-1].id < id);
|
||||
|
||||
errors_per_range[id/ERRORS_PER_RANGE-1]= id%ERRORS_PER_RANGE + 1;
|
||||
}
|
||||
|
||||
size_t all_errors= 0;
|
||||
for (size_t i= 0; i < MAX_ERROR_RANGES; i++)
|
||||
all_errors+= errors_per_range[i];
|
||||
|
||||
if (!(original_error_messages= (const char***)
|
||||
my_malloc((all_errors + MAX_ERROR_RANGES)* sizeof(void*),
|
||||
MYF(MY_ZEROFILL))))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
errmsgs= (const char**)(original_error_messages + MAX_ERROR_RANGES);
|
||||
|
||||
original_error_messages[0]= errmsgs;
|
||||
for (uint i= 1; i < MAX_ERROR_RANGES; i++)
|
||||
{
|
||||
original_error_messages[i]=
|
||||
original_error_messages[i-1] + errors_per_range[i-1];
|
||||
}
|
||||
|
||||
for (uint i= 0; i < array_elements(english_msgs); i++)
|
||||
{
|
||||
uint id= english_msgs[i].id;
|
||||
original_error_messages[id/ERRORS_PER_RANGE-1][id%ERRORS_PER_RANGE]=
|
||||
english_msgs[i].fmt;
|
||||
}
|
||||
}
|
||||
|
||||
/* Register messages for use with my_error(). */
|
||||
for (uint i=0 ; i < MAX_ERROR_RANGES ; i++)
|
||||
{
|
||||
|
|
|
@ -10318,6 +10318,8 @@ bool Item_cache_str::cache_value()
|
|||
value_buff.copy(*value);
|
||||
value= &value_buff;
|
||||
}
|
||||
else
|
||||
value_buff.copy();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -4238,10 +4238,10 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
|||
continue;
|
||||
|
||||
{
|
||||
/* Check that there's no repeating constraint names. */
|
||||
/* Check that there's no repeating table CHECK constraint names. */
|
||||
List_iterator_fast<Virtual_column_info>
|
||||
dup_it(alter_info->check_constraint_list);
|
||||
Virtual_column_info *dup_check;
|
||||
const Virtual_column_info *dup_check;
|
||||
while ((dup_check= dup_it++) && dup_check != check)
|
||||
{
|
||||
if (!lex_string_cmp(system_charset_info,
|
||||
|
@ -4253,6 +4253,27 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
|||
}
|
||||
}
|
||||
|
||||
/* Check that there's no repeating key constraint names. */
|
||||
List_iterator_fast<Key> key_it(alter_info->key_list);
|
||||
while (const Key *key= key_it++)
|
||||
{
|
||||
/*
|
||||
Not all keys considered to be the CONSTRAINT
|
||||
Noly Primary Key UNIQUE and Foreign keys.
|
||||
*/
|
||||
if (key->type != Key::PRIMARY && key->type != Key::UNIQUE &&
|
||||
key->type != Key::FOREIGN_KEY)
|
||||
continue;
|
||||
|
||||
if (check->name.length == key->name.length &&
|
||||
my_strcasecmp(system_charset_info,
|
||||
check->name.str, key->name.str) == 0)
|
||||
{
|
||||
my_error(ER_DUP_CONSTRAINT_NAME, MYF(0), "CHECK", check->name.str);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_string_char_length(&check->name, 0, NAME_CHAR_LEN,
|
||||
system_charset_info, 1))
|
||||
{
|
||||
|
@ -8497,6 +8518,35 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!alter_info->check_constraint_list.is_empty())
|
||||
{
|
||||
/* Check the table FOREIGN KEYs for name duplications. */
|
||||
List <FOREIGN_KEY_INFO> fk_child_key_list;
|
||||
FOREIGN_KEY_INFO *f_key;
|
||||
table->file->get_foreign_key_list(thd, &fk_child_key_list);
|
||||
List_iterator<FOREIGN_KEY_INFO> fk_key_it(fk_child_key_list);
|
||||
while ((f_key= fk_key_it++))
|
||||
{
|
||||
List_iterator_fast<Virtual_column_info>
|
||||
c_it(alter_info->check_constraint_list);
|
||||
Virtual_column_info *check;
|
||||
while ((check= c_it++))
|
||||
{
|
||||
if (!check->name.length || check->automatic_name)
|
||||
continue;
|
||||
|
||||
if (check->name.length == f_key->foreign_id->length &&
|
||||
my_strcasecmp(system_charset_info, f_key->foreign_id->str,
|
||||
check->name.str) == 0)
|
||||
{
|
||||
my_error(ER_DUP_CONSTRAINT_NAME, MYF(0), "CHECK", check->name.str);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Add new constraints */
|
||||
new_constraint_list.append(&alter_info->check_constraint_list);
|
||||
|
||||
|
|
|
@ -351,6 +351,13 @@ bool THD::open_temporary_table(TABLE_LIST *tl)
|
|||
DBUG_RETURN(false);
|
||||
}
|
||||
|
||||
if (!tl->db.str)
|
||||
{
|
||||
DBUG_PRINT("info",
|
||||
("Table reference to a temporary table must have database set"));
|
||||
DBUG_RETURN(false);
|
||||
}
|
||||
|
||||
/*
|
||||
Temporary tables are not safe for parallel replication. They were
|
||||
designed to be visible to one thread only, so have no table locking.
|
||||
|
|
|
@ -1785,7 +1785,7 @@ static int wsrep_RSU_begin(THD *thd, const char *db_, const char *table_)
|
|||
}
|
||||
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0));
|
||||
return(1);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
wsrep_seqno_t seqno = wsrep->pause(wsrep);
|
||||
|
@ -2302,6 +2302,7 @@ static my_bool have_committing_connections()
|
|||
|
||||
if (is_committing_connection(tmp))
|
||||
{
|
||||
mysql_mutex_unlock(&LOCK_thread_count);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1746,8 +1746,8 @@ dict_stats_analyze_index_for_n_prefix(
|
|||
ut_a(left <= right);
|
||||
ut_a(right <= last_idx_on_level);
|
||||
|
||||
const ulint rnd = right == left ? 0 :
|
||||
ut_rnd_gen_ulint() % (right - left);
|
||||
const ulint rnd = ut_rnd_interval(
|
||||
static_cast<ulint>(right - left));
|
||||
|
||||
const ib_uint64_t dive_below_idx
|
||||
= boundaries->at(static_cast<unsigned>(left + rnd));
|
||||
|
|
|
@ -30,9 +30,6 @@ Created 12/29/1997 Heikki Tuuri
|
|||
#include "row0sel.h"
|
||||
#include "rem0cmp.h"
|
||||
|
||||
/** The RND function seed */
|
||||
static ulint eval_rnd = 128367121;
|
||||
|
||||
/** Dummy adress used when we should allocate a buffer of size 0 in
|
||||
eval_node_alloc_val_buf */
|
||||
|
||||
|
@ -310,119 +307,17 @@ eval_aggregate(
|
|||
/*===========*/
|
||||
func_node_t* node) /*!< in: aggregate operation node */
|
||||
{
|
||||
que_node_t* arg;
|
||||
lint val;
|
||||
lint arg_val;
|
||||
int func;
|
||||
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_FUNC);
|
||||
|
||||
val = eval_node_get_int_val(node);
|
||||
|
||||
func = node->func;
|
||||
|
||||
if (func == PARS_COUNT_TOKEN) {
|
||||
|
||||
val = val + 1;
|
||||
} else {
|
||||
ut_ad(func == PARS_SUM_TOKEN);
|
||||
|
||||
arg = node->args;
|
||||
arg_val = eval_node_get_int_val(arg);
|
||||
|
||||
val = val + arg_val;
|
||||
}
|
||||
|
||||
ut_a(node->func == PARS_COUNT_TOKEN);
|
||||
val = val + 1;
|
||||
eval_node_set_int_val(node, val);
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
Evaluates a predefined function node where the function is not relevant
|
||||
in benchmarks. */
|
||||
static
|
||||
void
|
||||
eval_predefined_2(
|
||||
/*==============*/
|
||||
func_node_t* func_node) /*!< in: predefined function node */
|
||||
{
|
||||
que_node_t* arg;
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2 = 0; /* remove warning (??? bug ???) */
|
||||
lint int_val;
|
||||
byte* data;
|
||||
ulint len1;
|
||||
ulint len2;
|
||||
int func;
|
||||
ulint i;
|
||||
|
||||
ut_ad(que_node_get_type(func_node) == QUE_NODE_FUNC);
|
||||
|
||||
arg1 = func_node->args;
|
||||
|
||||
if (arg1) {
|
||||
arg2 = que_node_get_next(arg1);
|
||||
}
|
||||
|
||||
func = func_node->func;
|
||||
|
||||
if (func == PARS_PRINTF_TOKEN) {
|
||||
|
||||
arg = arg1;
|
||||
|
||||
while (arg) {
|
||||
dfield_print(que_node_get_val(arg));
|
||||
|
||||
arg = que_node_get_next(arg);
|
||||
}
|
||||
|
||||
putc('\n', stderr);
|
||||
|
||||
} else if (func == PARS_ASSERT_TOKEN) {
|
||||
|
||||
if (!eval_node_get_ibool_val(arg1)) {
|
||||
fputs("SQL assertion fails in a stored procedure!\n",
|
||||
stderr);
|
||||
}
|
||||
|
||||
ut_a(eval_node_get_ibool_val(arg1));
|
||||
|
||||
/* This function, or more precisely, a debug procedure,
|
||||
returns no value */
|
||||
|
||||
} else if (func == PARS_RND_TOKEN) {
|
||||
|
||||
len1 = (ulint) eval_node_get_int_val(arg1);
|
||||
len2 = (ulint) eval_node_get_int_val(arg2);
|
||||
|
||||
ut_ad(len2 >= len1);
|
||||
|
||||
if (len2 > len1) {
|
||||
int_val = (lint) (len1
|
||||
+ (eval_rnd % (len2 - len1 + 1)));
|
||||
} else {
|
||||
int_val = (lint) len1;
|
||||
}
|
||||
|
||||
eval_rnd = ut_rnd_gen_next_ulint(eval_rnd);
|
||||
|
||||
eval_node_set_int_val(func_node, int_val);
|
||||
|
||||
} else if (func == PARS_RND_STR_TOKEN) {
|
||||
|
||||
len1 = (ulint) eval_node_get_int_val(arg1);
|
||||
|
||||
data = eval_node_ensure_val_buf(func_node, len1);
|
||||
|
||||
for (i = 0; i < len1; i++) {
|
||||
data[i] = (byte)(97 + (eval_rnd % 3));
|
||||
|
||||
eval_rnd = ut_rnd_gen_next_ulint(eval_rnd);
|
||||
}
|
||||
} else {
|
||||
ut_error;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
Evaluates a notfound-function node. */
|
||||
UNIV_INLINE
|
||||
|
@ -493,46 +388,6 @@ eval_substr(
|
|||
dfield_set_data(dfield, str1 + len1, len2);
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
Evaluates a replstr-procedure node. */
|
||||
static
|
||||
void
|
||||
eval_replstr(
|
||||
/*=========*/
|
||||
func_node_t* func_node) /*!< in: function node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
que_node_t* arg3;
|
||||
que_node_t* arg4;
|
||||
byte* str1;
|
||||
byte* str2;
|
||||
ulint len1;
|
||||
ulint len2;
|
||||
|
||||
arg1 = func_node->args;
|
||||
arg2 = que_node_get_next(arg1);
|
||||
|
||||
ut_ad(que_node_get_type(arg1) == QUE_NODE_SYMBOL);
|
||||
|
||||
arg3 = que_node_get_next(arg2);
|
||||
arg4 = que_node_get_next(arg3);
|
||||
|
||||
str1 = static_cast<byte*>(dfield_get_data(que_node_get_val(arg1)));
|
||||
str2 = static_cast<byte*>(dfield_get_data(que_node_get_val(arg2)));
|
||||
|
||||
len1 = (ulint) eval_node_get_int_val(arg3);
|
||||
len2 = (ulint) eval_node_get_int_val(arg4);
|
||||
|
||||
if ((dfield_get_len(que_node_get_val(arg1)) < len1 + len2)
|
||||
|| (dfield_get_len(que_node_get_val(arg2)) < len2)) {
|
||||
|
||||
ut_error;
|
||||
}
|
||||
|
||||
ut_memcpy(str1 + len1, str2, len2);
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
Evaluates an instr-function node. */
|
||||
static
|
||||
|
@ -605,44 +460,6 @@ match_found:
|
|||
eval_node_set_int_val(func_node, int_val);
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
Evaluates a predefined function node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_binary_to_number(
|
||||
/*==================*/
|
||||
func_node_t* func_node) /*!< in: function node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
dfield_t* dfield;
|
||||
byte* str1;
|
||||
byte* str2;
|
||||
ulint len1;
|
||||
ulint int_val;
|
||||
|
||||
arg1 = func_node->args;
|
||||
|
||||
dfield = que_node_get_val(arg1);
|
||||
|
||||
str1 = static_cast<byte*>(dfield_get_data(dfield));
|
||||
len1 = dfield_get_len(dfield);
|
||||
|
||||
if (len1 > 4) {
|
||||
ut_error;
|
||||
}
|
||||
|
||||
if (len1 == 4) {
|
||||
str2 = str1;
|
||||
} else {
|
||||
int_val = 0;
|
||||
str2 = (byte*) &int_val;
|
||||
|
||||
ut_memcpy(str2 + (4 - len1), str1, len1);
|
||||
}
|
||||
|
||||
eval_node_copy_and_alloc_val(func_node, str2, 4);
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
Evaluates a predefined function node. */
|
||||
static
|
||||
|
@ -734,95 +551,12 @@ eval_to_binary(
|
|||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
Evaluates a predefined function node. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
eval_predefined(
|
||||
/*============*/
|
||||
func_node_t* func_node) /*!< in: function node */
|
||||
Evaluate LENGTH(). */
|
||||
inline void eval_length(func_node_t* func_node)
|
||||
{
|
||||
que_node_t* arg1;
|
||||
lint int_val;
|
||||
byte* data;
|
||||
int func;
|
||||
|
||||
func = func_node->func;
|
||||
|
||||
arg1 = func_node->args;
|
||||
|
||||
if (func == PARS_LENGTH_TOKEN) {
|
||||
|
||||
int_val = (lint) dfield_get_len(que_node_get_val(arg1));
|
||||
|
||||
} else if (func == PARS_TO_CHAR_TOKEN) {
|
||||
|
||||
/* Convert number to character string as a
|
||||
signed decimal integer. */
|
||||
|
||||
ulint uint_val;
|
||||
int int_len;
|
||||
|
||||
int_val = eval_node_get_int_val(arg1);
|
||||
|
||||
/* Determine the length of the string. */
|
||||
|
||||
if (int_val == 0) {
|
||||
int_len = 1; /* the number 0 occupies 1 byte */
|
||||
} else {
|
||||
int_len = 0;
|
||||
if (int_val < 0) {
|
||||
uint_val = ((ulint) -int_val - 1) + 1;
|
||||
int_len++; /* reserve space for minus sign */
|
||||
} else {
|
||||
uint_val = (ulint) int_val;
|
||||
}
|
||||
for (; uint_val > 0; int_len++) {
|
||||
uint_val /= 10;
|
||||
}
|
||||
}
|
||||
|
||||
/* allocate the string */
|
||||
data = eval_node_ensure_val_buf(func_node, ulint(int_len) + 1);
|
||||
|
||||
/* add terminating NUL character */
|
||||
data[int_len] = 0;
|
||||
|
||||
/* convert the number */
|
||||
|
||||
if (int_val == 0) {
|
||||
data[0] = '0';
|
||||
} else {
|
||||
int tmp;
|
||||
if (int_val < 0) {
|
||||
data[0] = '-'; /* preceding minus sign */
|
||||
uint_val = ((ulint) -int_val - 1) + 1;
|
||||
} else {
|
||||
uint_val = (ulint) int_val;
|
||||
}
|
||||
for (tmp = int_len; uint_val > 0; uint_val /= 10) {
|
||||
data[--tmp] = (byte)
|
||||
('0' + (byte)(uint_val % 10));
|
||||
}
|
||||
}
|
||||
|
||||
dfield_set_len(que_node_get_val(func_node), ulint(int_len));
|
||||
|
||||
return;
|
||||
|
||||
} else if (func == PARS_TO_NUMBER_TOKEN) {
|
||||
|
||||
int_val = atoi((char*)
|
||||
dfield_get_data(que_node_get_val(arg1)));
|
||||
|
||||
} else if (func == PARS_SYSDATE_TOKEN) {
|
||||
int_val = (lint) time(NULL);
|
||||
} else {
|
||||
eval_predefined_2(func_node);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
eval_node_set_int_val(func_node, int_val);
|
||||
eval_node_set_int_val(func_node,
|
||||
dfield_get_len(que_node_get_val
|
||||
(func_node->args)));
|
||||
}
|
||||
|
||||
/*****************************************************************//**
|
||||
|
@ -851,8 +585,7 @@ eval_func(
|
|||
|
||||
if (dfield_is_null(que_node_get_val(arg))
|
||||
&& (fclass != PARS_FUNC_CMP)
|
||||
&& (func != PARS_NOTFOUND_TOKEN)
|
||||
&& (func != PARS_PRINTF_TOKEN)) {
|
||||
&& (func != PARS_NOTFOUND_TOKEN)) {
|
||||
ut_error;
|
||||
}
|
||||
|
||||
|
@ -877,24 +610,20 @@ eval_func(
|
|||
case PARS_SUBSTR_TOKEN:
|
||||
eval_substr(func_node);
|
||||
return;
|
||||
case PARS_REPLSTR_TOKEN:
|
||||
eval_replstr(func_node);
|
||||
return;
|
||||
case PARS_INSTR_TOKEN:
|
||||
eval_instr(func_node);
|
||||
return;
|
||||
case PARS_BINARY_TO_NUMBER_TOKEN:
|
||||
eval_binary_to_number(func_node);
|
||||
return;
|
||||
case PARS_CONCAT_TOKEN:
|
||||
eval_concat(func_node);
|
||||
return;
|
||||
case PARS_TO_BINARY_TOKEN:
|
||||
eval_to_binary(func_node);
|
||||
return;
|
||||
default:
|
||||
eval_predefined(func_node);
|
||||
case PARS_LENGTH_TOKEN:
|
||||
eval_length(func_node);
|
||||
return;
|
||||
default:
|
||||
ut_error;
|
||||
}
|
||||
case PARS_FUNC_LOGICAL:
|
||||
eval_logical(func_node);
|
||||
|
|
|
@ -434,26 +434,6 @@ pick_seeds(
|
|||
}
|
||||
}
|
||||
|
||||
/*********************************************************//**
|
||||
Generates a random iboolean value.
|
||||
@return the random value */
|
||||
static
|
||||
ibool
|
||||
ut_rnd_gen_ibool(void)
|
||||
/*=================*/
|
||||
{
|
||||
ulint x;
|
||||
|
||||
x = ut_rnd_gen_ulint();
|
||||
|
||||
if (((x >> 20) + (x >> 15)) & 1) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/*************************************************************//**
|
||||
Select next node and group where to add. */
|
||||
static
|
||||
|
@ -490,8 +470,7 @@ pick_next(
|
|||
/* Introduce some randomness if the record
|
||||
is identical */
|
||||
if (diff == 0) {
|
||||
diff = static_cast<double>(
|
||||
ut_rnd_gen_ibool());
|
||||
diff = static_cast<double>(ut_rnd_gen() & 1);
|
||||
}
|
||||
|
||||
*n_group = 1 + (diff > 0);
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
/* A Bison parser, made by GNU Bison 3.0.4. */
|
||||
/* A Bison parser, made by GNU Bison 3.4.2. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
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
|
||||
|
@ -30,6 +31,9 @@
|
|||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
/* Undocumented macros, especially those whose name start with YY_,
|
||||
are private implementation details. Do not rely on them. */
|
||||
|
||||
#ifndef YY_YY_PARS0GRM_TAB_H_INCLUDED
|
||||
# define YY_YY_PARS0GRM_TAB_H_INCLUDED
|
||||
/* Debug traces. */
|
||||
|
@ -58,91 +62,71 @@ extern int yydebug;
|
|||
PARS_NE_TOKEN = 268,
|
||||
PARS_PROCEDURE_TOKEN = 269,
|
||||
PARS_IN_TOKEN = 270,
|
||||
PARS_OUT_TOKEN = 271,
|
||||
PARS_BINARY_TOKEN = 272,
|
||||
PARS_BLOB_TOKEN = 273,
|
||||
PARS_INT_TOKEN = 274,
|
||||
PARS_FLOAT_TOKEN = 275,
|
||||
PARS_CHAR_TOKEN = 276,
|
||||
PARS_IS_TOKEN = 277,
|
||||
PARS_BEGIN_TOKEN = 278,
|
||||
PARS_END_TOKEN = 279,
|
||||
PARS_IF_TOKEN = 280,
|
||||
PARS_THEN_TOKEN = 281,
|
||||
PARS_ELSE_TOKEN = 282,
|
||||
PARS_ELSIF_TOKEN = 283,
|
||||
PARS_LOOP_TOKEN = 284,
|
||||
PARS_WHILE_TOKEN = 285,
|
||||
PARS_RETURN_TOKEN = 286,
|
||||
PARS_SELECT_TOKEN = 287,
|
||||
PARS_SUM_TOKEN = 288,
|
||||
PARS_COUNT_TOKEN = 289,
|
||||
PARS_DISTINCT_TOKEN = 290,
|
||||
PARS_FROM_TOKEN = 291,
|
||||
PARS_WHERE_TOKEN = 292,
|
||||
PARS_FOR_TOKEN = 293,
|
||||
PARS_DDOT_TOKEN = 294,
|
||||
PARS_READ_TOKEN = 295,
|
||||
PARS_ORDER_TOKEN = 296,
|
||||
PARS_BY_TOKEN = 297,
|
||||
PARS_ASC_TOKEN = 298,
|
||||
PARS_DESC_TOKEN = 299,
|
||||
PARS_INSERT_TOKEN = 300,
|
||||
PARS_INTO_TOKEN = 301,
|
||||
PARS_VALUES_TOKEN = 302,
|
||||
PARS_UPDATE_TOKEN = 303,
|
||||
PARS_SET_TOKEN = 304,
|
||||
PARS_DELETE_TOKEN = 305,
|
||||
PARS_CURRENT_TOKEN = 306,
|
||||
PARS_OF_TOKEN = 307,
|
||||
PARS_CREATE_TOKEN = 308,
|
||||
PARS_TABLE_TOKEN = 309,
|
||||
PARS_INDEX_TOKEN = 310,
|
||||
PARS_UNIQUE_TOKEN = 311,
|
||||
PARS_CLUSTERED_TOKEN = 312,
|
||||
PARS_ON_TOKEN = 313,
|
||||
PARS_ASSIGN_TOKEN = 314,
|
||||
PARS_DECLARE_TOKEN = 315,
|
||||
PARS_CURSOR_TOKEN = 316,
|
||||
PARS_SQL_TOKEN = 317,
|
||||
PARS_OPEN_TOKEN = 318,
|
||||
PARS_FETCH_TOKEN = 319,
|
||||
PARS_CLOSE_TOKEN = 320,
|
||||
PARS_NOTFOUND_TOKEN = 321,
|
||||
PARS_TO_CHAR_TOKEN = 322,
|
||||
PARS_TO_NUMBER_TOKEN = 323,
|
||||
PARS_TO_BINARY_TOKEN = 324,
|
||||
PARS_BINARY_TO_NUMBER_TOKEN = 325,
|
||||
PARS_SUBSTR_TOKEN = 326,
|
||||
PARS_REPLSTR_TOKEN = 327,
|
||||
PARS_CONCAT_TOKEN = 328,
|
||||
PARS_INSTR_TOKEN = 329,
|
||||
PARS_LENGTH_TOKEN = 330,
|
||||
PARS_SYSDATE_TOKEN = 331,
|
||||
PARS_PRINTF_TOKEN = 332,
|
||||
PARS_ASSERT_TOKEN = 333,
|
||||
PARS_RND_TOKEN = 334,
|
||||
PARS_RND_STR_TOKEN = 335,
|
||||
PARS_ROW_PRINTF_TOKEN = 336,
|
||||
PARS_COMMIT_TOKEN = 337,
|
||||
PARS_ROLLBACK_TOKEN = 338,
|
||||
PARS_WORK_TOKEN = 339,
|
||||
PARS_UNSIGNED_TOKEN = 340,
|
||||
PARS_EXIT_TOKEN = 341,
|
||||
PARS_FUNCTION_TOKEN = 342,
|
||||
PARS_LOCK_TOKEN = 343,
|
||||
PARS_SHARE_TOKEN = 344,
|
||||
PARS_MODE_TOKEN = 345,
|
||||
PARS_LIKE_TOKEN = 346,
|
||||
PARS_LIKE_TOKEN_EXACT = 347,
|
||||
PARS_LIKE_TOKEN_PREFIX = 348,
|
||||
PARS_LIKE_TOKEN_SUFFIX = 349,
|
||||
PARS_LIKE_TOKEN_SUBSTR = 350,
|
||||
PARS_TABLE_NAME_TOKEN = 351,
|
||||
PARS_COMPACT_TOKEN = 352,
|
||||
PARS_BLOCK_SIZE_TOKEN = 353,
|
||||
PARS_BIGINT_TOKEN = 354,
|
||||
NEG = 355
|
||||
PARS_INT_TOKEN = 271,
|
||||
PARS_CHAR_TOKEN = 272,
|
||||
PARS_IS_TOKEN = 273,
|
||||
PARS_BEGIN_TOKEN = 274,
|
||||
PARS_END_TOKEN = 275,
|
||||
PARS_IF_TOKEN = 276,
|
||||
PARS_THEN_TOKEN = 277,
|
||||
PARS_ELSE_TOKEN = 278,
|
||||
PARS_ELSIF_TOKEN = 279,
|
||||
PARS_LOOP_TOKEN = 280,
|
||||
PARS_WHILE_TOKEN = 281,
|
||||
PARS_RETURN_TOKEN = 282,
|
||||
PARS_SELECT_TOKEN = 283,
|
||||
PARS_COUNT_TOKEN = 284,
|
||||
PARS_FROM_TOKEN = 285,
|
||||
PARS_WHERE_TOKEN = 286,
|
||||
PARS_FOR_TOKEN = 287,
|
||||
PARS_DDOT_TOKEN = 288,
|
||||
PARS_ORDER_TOKEN = 289,
|
||||
PARS_BY_TOKEN = 290,
|
||||
PARS_ASC_TOKEN = 291,
|
||||
PARS_DESC_TOKEN = 292,
|
||||
PARS_INSERT_TOKEN = 293,
|
||||
PARS_INTO_TOKEN = 294,
|
||||
PARS_VALUES_TOKEN = 295,
|
||||
PARS_UPDATE_TOKEN = 296,
|
||||
PARS_SET_TOKEN = 297,
|
||||
PARS_DELETE_TOKEN = 298,
|
||||
PARS_CURRENT_TOKEN = 299,
|
||||
PARS_OF_TOKEN = 300,
|
||||
PARS_CREATE_TOKEN = 301,
|
||||
PARS_TABLE_TOKEN = 302,
|
||||
PARS_INDEX_TOKEN = 303,
|
||||
PARS_UNIQUE_TOKEN = 304,
|
||||
PARS_CLUSTERED_TOKEN = 305,
|
||||
PARS_ON_TOKEN = 306,
|
||||
PARS_ASSIGN_TOKEN = 307,
|
||||
PARS_DECLARE_TOKEN = 308,
|
||||
PARS_CURSOR_TOKEN = 309,
|
||||
PARS_SQL_TOKEN = 310,
|
||||
PARS_OPEN_TOKEN = 311,
|
||||
PARS_FETCH_TOKEN = 312,
|
||||
PARS_CLOSE_TOKEN = 313,
|
||||
PARS_NOTFOUND_TOKEN = 314,
|
||||
PARS_TO_BINARY_TOKEN = 315,
|
||||
PARS_SUBSTR_TOKEN = 316,
|
||||
PARS_CONCAT_TOKEN = 317,
|
||||
PARS_INSTR_TOKEN = 318,
|
||||
PARS_LENGTH_TOKEN = 319,
|
||||
PARS_COMMIT_TOKEN = 320,
|
||||
PARS_ROLLBACK_TOKEN = 321,
|
||||
PARS_WORK_TOKEN = 322,
|
||||
PARS_EXIT_TOKEN = 323,
|
||||
PARS_FUNCTION_TOKEN = 324,
|
||||
PARS_LOCK_TOKEN = 325,
|
||||
PARS_SHARE_TOKEN = 326,
|
||||
PARS_MODE_TOKEN = 327,
|
||||
PARS_LIKE_TOKEN = 328,
|
||||
PARS_LIKE_TOKEN_EXACT = 329,
|
||||
PARS_LIKE_TOKEN_PREFIX = 330,
|
||||
PARS_LIKE_TOKEN_SUFFIX = 331,
|
||||
PARS_LIKE_TOKEN_SUBSTR = 332,
|
||||
PARS_TABLE_NAME_TOKEN = 333,
|
||||
PARS_BIGINT_TOKEN = 334,
|
||||
NEG = 335
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
@ -48,29 +48,15 @@ extern int yydebug;
|
|||
NOT re-entrant */
|
||||
extern sym_tab_t* pars_sym_tab_global;
|
||||
|
||||
extern pars_res_word_t pars_to_char_token;
|
||||
extern pars_res_word_t pars_to_number_token;
|
||||
extern pars_res_word_t pars_to_binary_token;
|
||||
extern pars_res_word_t pars_binary_to_number_token;
|
||||
extern pars_res_word_t pars_substr_token;
|
||||
extern pars_res_word_t pars_replstr_token;
|
||||
extern pars_res_word_t pars_concat_token;
|
||||
extern pars_res_word_t pars_length_token;
|
||||
extern pars_res_word_t pars_instr_token;
|
||||
extern pars_res_word_t pars_sysdate_token;
|
||||
extern pars_res_word_t pars_printf_token;
|
||||
extern pars_res_word_t pars_assert_token;
|
||||
extern pars_res_word_t pars_rnd_token;
|
||||
extern pars_res_word_t pars_rnd_str_token;
|
||||
extern pars_res_word_t pars_count_token;
|
||||
extern pars_res_word_t pars_sum_token;
|
||||
extern pars_res_word_t pars_distinct_token;
|
||||
extern pars_res_word_t pars_binary_token;
|
||||
extern pars_res_word_t pars_blob_token;
|
||||
extern pars_res_word_t pars_int_token;
|
||||
extern pars_res_word_t pars_bigint_token;
|
||||
extern pars_res_word_t pars_char_token;
|
||||
extern pars_res_word_t pars_float_token;
|
||||
extern pars_res_word_t pars_update_token;
|
||||
extern pars_res_word_t pars_asc_token;
|
||||
extern pars_res_word_t pars_desc_token;
|
||||
|
@ -236,17 +222,6 @@ pars_insert_statement(
|
|||
que_node_t* values_list, /*!< in: value expression list or NULL */
|
||||
sel_node_t* select); /*!< in: select condition or NULL */
|
||||
/*********************************************************************//**
|
||||
Parses a procedure parameter declaration.
|
||||
@return own: symbol table node of type SYM_VAR */
|
||||
sym_node_t*
|
||||
pars_parameter_declaration(
|
||||
/*=======================*/
|
||||
sym_node_t* node, /*!< in: symbol table node allocated for the
|
||||
id of the parameter */
|
||||
ulint param_type,
|
||||
/*!< in: PARS_INPUT or PARS_OUTPUT */
|
||||
pars_res_word_t* type); /*!< in: pointer to a type token */
|
||||
/*********************************************************************//**
|
||||
Parses an elsif element.
|
||||
@return elsif node */
|
||||
elsif_node_t*
|
||||
|
@ -358,8 +333,6 @@ pars_column_def(
|
|||
pars_res_word_t* type, /*!< in: data type */
|
||||
sym_node_t* len, /*!< in: length of column, or
|
||||
NULL */
|
||||
void* is_unsigned, /*!< in: if not NULL, column
|
||||
is of type UNSIGNED. */
|
||||
void* is_not_null); /*!< in: if not NULL, column
|
||||
is of type NOT NULL. */
|
||||
/*********************************************************************//**
|
||||
|
@ -370,9 +343,7 @@ pars_create_table(
|
|||
/*==============*/
|
||||
sym_node_t* table_sym, /*!< in: table name node in the symbol
|
||||
table */
|
||||
sym_node_t* column_defs, /*!< in: list of column names */
|
||||
sym_node_t* compact, /* in: non-NULL if COMPACT table. */
|
||||
sym_node_t* block_size); /* in: block size (can be NULL) */
|
||||
sym_node_t* column_defs); /*!< in: list of column names */
|
||||
/*********************************************************************//**
|
||||
Parses an index creation operation.
|
||||
@return index create subgraph */
|
||||
|
@ -394,7 +365,6 @@ pars_procedure_definition(
|
|||
/*======================*/
|
||||
sym_node_t* sym_node, /*!< in: procedure id node in the symbol
|
||||
table */
|
||||
sym_node_t* param_list, /*!< in: parameter declaration list */
|
||||
que_node_t* stat_list); /*!< in: statement list */
|
||||
|
||||
/*************************************************************//**
|
||||
|
@ -672,7 +642,6 @@ struct proc_node_t{
|
|||
que_common_t common; /*!< type: QUE_NODE_PROC */
|
||||
sym_node_t* proc_id; /*!< procedure name symbol in the symbol
|
||||
table of this same procedure */
|
||||
sym_node_t* param_list; /*!< input and output parameters */
|
||||
que_node_t* stat_list; /*!< statement list */
|
||||
sym_tab_t* sym_tab; /*!< symbol table of this procedure */
|
||||
};
|
||||
|
@ -747,7 +716,7 @@ struct col_assign_node_t{
|
|||
#define PARS_FUNC_LOGICAL 2 /*!< AND, OR, NOT */
|
||||
#define PARS_FUNC_CMP 3 /*!< comparison operators */
|
||||
#define PARS_FUNC_PREDEFINED 4 /*!< TO_NUMBER, SUBSTR, ... */
|
||||
#define PARS_FUNC_AGGREGATE 5 /*!< COUNT, DISTINCT, SUM */
|
||||
#define PARS_FUNC_AGGREGATE 5 /*!< COUNT */
|
||||
#define PARS_FUNC_OTHER 6 /*!< these are not real functions,
|
||||
e.g., := */
|
||||
/* @} */
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2019, MariaDB Corporation.
|
||||
|
||||
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 the Free Software
|
||||
|
@ -27,37 +28,49 @@ Created 1/20/1994 Heikki Tuuri
|
|||
#define ut0rnd_h
|
||||
|
||||
#include "ut0byte.h"
|
||||
#include <my_sys.h>
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/** The 'character code' for end of field or string (used
|
||||
in folding records */
|
||||
#define UT_END_OF_FIELD 257
|
||||
/** Seed value of ut_rnd_gen() */
|
||||
extern int32 ut_rnd_current;
|
||||
|
||||
/** @return a pseudo-random 32-bit number */
|
||||
inline uint32_t ut_rnd_gen()
|
||||
{
|
||||
/* This is a Galois linear-feedback shift register.
|
||||
https://en.wikipedia.org/wiki/Linear-feedback_shift_register#Galois_LFSRs
|
||||
The generating primitive Galois Field polynomial is the Castagnoli
|
||||
polynomial that was made popular by CRC-32C:
|
||||
x^32+x^28+x^27+x^26+x^25+x^23+x^22+x^20+
|
||||
x^19+x^18+x^14+x^13+x^11+x^10+x^9+x^8+x^6+1 */
|
||||
const uint32_t crc32c= 0x1edc6f41;
|
||||
|
||||
uint32_t rnd= my_atomic_load32_explicit(&ut_rnd_current,
|
||||
MY_MEMORY_ORDER_RELAXED);
|
||||
|
||||
if (UNIV_UNLIKELY(rnd == 0))
|
||||
{
|
||||
rnd= static_cast<uint32_t>(my_interval_timer());
|
||||
if (!rnd) rnd= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool lsb= rnd & 1;
|
||||
rnd>>= 1;
|
||||
if (lsb)
|
||||
rnd^= crc32c;
|
||||
}
|
||||
|
||||
my_atomic_store32_explicit(&ut_rnd_current, rnd, MY_MEMORY_ORDER_RELAXED);
|
||||
return rnd;
|
||||
}
|
||||
|
||||
/** @return a random number between 0 and n-1, inclusive */
|
||||
inline ulint ut_rnd_interval(ulint n)
|
||||
{
|
||||
return n > 1 ? static_cast<ulint>(ut_rnd_gen() % n) : 0;
|
||||
}
|
||||
|
||||
/********************************************************//**
|
||||
This is used to set the random number seed. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
ut_rnd_set_seed(
|
||||
/*============*/
|
||||
ulint seed); /*!< in: seed */
|
||||
/********************************************************//**
|
||||
The following function generates a series of 'random' ulint integers.
|
||||
@return the next 'random' number */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
ut_rnd_gen_next_ulint(
|
||||
/*==================*/
|
||||
ulint rnd); /*!< in: the previous random number value */
|
||||
/*********************************************************//**
|
||||
The following function generates 'random' ulint integers which
|
||||
enumerate the value space (let there be N of them) of ulint integers
|
||||
in a pseudo-random fashion. Note that the same integer is repeated
|
||||
always after N calls to the generator.
|
||||
@return the 'random' number */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
ut_rnd_gen_ulint(void);
|
||||
/*==================*/
|
||||
/*******************************************************//**
|
||||
The following function generates a hash value for a ulint integer
|
||||
to a hash table of size table_size, which should be a prime or some
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
Copyright (c) 2017, 2019, MariaDB Corporation.
|
||||
|
||||
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 the Free Software
|
||||
|
@ -29,74 +29,6 @@ Created 5/30/1994 Heikki Tuuri
|
|||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
||||
#define UT_RND1 151117737
|
||||
#define UT_RND2 119785373
|
||||
#define UT_RND3 85689495
|
||||
#define UT_RND4 76595339
|
||||
#define UT_SUM_RND2 98781234
|
||||
#define UT_SUM_RND3 126792457
|
||||
#define UT_SUM_RND4 63498502
|
||||
#define UT_XOR_RND1 187678878
|
||||
#define UT_XOR_RND2 143537923
|
||||
|
||||
/** Seed value of ut_rnd_gen_ulint() */
|
||||
extern ulint ut_rnd_ulint_counter;
|
||||
|
||||
/********************************************************//**
|
||||
This is used to set the random number seed. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
ut_rnd_set_seed(
|
||||
/*============*/
|
||||
ulint seed) /*!< in: seed */
|
||||
{
|
||||
ut_rnd_ulint_counter = seed;
|
||||
}
|
||||
|
||||
/********************************************************//**
|
||||
The following function generates a series of 'random' ulint integers.
|
||||
@return the next 'random' number */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
ut_rnd_gen_next_ulint(
|
||||
/*==================*/
|
||||
ulint rnd) /*!< in: the previous random number value */
|
||||
{
|
||||
ulint n_bits;
|
||||
|
||||
n_bits = 8 * sizeof(ulint);
|
||||
|
||||
rnd = UT_RND2 * rnd + UT_SUM_RND3;
|
||||
rnd = UT_XOR_RND1 ^ rnd;
|
||||
rnd = (rnd << 20) + (rnd >> (n_bits - 20));
|
||||
rnd = UT_RND3 * rnd + UT_SUM_RND4;
|
||||
rnd = UT_XOR_RND2 ^ rnd;
|
||||
rnd = (rnd << 20) + (rnd >> (n_bits - 20));
|
||||
rnd = UT_RND1 * rnd + UT_SUM_RND2;
|
||||
|
||||
return(rnd);
|
||||
}
|
||||
|
||||
/********************************************************//**
|
||||
The following function generates 'random' ulint integers which
|
||||
enumerate the value space of ulint integers in a pseudo random
|
||||
fashion. Note that the same integer is repeated always after
|
||||
2 to power 32 calls to the generator (if ulint is 32-bit).
|
||||
@return the 'random' number */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
ut_rnd_gen_ulint(void)
|
||||
/*==================*/
|
||||
{
|
||||
ulint rnd;
|
||||
|
||||
ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2;
|
||||
|
||||
rnd = ut_rnd_gen_next_ulint(ut_rnd_ulint_counter);
|
||||
|
||||
return(rnd);
|
||||
}
|
||||
|
||||
/*******************************************************//**
|
||||
The following function generates a hash value for a ulint integer
|
||||
to a hash table of size table_size, which should be a prime
|
||||
|
|
|
@ -35,38 +35,6 @@ Created 10/4/1994 Heikki Tuuri
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
/*******************************************************************//**
|
||||
This is a linear congruential generator PRNG. Returns a pseudo random
|
||||
number between 0 and 2^64-1 inclusive. The formula and the constants
|
||||
being used are:
|
||||
X[n+1] = (a * X[n] + c) mod m
|
||||
where:
|
||||
X[0] = my_interval_timer()
|
||||
a = 1103515245 (3^5 * 5 * 7 * 129749)
|
||||
c = 12345 (3 * 5 * 823)
|
||||
m = 18446744073709551616 (2^64)
|
||||
|
||||
@return number between 0 and 2^64-1 */
|
||||
static
|
||||
ib_uint64_t
|
||||
page_cur_lcg_prng(void)
|
||||
/*===================*/
|
||||
{
|
||||
#define LCG_a 1103515245
|
||||
#define LCG_c 12345
|
||||
static uint64_t lcg_current;
|
||||
|
||||
if (!lcg_current) {
|
||||
lcg_current = my_interval_timer();
|
||||
}
|
||||
|
||||
/* no need to "% 2^64" explicitly because lcg_current is
|
||||
64 bit and this will be done anyway */
|
||||
lcg_current = LCG_a * lcg_current + LCG_c;
|
||||
|
||||
return(lcg_current);
|
||||
}
|
||||
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
# ifdef UNIV_SEARCH_PERF_STAT
|
||||
static ulint page_cur_short_succ;
|
||||
|
@ -803,8 +771,7 @@ page_cur_open_on_rnd_user_rec(
|
|||
buf_block_t* block, /*!< in: page */
|
||||
page_cur_t* cursor) /*!< out: page cursor */
|
||||
{
|
||||
ulint rnd;
|
||||
ulint n_recs = page_get_n_recs(buf_block_get_frame(block));
|
||||
const ulint n_recs = page_get_n_recs(block->frame);
|
||||
|
||||
page_cur_set_before_first(block, cursor);
|
||||
|
||||
|
@ -813,11 +780,8 @@ page_cur_open_on_rnd_user_rec(
|
|||
return;
|
||||
}
|
||||
|
||||
rnd = (ulint) (page_cur_lcg_prng() % n_recs);
|
||||
|
||||
do {
|
||||
page_cur_move_to_next(cursor);
|
||||
} while (rnd--);
|
||||
cursor->rec = page_rec_get_nth(block->frame,
|
||||
ut_rnd_interval(n_recs) + 1);
|
||||
}
|
||||
|
||||
/** Write a redo log record of inserting a record into an index page.
|
||||
|
@ -2430,18 +2394,17 @@ page_cur_delete_rec(
|
|||
#ifdef UNIV_COMPILE_TEST_FUNCS
|
||||
|
||||
/*******************************************************************//**
|
||||
Print the first n numbers, generated by page_cur_lcg_prng() to make sure
|
||||
Print the first n numbers, generated by ut_rnd_gen() to make sure
|
||||
(visually) that it works properly. */
|
||||
void
|
||||
test_page_cur_lcg_prng(
|
||||
/*===================*/
|
||||
test_ut_rnd_gen(
|
||||
int n) /*!< in: print first n numbers */
|
||||
{
|
||||
int i;
|
||||
unsigned long long rnd;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
rnd = page_cur_lcg_prng();
|
||||
rnd = ut_rnd_gen();
|
||||
printf("%llu\t%%2=%llu %%3=%llu %%5=%llu %%7=%llu %%11=%llu\n",
|
||||
rnd,
|
||||
rnd % 2,
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
Copyright (c) 2017, 2019, MariaDB Corporation.
|
||||
|
||||
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 the Free Software
|
||||
|
@ -58,11 +58,7 @@ yylex(void);
|
|||
%token PARS_NE_TOKEN
|
||||
%token PARS_PROCEDURE_TOKEN
|
||||
%token PARS_IN_TOKEN
|
||||
%token PARS_OUT_TOKEN
|
||||
%token PARS_BINARY_TOKEN
|
||||
%token PARS_BLOB_TOKEN
|
||||
%token PARS_INT_TOKEN
|
||||
%token PARS_FLOAT_TOKEN
|
||||
%token PARS_CHAR_TOKEN
|
||||
%token PARS_IS_TOKEN
|
||||
%token PARS_BEGIN_TOKEN
|
||||
|
@ -75,14 +71,11 @@ yylex(void);
|
|||
%token PARS_WHILE_TOKEN
|
||||
%token PARS_RETURN_TOKEN
|
||||
%token PARS_SELECT_TOKEN
|
||||
%token PARS_SUM_TOKEN
|
||||
%token PARS_COUNT_TOKEN
|
||||
%token PARS_DISTINCT_TOKEN
|
||||
%token PARS_FROM_TOKEN
|
||||
%token PARS_WHERE_TOKEN
|
||||
%token PARS_FOR_TOKEN
|
||||
%token PARS_DDOT_TOKEN
|
||||
%token PARS_READ_TOKEN
|
||||
%token PARS_ORDER_TOKEN
|
||||
%token PARS_BY_TOKEN
|
||||
%token PARS_ASC_TOKEN
|
||||
|
@ -109,25 +102,14 @@ yylex(void);
|
|||
%token PARS_FETCH_TOKEN
|
||||
%token PARS_CLOSE_TOKEN
|
||||
%token PARS_NOTFOUND_TOKEN
|
||||
%token PARS_TO_CHAR_TOKEN
|
||||
%token PARS_TO_NUMBER_TOKEN
|
||||
%token PARS_TO_BINARY_TOKEN
|
||||
%token PARS_BINARY_TO_NUMBER_TOKEN
|
||||
%token PARS_SUBSTR_TOKEN
|
||||
%token PARS_REPLSTR_TOKEN
|
||||
%token PARS_CONCAT_TOKEN
|
||||
%token PARS_INSTR_TOKEN
|
||||
%token PARS_LENGTH_TOKEN
|
||||
%token PARS_SYSDATE_TOKEN
|
||||
%token PARS_PRINTF_TOKEN
|
||||
%token PARS_ASSERT_TOKEN
|
||||
%token PARS_RND_TOKEN
|
||||
%token PARS_RND_STR_TOKEN
|
||||
%token PARS_ROW_PRINTF_TOKEN
|
||||
%token PARS_COMMIT_TOKEN
|
||||
%token PARS_ROLLBACK_TOKEN
|
||||
%token PARS_WORK_TOKEN
|
||||
%token PARS_UNSIGNED_TOKEN
|
||||
%token PARS_EXIT_TOKEN
|
||||
%token PARS_FUNCTION_TOKEN
|
||||
%token PARS_LOCK_TOKEN
|
||||
|
@ -139,8 +121,6 @@ yylex(void);
|
|||
%token PARS_LIKE_TOKEN_SUFFIX
|
||||
%token PARS_LIKE_TOKEN_SUBSTR
|
||||
%token PARS_TABLE_NAME_TOKEN
|
||||
%token PARS_COMPACT_TOKEN
|
||||
%token PARS_BLOCK_SIZE_TOKEN
|
||||
%token PARS_BIGINT_TOKEN
|
||||
|
||||
%left PARS_AND_TOKEN PARS_OR_TOKEN
|
||||
|
@ -161,7 +141,6 @@ top_statement:
|
|||
|
||||
statement:
|
||||
stored_procedure_call
|
||||
| predefined_procedure_call ';'
|
||||
| while_statement ';'
|
||||
| for_statement ';'
|
||||
| exit_statement ';'
|
||||
|
@ -170,7 +149,6 @@ statement:
|
|||
| assignment_statement ';'
|
||||
| select_statement ';'
|
||||
| insert_statement ';'
|
||||
| row_printf_statement ';'
|
||||
| delete_statement_searched ';'
|
||||
| delete_statement_positioned ';'
|
||||
| update_statement_searched ';'
|
||||
|
@ -223,18 +201,11 @@ exp:
|
|||
;
|
||||
|
||||
function_name:
|
||||
PARS_TO_CHAR_TOKEN { $$ = &pars_to_char_token; }
|
||||
| PARS_TO_NUMBER_TOKEN { $$ = &pars_to_number_token; }
|
||||
| PARS_TO_BINARY_TOKEN { $$ = &pars_to_binary_token; }
|
||||
| PARS_BINARY_TO_NUMBER_TOKEN
|
||||
{ $$ = &pars_binary_to_number_token; }
|
||||
PARS_TO_BINARY_TOKEN { $$ = &pars_to_binary_token; }
|
||||
| PARS_SUBSTR_TOKEN { $$ = &pars_substr_token; }
|
||||
| PARS_CONCAT_TOKEN { $$ = &pars_concat_token; }
|
||||
| PARS_INSTR_TOKEN { $$ = &pars_instr_token; }
|
||||
| PARS_LENGTH_TOKEN { $$ = &pars_length_token; }
|
||||
| PARS_SYSDATE_TOKEN { $$ = &pars_sysdate_token; }
|
||||
| PARS_RND_TOKEN { $$ = &pars_rnd_token; }
|
||||
| PARS_RND_STR_TOKEN { $$ = &pars_rnd_str_token; }
|
||||
;
|
||||
|
||||
question_mark_list:
|
||||
|
@ -249,17 +220,6 @@ stored_procedure_call:
|
|||
static_cast<sym_node_t*>($2)); }
|
||||
;
|
||||
|
||||
predefined_procedure_call:
|
||||
predefined_procedure_name '(' exp_list ')'
|
||||
{ $$ = pars_procedure_call($1, $3); }
|
||||
;
|
||||
|
||||
predefined_procedure_name:
|
||||
PARS_REPLSTR_TOKEN { $$ = &pars_replstr_token; }
|
||||
| PARS_PRINTF_TOKEN { $$ = &pars_printf_token; }
|
||||
| PARS_ASSERT_TOKEN { $$ = &pars_assert_token; }
|
||||
;
|
||||
|
||||
user_function_call:
|
||||
PARS_ID_TOKEN '(' ')' { $$ = $1; }
|
||||
;
|
||||
|
@ -287,19 +247,9 @@ select_item:
|
|||
exp { $$ = $1; }
|
||||
| PARS_COUNT_TOKEN '(' '*' ')'
|
||||
{ $$ = pars_func(&pars_count_token,
|
||||
que_node_list_add_last(NULL,
|
||||
que_node_list_add_last(NULL,
|
||||
sym_tab_add_int_lit(
|
||||
pars_sym_tab_global, 1))); }
|
||||
| PARS_COUNT_TOKEN '(' PARS_DISTINCT_TOKEN PARS_ID_TOKEN ')'
|
||||
{ $$ = pars_func(&pars_count_token,
|
||||
que_node_list_add_last(NULL,
|
||||
pars_func(&pars_distinct_token,
|
||||
que_node_list_add_last(
|
||||
NULL, $4)))); }
|
||||
| PARS_SUM_TOKEN '(' exp ')'
|
||||
{ $$ = pars_func(&pars_sum_token,
|
||||
que_node_list_add_last(NULL,
|
||||
$3)); }
|
||||
;
|
||||
|
||||
select_item_list:
|
||||
|
@ -446,12 +396,6 @@ delete_statement_positioned:
|
|||
NULL); }
|
||||
;
|
||||
|
||||
row_printf_statement:
|
||||
PARS_ROW_PRINTF_TOKEN select_statement
|
||||
{ $$ = pars_row_printf_statement(
|
||||
static_cast<sel_node_t*>($2)); }
|
||||
;
|
||||
|
||||
assignment_statement:
|
||||
PARS_ID_TOKEN PARS_ASSIGN_TOKEN exp
|
||||
{ $$ = pars_assignment_statement(
|
||||
|
@ -536,12 +480,12 @@ fetch_statement:
|
|||
;
|
||||
|
||||
column_def:
|
||||
PARS_ID_TOKEN type_name opt_column_len opt_unsigned opt_not_null
|
||||
PARS_ID_TOKEN type_name opt_column_len opt_not_null
|
||||
{ $$ = pars_column_def(
|
||||
static_cast<sym_node_t*>($1),
|
||||
static_cast<pars_res_word_t*>($2),
|
||||
static_cast<sym_node_t*>($3),
|
||||
$4, $5); }
|
||||
$4); }
|
||||
;
|
||||
|
||||
column_def_list:
|
||||
|
@ -556,13 +500,6 @@ opt_column_len:
|
|||
{ $$ = $2; }
|
||||
;
|
||||
|
||||
opt_unsigned:
|
||||
/* Nothing */ { $$ = NULL; }
|
||||
| PARS_UNSIGNED_TOKEN
|
||||
{ $$ = &pars_int_token;
|
||||
/* pass any non-NULL pointer */ }
|
||||
;
|
||||
|
||||
opt_not_null:
|
||||
/* Nothing */ { $$ = NULL; }
|
||||
| PARS_NOT_TOKEN PARS_NULL_LIT
|
||||
|
@ -570,27 +507,12 @@ opt_not_null:
|
|||
/* pass any non-NULL pointer */ }
|
||||
;
|
||||
|
||||
compact:
|
||||
/* Nothing */ { $$ = NULL; }
|
||||
| PARS_COMPACT_TOKEN { $$ = &pars_int_token;
|
||||
/* pass any non-NULL pointer */ }
|
||||
;
|
||||
|
||||
block_size:
|
||||
/* Nothing */ { $$ = NULL; }
|
||||
| PARS_BLOCK_SIZE_TOKEN '=' PARS_INT_LIT
|
||||
{ $$ = $3; }
|
||||
;
|
||||
|
||||
create_table:
|
||||
PARS_CREATE_TOKEN PARS_TABLE_TOKEN
|
||||
table_name '(' column_def_list ')'
|
||||
compact block_size
|
||||
{ $$ = pars_create_table(
|
||||
static_cast<sym_node_t*>($3),
|
||||
static_cast<sym_node_t*>($5),
|
||||
static_cast<sym_node_t*>($7),
|
||||
static_cast<sym_node_t*>($8)); }
|
||||
static_cast<sym_node_t*>($5)); }
|
||||
;
|
||||
|
||||
column_list:
|
||||
|
@ -642,28 +564,6 @@ type_name:
|
|||
PARS_INT_TOKEN { $$ = &pars_int_token; }
|
||||
| PARS_BIGINT_TOKEN { $$ = &pars_bigint_token; }
|
||||
| PARS_CHAR_TOKEN { $$ = &pars_char_token; }
|
||||
| PARS_BINARY_TOKEN { $$ = &pars_binary_token; }
|
||||
| PARS_BLOB_TOKEN { $$ = &pars_blob_token; }
|
||||
;
|
||||
|
||||
parameter_declaration:
|
||||
PARS_ID_TOKEN PARS_IN_TOKEN type_name
|
||||
{ $$ = pars_parameter_declaration(
|
||||
static_cast<sym_node_t*>($1),
|
||||
PARS_INPUT,
|
||||
static_cast<pars_res_word_t*>($3)); }
|
||||
| PARS_ID_TOKEN PARS_OUT_TOKEN type_name
|
||||
{ $$ = pars_parameter_declaration(
|
||||
static_cast<sym_node_t*>($1),
|
||||
PARS_OUTPUT,
|
||||
static_cast<pars_res_word_t*>($3)); }
|
||||
;
|
||||
|
||||
parameter_declaration_list:
|
||||
/* Nothing */ { $$ = NULL; }
|
||||
| parameter_declaration { $$ = que_node_list_add_last(NULL, $1); }
|
||||
| parameter_declaration_list ',' parameter_declaration
|
||||
{ $$ = que_node_list_add_last($1, $3); }
|
||||
;
|
||||
|
||||
variable_declaration:
|
||||
|
@ -705,16 +605,14 @@ declaration_list:
|
|||
;
|
||||
|
||||
procedure_definition:
|
||||
PARS_PROCEDURE_TOKEN PARS_ID_TOKEN '(' parameter_declaration_list ')'
|
||||
PARS_PROCEDURE_TOKEN PARS_ID_TOKEN '(' ')'
|
||||
PARS_IS_TOKEN
|
||||
variable_declaration_list
|
||||
declaration_list
|
||||
PARS_BEGIN_TOKEN
|
||||
statement_list
|
||||
PARS_END_TOKEN { $$ = pars_procedure_definition(
|
||||
static_cast<sym_node_t*>($2),
|
||||
static_cast<sym_node_t*>($4),
|
||||
$10); }
|
||||
static_cast<sym_node_t*>($2), $9); }
|
||||
;
|
||||
|
||||
%%
|
||||
|
|
|
@ -249,30 +249,10 @@ In the state 'id', only two actions are possible (defined below). */
|
|||
return(PARS_IN_TOKEN);
|
||||
}
|
||||
|
||||
"OUT" {
|
||||
return(PARS_OUT_TOKEN);
|
||||
}
|
||||
|
||||
"BINARY" {
|
||||
return(PARS_BINARY_TOKEN);
|
||||
}
|
||||
|
||||
"BLOB" {
|
||||
return(PARS_BLOB_TOKEN);
|
||||
}
|
||||
|
||||
"INT" {
|
||||
return(PARS_INT_TOKEN);
|
||||
}
|
||||
|
||||
"INTEGER" {
|
||||
return(PARS_INT_TOKEN);
|
||||
}
|
||||
|
||||
"FLOAT" {
|
||||
return(PARS_FLOAT_TOKEN);
|
||||
}
|
||||
|
||||
"CHAR" {
|
||||
return(PARS_CHAR_TOKEN);
|
||||
}
|
||||
|
@ -321,18 +301,10 @@ In the state 'id', only two actions are possible (defined below). */
|
|||
return(PARS_SELECT_TOKEN);
|
||||
}
|
||||
|
||||
"SUM" {
|
||||
return(PARS_SUM_TOKEN);
|
||||
}
|
||||
|
||||
"COUNT" {
|
||||
return(PARS_COUNT_TOKEN);
|
||||
}
|
||||
|
||||
"DISTINCT" {
|
||||
return(PARS_DISTINCT_TOKEN);
|
||||
}
|
||||
|
||||
"FROM" {
|
||||
return(PARS_FROM_TOKEN);
|
||||
}
|
||||
|
@ -345,10 +317,6 @@ In the state 'id', only two actions are possible (defined below). */
|
|||
return(PARS_FOR_TOKEN);
|
||||
}
|
||||
|
||||
"READ" {
|
||||
return(PARS_READ_TOKEN);
|
||||
}
|
||||
|
||||
"ORDER" {
|
||||
return(PARS_ORDER_TOKEN);
|
||||
}
|
||||
|
@ -405,14 +373,6 @@ In the state 'id', only two actions are possible (defined below). */
|
|||
return(PARS_TABLE_TOKEN);
|
||||
}
|
||||
|
||||
"COMPACT" {
|
||||
return(PARS_COMPACT_TOKEN);
|
||||
}
|
||||
|
||||
"BLOCK_SIZE" {
|
||||
return(PARS_BLOCK_SIZE_TOKEN);
|
||||
}
|
||||
|
||||
"INDEX" {
|
||||
return(PARS_INDEX_TOKEN);
|
||||
}
|
||||
|
@ -453,30 +413,14 @@ In the state 'id', only two actions are possible (defined below). */
|
|||
return(PARS_NOTFOUND_TOKEN);
|
||||
}
|
||||
|
||||
"TO_CHAR" {
|
||||
return(PARS_TO_CHAR_TOKEN);
|
||||
}
|
||||
|
||||
"TO_NUMBER" {
|
||||
return(PARS_TO_NUMBER_TOKEN);
|
||||
}
|
||||
|
||||
"TO_BINARY" {
|
||||
return(PARS_TO_BINARY_TOKEN);
|
||||
}
|
||||
|
||||
"BINARY_TO_NUMBER" {
|
||||
return(PARS_BINARY_TO_NUMBER_TOKEN);
|
||||
}
|
||||
|
||||
"SUBSTR" {
|
||||
return(PARS_SUBSTR_TOKEN);
|
||||
}
|
||||
|
||||
"REPLSTR" {
|
||||
return(PARS_REPLSTR_TOKEN);
|
||||
}
|
||||
|
||||
"CONCAT" {
|
||||
return(PARS_CONCAT_TOKEN);
|
||||
}
|
||||
|
@ -489,30 +433,6 @@ In the state 'id', only two actions are possible (defined below). */
|
|||
return(PARS_LENGTH_TOKEN);
|
||||
}
|
||||
|
||||
"SYSDATE" {
|
||||
return(PARS_SYSDATE_TOKEN);
|
||||
}
|
||||
|
||||
"PRINTF" {
|
||||
return(PARS_PRINTF_TOKEN);
|
||||
}
|
||||
|
||||
"ASSERT" {
|
||||
return(PARS_ASSERT_TOKEN);
|
||||
}
|
||||
|
||||
"RND" {
|
||||
return(PARS_RND_TOKEN);
|
||||
}
|
||||
|
||||
"RND_STR" {
|
||||
return(PARS_RND_STR_TOKEN);
|
||||
}
|
||||
|
||||
"ROW_PRINTF" {
|
||||
return(PARS_ROW_PRINTF_TOKEN);
|
||||
}
|
||||
|
||||
"COMMIT" {
|
||||
return(PARS_COMMIT_TOKEN);
|
||||
}
|
||||
|
@ -525,10 +445,6 @@ In the state 'id', only two actions are possible (defined below). */
|
|||
return(PARS_WORK_TOKEN);
|
||||
}
|
||||
|
||||
"UNSIGNED" {
|
||||
return(PARS_UNSIGNED_TOKEN);
|
||||
}
|
||||
|
||||
"EXIT" {
|
||||
return(PARS_EXIT_TOKEN);
|
||||
}
|
||||
|
|
|
@ -50,29 +50,15 @@ sym_tab_t* pars_sym_tab_global;
|
|||
/* Global variables used to denote certain reserved words, used in
|
||||
constructing the parsing tree */
|
||||
|
||||
pars_res_word_t pars_to_char_token = {PARS_TO_CHAR_TOKEN};
|
||||
pars_res_word_t pars_to_number_token = {PARS_TO_NUMBER_TOKEN};
|
||||
pars_res_word_t pars_to_binary_token = {PARS_TO_BINARY_TOKEN};
|
||||
pars_res_word_t pars_binary_to_number_token = {PARS_BINARY_TO_NUMBER_TOKEN};
|
||||
pars_res_word_t pars_substr_token = {PARS_SUBSTR_TOKEN};
|
||||
pars_res_word_t pars_replstr_token = {PARS_REPLSTR_TOKEN};
|
||||
pars_res_word_t pars_concat_token = {PARS_CONCAT_TOKEN};
|
||||
pars_res_word_t pars_instr_token = {PARS_INSTR_TOKEN};
|
||||
pars_res_word_t pars_length_token = {PARS_LENGTH_TOKEN};
|
||||
pars_res_word_t pars_sysdate_token = {PARS_SYSDATE_TOKEN};
|
||||
pars_res_word_t pars_printf_token = {PARS_PRINTF_TOKEN};
|
||||
pars_res_word_t pars_assert_token = {PARS_ASSERT_TOKEN};
|
||||
pars_res_word_t pars_rnd_token = {PARS_RND_TOKEN};
|
||||
pars_res_word_t pars_rnd_str_token = {PARS_RND_STR_TOKEN};
|
||||
pars_res_word_t pars_count_token = {PARS_COUNT_TOKEN};
|
||||
pars_res_word_t pars_sum_token = {PARS_SUM_TOKEN};
|
||||
pars_res_word_t pars_distinct_token = {PARS_DISTINCT_TOKEN};
|
||||
pars_res_word_t pars_binary_token = {PARS_BINARY_TOKEN};
|
||||
pars_res_word_t pars_blob_token = {PARS_BLOB_TOKEN};
|
||||
pars_res_word_t pars_int_token = {PARS_INT_TOKEN};
|
||||
pars_res_word_t pars_bigint_token = {PARS_BIGINT_TOKEN};
|
||||
pars_res_word_t pars_char_token = {PARS_CHAR_TOKEN};
|
||||
pars_res_word_t pars_float_token = {PARS_FLOAT_TOKEN};
|
||||
pars_res_word_t pars_update_token = {PARS_UPDATE_TOKEN};
|
||||
pars_res_word_t pars_asc_token = {PARS_ASC_TOKEN};
|
||||
pars_res_word_t pars_desc_token = {PARS_DESC_TOKEN};
|
||||
|
@ -195,24 +181,15 @@ pars_func_get_class(
|
|||
case PARS_AND_TOKEN: case PARS_OR_TOKEN: case PARS_NOT_TOKEN:
|
||||
return(PARS_FUNC_LOGICAL);
|
||||
|
||||
case PARS_COUNT_TOKEN: case PARS_SUM_TOKEN:
|
||||
case PARS_COUNT_TOKEN:
|
||||
return(PARS_FUNC_AGGREGATE);
|
||||
|
||||
case PARS_TO_CHAR_TOKEN:
|
||||
case PARS_TO_NUMBER_TOKEN:
|
||||
case PARS_TO_BINARY_TOKEN:
|
||||
case PARS_BINARY_TO_NUMBER_TOKEN:
|
||||
case PARS_SUBSTR_TOKEN:
|
||||
case PARS_CONCAT_TOKEN:
|
||||
case PARS_LENGTH_TOKEN:
|
||||
case PARS_INSTR_TOKEN:
|
||||
case PARS_SYSDATE_TOKEN:
|
||||
case PARS_NOTFOUND_TOKEN:
|
||||
case PARS_PRINTF_TOKEN:
|
||||
case PARS_ASSERT_TOKEN:
|
||||
case PARS_RND_TOKEN:
|
||||
case PARS_RND_STR_TOKEN:
|
||||
case PARS_REPLSTR_TOKEN:
|
||||
return(PARS_FUNC_PREDEFINED);
|
||||
|
||||
default:
|
||||
|
@ -499,7 +476,6 @@ pars_resolve_func_data_type(
|
|||
arg = node->args;
|
||||
|
||||
switch (node->func) {
|
||||
case PARS_SUM_TOKEN:
|
||||
case '+': case '-': case '*': case '/':
|
||||
/* Inherit the data type from the first argument (which must
|
||||
not be the SQL null literal whose type is DATA_ERROR) */
|
||||
|
@ -516,13 +492,6 @@ pars_resolve_func_data_type(
|
|||
dtype_set(que_node_get_data_type(node), DATA_INT, 0, 4);
|
||||
break;
|
||||
|
||||
case PARS_TO_CHAR_TOKEN:
|
||||
case PARS_RND_STR_TOKEN:
|
||||
ut_a(dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT);
|
||||
dtype_set(que_node_get_data_type(node), DATA_VARCHAR,
|
||||
DATA_ENGLISH, 0);
|
||||
break;
|
||||
|
||||
case PARS_TO_BINARY_TOKEN:
|
||||
if (dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT) {
|
||||
dtype_set(que_node_get_data_type(node), DATA_VARCHAR,
|
||||
|
@ -533,19 +502,12 @@ pars_resolve_func_data_type(
|
|||
}
|
||||
break;
|
||||
|
||||
case PARS_TO_NUMBER_TOKEN:
|
||||
case PARS_BINARY_TO_NUMBER_TOKEN:
|
||||
case PARS_LENGTH_TOKEN:
|
||||
case PARS_INSTR_TOKEN:
|
||||
ut_a(pars_is_string_type(que_node_get_data_type(arg)->mtype));
|
||||
dtype_set(que_node_get_data_type(node), DATA_INT, 0, 4);
|
||||
break;
|
||||
|
||||
case PARS_SYSDATE_TOKEN:
|
||||
ut_a(arg == NULL);
|
||||
dtype_set(que_node_get_data_type(node), DATA_INT, 0, 4);
|
||||
break;
|
||||
|
||||
case PARS_SUBSTR_TOKEN:
|
||||
case PARS_CONCAT_TOKEN:
|
||||
ut_a(pars_is_string_type(que_node_get_data_type(arg)->mtype));
|
||||
|
@ -566,11 +528,6 @@ pars_resolve_func_data_type(
|
|||
dtype_set(que_node_get_data_type(node), DATA_INT, 0, 4);
|
||||
break;
|
||||
|
||||
case PARS_RND_TOKEN:
|
||||
ut_a(dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT);
|
||||
dtype_set(que_node_get_data_type(node), DATA_INT, 0, 4);
|
||||
break;
|
||||
|
||||
case PARS_LIKE_TOKEN_EXACT:
|
||||
case PARS_LIKE_TOKEN_PREFIX:
|
||||
case PARS_LIKE_TOKEN_SUFFIX:
|
||||
|
@ -1355,9 +1312,7 @@ pars_set_dfield_type(
|
|||
pars_res_word_t* type, /*!< in: pointer to a type
|
||||
token */
|
||||
ulint len, /*!< in: length, or 0 */
|
||||
ibool is_unsigned, /*!< in: if TRUE, column is
|
||||
UNSIGNED. */
|
||||
ibool is_not_null) /*!< in: if TRUE, column is
|
||||
bool is_not_null) /*!< in: whether the column is
|
||||
NOT NULL. */
|
||||
{
|
||||
ulint flags = 0;
|
||||
|
@ -1366,10 +1321,6 @@ pars_set_dfield_type(
|
|||
flags |= DATA_NOT_NULL;
|
||||
}
|
||||
|
||||
if (is_unsigned) {
|
||||
flags |= DATA_UNSIGNED;
|
||||
}
|
||||
|
||||
if (type == &pars_bigint_token) {
|
||||
ut_a(len == 0);
|
||||
|
||||
|
@ -1384,16 +1335,6 @@ pars_set_dfield_type(
|
|||
|
||||
dtype_set(dfield_get_type(dfield), DATA_VARCHAR,
|
||||
DATA_ENGLISH | flags, len);
|
||||
} else if (type == &pars_binary_token) {
|
||||
ut_a(len != 0);
|
||||
|
||||
dtype_set(dfield_get_type(dfield), DATA_FIXBINARY,
|
||||
DATA_BINARY_TYPE | flags, len);
|
||||
} else if (type == &pars_blob_token) {
|
||||
ut_a(len == 0);
|
||||
|
||||
dtype_set(dfield_get_type(dfield), DATA_BLOB,
|
||||
DATA_BINARY_TYPE | flags, 0);
|
||||
} else {
|
||||
ut_error;
|
||||
}
|
||||
|
@ -1414,28 +1355,7 @@ pars_variable_declaration(
|
|||
|
||||
node->param_type = PARS_NOT_PARAM;
|
||||
|
||||
pars_set_dfield_type(que_node_get_val(node), type, 0, FALSE, FALSE);
|
||||
|
||||
return(node);
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Parses a procedure parameter declaration.
|
||||
@return own: symbol table node of type SYM_VAR */
|
||||
sym_node_t*
|
||||
pars_parameter_declaration(
|
||||
/*=======================*/
|
||||
sym_node_t* node, /*!< in: symbol table node allocated for the
|
||||
id of the parameter */
|
||||
ulint param_type,
|
||||
/*!< in: PARS_INPUT or PARS_OUTPUT */
|
||||
pars_res_word_t* type) /*!< in: pointer to a type token */
|
||||
{
|
||||
ut_a((param_type == PARS_INPUT) || (param_type == PARS_OUTPUT));
|
||||
|
||||
pars_variable_declaration(node, type);
|
||||
|
||||
node->param_type = param_type;
|
||||
pars_set_dfield_type(que_node_get_val(node), type, 0, false);
|
||||
|
||||
return(node);
|
||||
}
|
||||
|
@ -1821,8 +1741,6 @@ pars_column_def(
|
|||
pars_res_word_t* type, /*!< in: data type */
|
||||
sym_node_t* len, /*!< in: length of column, or
|
||||
NULL */
|
||||
void* is_unsigned, /*!< in: if not NULL, column
|
||||
is of type UNSIGNED. */
|
||||
void* is_not_null) /*!< in: if not NULL, column
|
||||
is of type NOT NULL. */
|
||||
{
|
||||
|
@ -1835,7 +1753,7 @@ pars_column_def(
|
|||
}
|
||||
|
||||
pars_set_dfield_type(que_node_get_val(sym_node), type, len2,
|
||||
is_unsigned != NULL, is_not_null != NULL);
|
||||
is_not_null != NULL);
|
||||
|
||||
return(sym_node);
|
||||
}
|
||||
|
@ -1848,9 +1766,7 @@ pars_create_table(
|
|||
/*==============*/
|
||||
sym_node_t* table_sym, /*!< in: table name node in the symbol
|
||||
table */
|
||||
sym_node_t* column_defs, /*!< in: list of column names */
|
||||
sym_node_t* compact, /* in: non-NULL if COMPACT table. */
|
||||
sym_node_t* block_size) /* in: block size (can be NULL) */
|
||||
sym_node_t* column_defs) /*!< in: list of column names */
|
||||
{
|
||||
dict_table_t* table;
|
||||
sym_node_t* column;
|
||||
|
@ -1858,57 +1774,11 @@ pars_create_table(
|
|||
const dtype_t* dtype;
|
||||
ulint n_cols;
|
||||
ulint flags = 0;
|
||||
ulint flags2 = 0;
|
||||
ulint flags2 = DICT_TF2_FTS_AUX_HEX_NAME;
|
||||
|
||||
if (compact != NULL) {
|
||||
|
||||
/* System tables currently only use the REDUNDANT row
|
||||
format therefore the check for srv_file_per_table should be
|
||||
safe for now. */
|
||||
|
||||
flags |= DICT_TF_COMPACT;
|
||||
|
||||
/* FIXME: Ideally this should be part of the SQL syntax
|
||||
or use some other mechanism. We want to reduce dependency
|
||||
on global variables. There is an inherent race here but
|
||||
that has always existed around this variable. */
|
||||
if (srv_file_per_table) {
|
||||
flags2 |= DICT_TF2_USE_FILE_PER_TABLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (block_size != NULL) {
|
||||
ulint size;
|
||||
dfield_t* dfield;
|
||||
|
||||
dfield = que_node_get_val(block_size);
|
||||
|
||||
ut_a(dfield_get_len(dfield) == 4);
|
||||
size = mach_read_from_4(static_cast<byte*>(
|
||||
dfield_get_data(dfield)));
|
||||
|
||||
|
||||
switch (size) {
|
||||
case 0:
|
||||
break;
|
||||
|
||||
case 1: case 2: case 4: case 8: case 16:
|
||||
flags |= DICT_TF_COMPACT;
|
||||
/* FTS-FIXME: needs the zip changes */
|
||||
/* flags |= size << DICT_TF_COMPRESSED_SHIFT; */
|
||||
break;
|
||||
|
||||
default:
|
||||
ut_error;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the flags2 when create table or alter tables */
|
||||
flags2 |= DICT_TF2_FTS_AUX_HEX_NAME;
|
||||
DBUG_EXECUTE_IF("innodb_test_wrong_fts_aux_table_name",
|
||||
flags2 &= ~DICT_TF2_FTS_AUX_HEX_NAME;);
|
||||
|
||||
|
||||
n_cols = que_node_list_get_len(column_defs);
|
||||
|
||||
table = dict_mem_table_create(
|
||||
|
@ -2005,7 +1875,6 @@ pars_procedure_definition(
|
|||
/*======================*/
|
||||
sym_node_t* sym_node, /*!< in: procedure id node in the symbol
|
||||
table */
|
||||
sym_node_t* param_list, /*!< in: parameter declaration list */
|
||||
que_node_t* stat_list) /*!< in: statement list */
|
||||
{
|
||||
proc_node_t* node;
|
||||
|
@ -2030,7 +1899,6 @@ pars_procedure_definition(
|
|||
sym_node->resolved = TRUE;
|
||||
|
||||
node->proc_id = sym_node;
|
||||
node->param_list = param_list;
|
||||
node->stat_list = stat_list;
|
||||
|
||||
pars_set_parent_in_list(stat_list, node);
|
||||
|
|
|
@ -1562,7 +1562,7 @@ struct CreateTracker {
|
|||
~CreateTracker()
|
||||
UNIV_NOTHROW
|
||||
{
|
||||
ut_d(m_files.empty());
|
||||
ut_ad(m_files.empty());
|
||||
|
||||
m_mutex.destroy();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2019, MariaDB Corporation.
|
||||
|
||||
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 the Free Software
|
||||
|
@ -25,6 +26,9 @@ Created 5/11/1994 Heikki Tuuri
|
|||
|
||||
#include "ut0rnd.h"
|
||||
|
||||
/** Seed value of ut_rnd_gen() */
|
||||
int32 ut_rnd_current;
|
||||
|
||||
/** These random numbers are used in ut_find_prime */
|
||||
/*@{*/
|
||||
#define UT_RANDOM_1 1.0412321
|
||||
|
@ -32,9 +36,6 @@ Created 5/11/1994 Heikki Tuuri
|
|||
#define UT_RANDOM_3 1.0132677
|
||||
/*@}*/
|
||||
|
||||
/** Seed value of ut_rnd_gen_ulint(). */
|
||||
ulint ut_rnd_ulint_counter = 65654363;
|
||||
|
||||
/***********************************************************//**
|
||||
Looks for a prime number slightly greater than the given argument.
|
||||
The prime is chosen so that it is not near any power of 2.
|
||||
|
|
Loading…
Add table
Reference in a new issue