From f00e25b4c4dee75d0bc3d8f3027ff1e9c8c5368b Mon Sep 17 00:00:00 2001 From: chriscalender Date: Sun, 10 Feb 2019 15:48:12 -0500 Subject: [PATCH 01/47] Fix for MDEV-15538, '-N' Produce html output wrong --- client/mysql.cc | 3 ++- mysql-test/r/mysql.result | 4 ++++ mysql-test/t/mysql.test | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index 624e97236aa..e035d15d809 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -3754,9 +3754,10 @@ print_table_data_html(MYSQL_RES *result) MYSQL_FIELD *field; mysql_field_seek(result,0); - (void) tee_fputs("", PAGER); + (void) tee_fputs("
", PAGER); if (column_names) { + (void) tee_fputs("", PAGER); while((field = mysql_fetch_field(result))) { tee_fputs("
", PAGER); diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index ffa5d020153..d23c7965af4 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -613,3 +613,7 @@ count(*) 0 truncate table t1; drop table t1; +# +# MDEV-15538 '-N' Produce html output wrong +# +
1
\ No newline at end of file diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index f526a3fea91..54033606b53 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -678,3 +678,9 @@ select count(*) from t1; truncate table t1; --exec $MYSQL --disable-local-infile -e "/*q*/$ldli" select count(*) from t1; truncate table t1; drop table t1; + + +--echo # +--echo # MDEV-15538 '-N' Produce html output wrong +--echo # +--exec $MYSQL -NHe "select 1 as a" From 778c525ff8f47aa56027d185a3f271d34cdb66ef Mon Sep 17 00:00:00 2001 From: sachin Date: Wed, 20 Mar 2019 15:04:24 +0530 Subject: [PATCH 02/47] MDEV-17119 replicate_rewrite_db does not work for single chardatabase name Fixed issue in logic. --- mysql-test/suite/rpl/r/rpl_rewrt_db.result | 19 +++++++++++++++++++ mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt | 2 +- mysql-test/suite/rpl/t/rpl_rewrt_db.test | 19 +++++++++++++++++++ sql/mysqld.cc | 3 ++- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result index 6cbd107fdcf..0c80887d169 100644 --- a/mysql-test/suite/rpl/r/rpl_rewrt_db.result +++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result @@ -1,19 +1,36 @@ include/master-slave.inc [connection master] +set sql_log_bin=0; +create database y; +set sql_log_bin=1; drop database if exists mysqltest1; +drop database if exists x; create database mysqltest1; +set sql_log_bin=0; +create database x; +set sql_log_bin=1; use mysqltest1; create table t1 (a int); insert into t1 values(9); +use x; +create table t1 (a int); +insert into t1 values(9); select * from mysqltest1.t1; a 9 +select * from x.t1; +a +9 show databases like 'mysqltest1'; Database (mysqltest1) mysqltest1 select * from test.t1; a 9 +select * from y.t1; +a +9 +use mysqltest1; drop table t1; drop database mysqltest1; drop database if exists rewrite; @@ -209,10 +226,12 @@ SET sql_log_bin= 0; DROP DATABASE database_master_temp_01; DROP DATABASE database_master_temp_02; DROP DATABASE database_master_temp_03; +DROP DATABASE x; SET sql_log_bin= 1; SET sql_log_bin= 0; DROP DATABASE database_slave_temp_01; DROP DATABASE database_slave_temp_02; DROP DATABASE database_slave_temp_03; +DROP DATABASE y; SET sql_log_bin= 1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt b/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt index 290b92e0a3e..84059110136 100644 --- a/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt @@ -1 +1 @@ -"--replicate-rewrite-db=test->rewrite" "--replicate-rewrite-db=mysqltest1->test" "--replicate-rewrite-db=database_master_temp_01->database_slave_temp_01" "--replicate-rewrite-db=database_master_temp_02->database_slave_temp_02" "--replicate-rewrite-db=database_master_temp_03->database_slave_temp_03" +"--replicate-rewrite-db=test->rewrite" "--replicate-rewrite-db=mysqltest1 -> test" "--replicate-rewrite-db=x -> y" "--replicate-rewrite-db=database_master_temp_01->database_slave_temp_01" "--replicate-rewrite-db=database_master_temp_02->database_slave_temp_02" "--replicate-rewrite-db=database_master_temp_03->database_slave_temp_03" diff --git a/mysql-test/suite/rpl/t/rpl_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_rewrt_db.test index 996ad0a10c7..bd0749bc2de 100644 --- a/mysql-test/suite/rpl/t/rpl_rewrt_db.test +++ b/mysql-test/suite/rpl/t/rpl_rewrt_db.test @@ -2,20 +2,37 @@ -- source include/have_binlog_format_mixed_or_statement.inc -- source include/master-slave.inc +--connection slave +set sql_log_bin=0; +create database y; +set sql_log_bin=1; + +--connection master --disable_warnings drop database if exists mysqltest1; +drop database if exists x; --enable_warnings create database mysqltest1; +set sql_log_bin=0; +create database x; +set sql_log_bin=1; use mysqltest1; create table t1 (a int); insert into t1 values(9); +use x; +create table t1 (a int); +insert into t1 values(9); select * from mysqltest1.t1; +select * from x.t1; sync_slave_with_master; +#TODO no it is no empty show databases like 'mysqltest1'; # should be empty select * from test.t1; +select * from y.t1; # cleanup connection master; +use mysqltest1; drop table t1; drop database mysqltest1; sync_slave_with_master; @@ -224,6 +241,7 @@ SET sql_log_bin= 0; DROP DATABASE database_master_temp_01; DROP DATABASE database_master_temp_02; DROP DATABASE database_master_temp_03; +DROP DATABASE x; SET sql_log_bin= 1; connection slave; @@ -231,6 +249,7 @@ SET sql_log_bin= 0; DROP DATABASE database_slave_temp_01; DROP DATABASE database_slave_temp_02; DROP DATABASE database_slave_temp_03; +DROP DATABASE y; SET sql_log_bin= 1; connection master; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index aa749e5aaef..528c5d8ecfe 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7596,7 +7596,8 @@ mysqld_get_one_option(int optid, val= p--; while (my_isspace(mysqld_charset, *p) && p > argument) *p-- = 0; - if (p == argument) + /* Db name can be one char also */ + if (p == argument && my_isspace(mysqld_charset, *p)) { sql_print_error("Bad syntax in replicate-rewrite-db - empty FROM db!\n"); return 1; From d8b7e76c37ae53255880370d68244608230dbc53 Mon Sep 17 00:00:00 2001 From: Chris Calender Date: Thu, 7 Feb 2019 01:23:28 -0500 Subject: [PATCH 03/47] Fix for MDEV-18276, typo in error message + all other occurrences of refering --- mysql-test/include/mix2.inc | 2 +- mysql-test/suite/innodb/t/innodb.test | 2 +- mysql-test/t/insert.test | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc index d6becb2e37e..4d688ddb347 100644 --- a/mysql-test/include/mix2.inc +++ b/mysql-test/include/mix2.inc @@ -1153,7 +1153,7 @@ checksum table t1, t2, t3, t4, t5, t6, t7 extended; drop table t1,t2,t3, t4, t5, t6; # -# Test problem with refering to different fields in same table in UNION +# Test problem with referring to different fields in same table in UNION # (Bug#2552: UNION returns NULL instead of expected value (innoDB only tables)) # eval create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=$engine_type; diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index b91fbe13718..90d78f12a56 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -1125,7 +1125,7 @@ checksum table t1, t2, t3, t4 extended; drop table t1,t2,t3; # -# Test problem with refering to different fields in same table in UNION +# Test problem with referring to different fields in same table in UNION # (Bug #2552) # create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb; diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index ff8396fd7fd..8dda7f60ec2 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -1,5 +1,5 @@ # -# Test of refering to old values +# Test of referring to old values # --disable_warnings From c61e8a6597b3d4010b4c0e9ec0a428cb48fb0ac3 Mon Sep 17 00:00:00 2001 From: Chris Calender Date: Sun, 24 Mar 2019 13:24:28 -0400 Subject: [PATCH 04/47] Fix for MDEV-17449, typo in error message (#1146) --- mysql-test/suite/storage_engine/vcol.result | 16 +++++++-------- .../suite/vcol/r/vcol_ins_upd_innodb.result | 20 +++++++++---------- .../suite/vcol/r/vcol_ins_upd_myisam.result | 20 +++++++++---------- mysql-test/suite/vcol/r/vcol_misc.result | 12 +++++------ .../suite/vcol/r/vcol_select_myisam.result | 6 +++--- sql/share/errmsg-utf8.txt | 2 +- .../mysql-test/storage_engine/vcol.rdiff | 16 +++++++-------- .../mysql-test/storage_engine/vcol.rdiff | 16 +++++++-------- 8 files changed, 54 insertions(+), 54 deletions(-) diff --git a/mysql-test/suite/storage_engine/vcol.result b/mysql-test/suite/storage_engine/vcol.result index d51ab038576..24b54928dfc 100644 --- a/mysql-test/suite/storage_engine/vcol.result +++ b/mysql-test/suite/storage_engine/vcol.result @@ -7,8 +7,8 @@ b int(11) # # VIRTUAL INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a,b) VALUES (3,3),(4,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored SELECT a,b FROM t1; a b 1 2 @@ -24,8 +24,8 @@ b int(11) # # PERSISTENT INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a,b) VALUES (3,3),(4,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored SELECT a,b FROM t1; a b 1 2 @@ -41,8 +41,8 @@ b int(11) # # VIRTUAL INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a,b) VALUES (3,3),(4,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored SELECT a,b FROM t1; a b 1 2 @@ -58,8 +58,8 @@ b int(11) # # PERSISTENT INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a,b) VALUES (3,3),(4,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored SELECT a,b FROM t1; a b 1 2 diff --git a/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result b/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result index af03cc4d482..cc81fabe2f0 100644 --- a/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result @@ -25,8 +25,8 @@ a b c # INSERT INTO tbl_name VALUES... a non-NULL value is specified against vcols insert into t1 values (1,2,3); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +Warning 1906 The value specified for computed column 'c' in table 't1' has been ignored select * from t1; a b c 1 -1 -1 @@ -65,8 +65,8 @@ a b c # against vcols insert into t1 (a,b) values (1,3), (2,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored select * from t1; a b c 1 -1 -1 @@ -107,8 +107,8 @@ a b c create table t2 like t1; insert into t2 select * from t1; Warnings: -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'c' in table 't2' ignored +Warning 1906 The value specified for computed column 'b' in table 't2' has been ignored +Warning 1906 The value specified for computed column 'c' in table 't2' has been ignored select * from t1; a b c 2 -2 -2 @@ -123,8 +123,8 @@ a b c create table t2 like t1; insert into t2 (a,b) select a,b from t1; Warnings: -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'b' in table 't2' ignored +Warning 1906 The value specified for computed column 'b' in table 't2' has been ignored +Warning 1906 The value specified for computed column 'b' in table 't2' has been ignored select * from t2; a b c 2 -2 -2 @@ -159,7 +159,7 @@ a b c 2 -2 -2 update t1 set c=3 where a=2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for computed column 'c' in table 't1' has been ignored select * from t1; a b c 1 -1 -1 @@ -189,7 +189,7 @@ a b c 2 -2 -2 update t1 set c=3 where b=-2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for computed column 'c' in table 't1' has been ignored select * from t1; a b c 1 -1 -1 diff --git a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result index 351dfd2858c..eccf1199790 100644 --- a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result @@ -25,8 +25,8 @@ a b c # INSERT INTO tbl_name VALUES... a non-NULL value is specified against vcols insert into t1 values (1,2,3); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +Warning 1906 The value specified for computed column 'c' in table 't1' has been ignored select * from t1; a b c 1 -1 -1 @@ -65,8 +65,8 @@ a b c # against vcols insert into t1 (a,b) values (1,3), (2,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored select * from t1; a b c 1 -1 -1 @@ -107,8 +107,8 @@ a b c create table t2 like t1; insert into t2 select * from t1; Warnings: -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'c' in table 't2' ignored +Warning 1906 The value specified for computed column 'b' in table 't2' has been ignored +Warning 1906 The value specified for computed column 'c' in table 't2' has been ignored select * from t1; a b c 2 -2 -2 @@ -123,8 +123,8 @@ a b c create table t2 like t1; insert into t2 (a,b) select a,b from t1; Warnings: -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'b' in table 't2' ignored +Warning 1906 The value specified for computed column 'b' in table 't2' has been ignored +Warning 1906 The value specified for computed column 'b' in table 't2' has been ignored select * from t2; a b c 2 -2 -2 @@ -159,7 +159,7 @@ a b c 2 -2 -2 update t1 set c=3 where a=2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for computed column 'c' in table 't1' has been ignored select * from t1; a b c 1 -1 -1 @@ -189,7 +189,7 @@ a b c 2 -2 -2 update t1 set c=3 where b=-2; Warnings: -Warning 1906 The value specified for computed column 'c' in table 't1' ignored +Warning 1906 The value specified for computed column 'c' in table 't1' has been ignored select * from t1; a b c 1 -1 -1 diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 92be94cbb81..51db575db8c 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -108,10 +108,10 @@ DROP TABLE t1,t2; CREATE TABLE t1 (p int, a double NOT NULL, v double AS (ROUND(a,p)) VIRTUAL); INSERT INTO t1 VALUES (0,1,0); Warnings: -Warning 1906 The value specified for computed column 'v' in table 't1' ignored +Warning 1906 The value specified for computed column 'v' in table 't1' has been ignored INSERT INTO t1 VALUES (NULL,0,0); Warnings: -Warning 1906 The value specified for computed column 'v' in table 't1' ignored +Warning 1906 The value specified for computed column 'v' in table 't1' has been ignored SELECT a, p, v, ROUND(a,p), ROUND(a,p+NULL) FROM t1; a p v ROUND(a,p) ROUND(a,p+NULL) 1 0 1 1 NULL @@ -306,15 +306,15 @@ d varchar(5) latin1_swedish_ci YES NULL PERSISTENT # INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,NULL); UPDATE `test`.`t1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND `d`='a'; Warnings: -Warning 1906 The value specified for computed column 'd' in table 't1' ignored +Warning 1906 The value specified for computed column 'd' in table 't1' has been ignored INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a'); Warnings: -Warning 1906 The value specified for computed column 'd' in table 't1' ignored +Warning 1906 The value specified for computed column 'd' in table 't1' has been ignored set sql_mode='strict_all_tables'; UPDATE `test`.`t1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND `d`='a'; -ERROR HY000: The value specified for computed column 'd' in table 't1' ignored +ERROR HY000: The value specified for computed column 'd' in table 't1' has been ignored INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a'); -ERROR HY000: The value specified for computed column 'd' in table 't1' ignored +ERROR HY000: The value specified for computed column 'd' in table 't1' has been ignored drop table t1; # # MDEV-5611: self-referencing virtual column diff --git a/mysql-test/suite/vcol/r/vcol_select_myisam.result b/mysql-test/suite/vcol/r/vcol_select_myisam.result index 6dee132b3e5..9e0259087c5 100644 --- a/mysql-test/suite/vcol/r/vcol_select_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_select_myisam.result @@ -273,9 +273,9 @@ INSERT INTO t1 VALUES (NULL),( 78), (185), (0), (154); CREATE TABLE t2 (a int, b int AS (a) VIRTUAL); INSERT INTO t2 VALUES (187,187), (9,9), (187,187); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'b' in table 't2' ignored -Warning 1906 The value specified for computed column 'b' in table 't2' ignored +Warning 1906 The value specified for computed column 'b' in table 't2' has been ignored +Warning 1906 The value specified for computed column 'b' in table 't2' has been ignored +Warning 1906 The value specified for computed column 'b' in table 't2' has been ignored EXPLAIN EXTENDED SELECT * FROM t1 JOIN t2 USING (b); id select_type table type possible_keys key key_len ref rows filtered Extra diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 57ff5902178..ee89d8df7b5 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6511,7 +6511,7 @@ ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN eng "Cannot define foreign key with %s clause on a computed column" ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN - eng "The value specified for computed column '%s' in table '%s' ignored" + eng "The value specified for computed column '%s' in table '%s' has been ignored" ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN eng "This is not yet supported for computed columns" ER_CONST_EXPR_IN_VCOL diff --git a/storage/innobase/mysql-test/storage_engine/vcol.rdiff b/storage/innobase/mysql-test/storage_engine/vcol.rdiff index 23b26a52228..16456825b68 100644 --- a/storage/innobase/mysql-test/storage_engine/vcol.rdiff +++ b/storage/innobase/mysql-test/storage_engine/vcol.rdiff @@ -10,8 +10,8 @@ -INSERT INTO t1 (a) VALUES (1),(2); -INSERT INTO t1 (a,b) VALUES (3,3),(4,4); -Warnings: --Warning 1906 The value specified for computed column 'b' in table 't1' ignored --Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored -SELECT a,b FROM t1; -a b -1 2 @@ -27,8 +27,8 @@ -INSERT INTO t1 (a) VALUES (1),(2); -INSERT INTO t1 (a,b) VALUES (3,3),(4,4); -Warnings: --Warning 1906 The value specified for computed column 'b' in table 't1' ignored --Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored -SELECT a,b FROM t1; -a b -1 2 @@ -44,8 +44,8 @@ -INSERT INTO t1 (a) VALUES (1),(2); -INSERT INTO t1 (a,b) VALUES (3,3),(4,4); -Warnings: --Warning 1906 The value specified for computed column 'b' in table 't1' ignored --Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored -SELECT a,b FROM t1; -a b -1 2 @@ -61,8 +61,8 @@ -INSERT INTO t1 (a) VALUES (1),(2); -INSERT INTO t1 (a,b) VALUES (3,3),(4,4); -Warnings: --Warning 1906 The value specified for computed column 'b' in table 't1' ignored --Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored -SELECT a,b FROM t1; -a b -1 2 diff --git a/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff b/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff index 8b2710be221..18678a07d99 100644 --- a/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff +++ b/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff @@ -10,8 +10,8 @@ -INSERT INTO t1 (a) VALUES (1),(2); -INSERT INTO t1 (a,b) VALUES (3,3),(4,4); -Warnings: --Warning 1906 The value specified for computed column 'b' in table 't1' ignored --Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored -SELECT a,b FROM t1; -a b -1 2 @@ -27,8 +27,8 @@ -INSERT INTO t1 (a) VALUES (1),(2); -INSERT INTO t1 (a,b) VALUES (3,3),(4,4); -Warnings: --Warning 1906 The value specified for computed column 'b' in table 't1' ignored --Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored -SELECT a,b FROM t1; -a b -1 2 @@ -44,8 +44,8 @@ -INSERT INTO t1 (a) VALUES (1),(2); -INSERT INTO t1 (a,b) VALUES (3,3),(4,4); -Warnings: --Warning 1906 The value specified for computed column 'b' in table 't1' ignored --Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored -SELECT a,b FROM t1; -a b -1 2 @@ -61,8 +61,8 @@ -INSERT INTO t1 (a) VALUES (1),(2); -INSERT INTO t1 (a,b) VALUES (3,3),(4,4); -Warnings: --Warning 1906 The value specified for computed column 'b' in table 't1' ignored --Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' has been ignored -SELECT a,b FROM t1; -a b -1 2 From cfe0fe1ad1f7c75102285d445c3ba8167f5b9c44 Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Sat, 26 Jan 2019 19:12:17 +0100 Subject: [PATCH 05/47] Fix tests in 2020 unfortunately, the year 2038 problem prevented me from pushing the deadline even further into the future. --- mysql-test/r/ddl_i18n_koi8r.result | 76 +-- mysql-test/r/ddl_i18n_utf8.result | 76 +-- mysql-test/r/events_1.result | 4 +- mysql-test/r/show_check.result | 4 +- .../suite/binlog/r/binlog_mysqlbinlog2.result | 642 +++++++++--------- .../suite/binlog/t/binlog_mysqlbinlog2.test | 22 +- mysql-test/t/ddl_i18n_koi8r.test | 8 +- mysql-test/t/ddl_i18n_utf8.test | 8 +- mysql-test/t/events_1.test | 4 +- mysql-test/t/show_check.test | 2 +- 10 files changed, 423 insertions(+), 423 deletions(-) diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result index fbed2ac1565..6f57d52eb3d 100644 --- a/mysql-test/r/ddl_i18n_koi8r.result +++ b/mysql-test/r/ddl_i18n_koi8r.result @@ -2174,7 +2174,7 @@ CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unico CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| use mysqltest1| -CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT ev1 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10); SELECT @@ -2186,7 +2186,7 @@ COLLATION(_utf8 'ั‚ะตะบัั‚') AS c4, @@character_set_client AS c6; END| -CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT ev2 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT @@ -2198,7 +2198,7 @@ COLLATION(_utf8 'ั‚ะตะบัั‚') AS c4, @@character_set_client AS c6; END| -CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT @@ -2210,7 +2210,7 @@ COLLATION(_utf8 'ั‚ะตะบัั‚') AS c4, @@character_set_client AS c6; END| -CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT @@ -2226,7 +2226,7 @@ END| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10); SELECT COLLATION(ะลาลอ1) AS c1, @@ -2239,7 +2239,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2252,7 +2252,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2265,7 +2265,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2279,11 +2279,11 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev1'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 koi8r koi8r_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev2'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 koi8r koi8r_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev3'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation @@ -2303,7 +2303,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2316,7 +2316,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2329,7 +2329,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2342,7 +2342,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| @@ -2361,7 +2361,7 @@ set names koi8r| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10); SELECT COLLATION(ะลาลอ1) AS c1, @@ -2374,7 +2374,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2387,7 +2387,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2400,7 +2400,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2414,11 +2414,11 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev1'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 koi8r koi8r_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev2'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 koi8r koi8r_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev3'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation @@ -2438,7 +2438,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2451,7 +2451,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2464,7 +2464,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2477,7 +2477,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci ---> Dump of mysqltest1 @@ -2497,7 +2497,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET sql_mode = '' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10); SELECT COLLATION(ะลาลอ1) AS c1, @@ -2525,7 +2525,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET sql_mode = '' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2564,7 +2564,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET sql_mode = '' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2592,7 +2592,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET sql_mode = '' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2634,7 +2634,7 @@ set names koi8r| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10); SELECT COLLATION(ะลาลอ1) AS c1, @@ -2647,7 +2647,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2660,7 +2660,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2673,7 +2673,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะลาลอ1) AS c1, @@ -2687,11 +2687,11 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev1'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 koi8r koi8r_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev2'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 koi8r koi8r_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev3'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation @@ -2711,7 +2711,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2724,7 +2724,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2737,7 +2737,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2750,7 +2750,7 @@ COLLATION( ' COLLATION( 'ิลหำิ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci ------------------------------------------------------------------- DDL statements within stored routine. diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result index 98da459dafc..19ae7f06e99 100644 --- a/mysql-test/r/ddl_i18n_utf8.result +++ b/mysql-test/r/ddl_i18n_utf8.result @@ -2174,7 +2174,7 @@ CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unico CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci| use mysqltest1| -CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT ev1 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10); SELECT @@ -2186,7 +2186,7 @@ COLLATION(_koi8r ' @@character_set_client AS c6; END| -CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT ev2 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT @@ -2198,7 +2198,7 @@ COLLATION(_koi8r ' @@character_set_client AS c6; END| -CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT @@ -2210,7 +2210,7 @@ COLLATION(_koi8r ' @@character_set_client AS c6; END| -CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT @@ -2226,7 +2226,7 @@ END| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10); SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2239,7 +2239,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2252,7 +2252,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2265,7 +2265,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2279,11 +2279,11 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev1'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 utf8 utf8_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev2'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 utf8 utf8_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev3'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation @@ -2303,7 +2303,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2316,7 +2316,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2329,7 +2329,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2342,7 +2342,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| @@ -2361,7 +2361,7 @@ set names utf8| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10); SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2374,7 +2374,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2387,7 +2387,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2400,7 +2400,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2414,11 +2414,11 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev1'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 utf8 utf8_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev2'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 utf8 utf8_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev3'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation @@ -2438,7 +2438,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2451,7 +2451,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2464,7 +2464,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2477,7 +2477,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci ---> Dump of mysqltest1 @@ -2497,7 +2497,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET sql_mode = '' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10); SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2525,7 +2525,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET sql_mode = '' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2564,7 +2564,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET sql_mode = '' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2592,7 +2592,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET sql_mode = '' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2634,7 +2634,7 @@ set names utf8| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10); SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2647,7 +2647,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2660,7 +2660,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2673,7 +2673,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ะฟะตั€ะตะผ1) AS c1, @@ -2687,11 +2687,11 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev1'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci +mysqltest1 ev1 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 utf8 utf8_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev2'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci +mysqltest1 ev2 root@localhost SYSTEM ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 utf8 utf8_general_ci utf8_unicode_ci SHOW EVENTS LIKE 'ev3'| Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation @@ -2711,7 +2711,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2724,7 +2724,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2737,7 +2737,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2750,7 +2750,7 @@ COLLATION( 'ั‚ะตะบัั‚') AS c3, COLLATION( 'ั‚ะตะบัั‚') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 1970-01-02 00:00:00 NULL NULL NULL NULL DISABLED PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci ------------------------------------------------------------------- DDL statements within stored routine. diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result index e03ccf51d8b..9c8308c79a6 100644 --- a/mysql-test/r/events_1.result +++ b/mysql-test/r/events_1.result @@ -49,7 +49,7 @@ SECOND 10 SELECT 1 SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; execute_at IS NULL starts IS NULL ends IS NULL comment 1 0 1 -ALTER EVENT event_starts_test ON SCHEDULE AT '2020-02-02 20:00:02'; +ALTER EVENT event_starts_test ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE; SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; execute_at IS NULL starts IS NULL ends IS NULL comment 0 1 1 @@ -62,7 +62,7 @@ SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.even execute_at IS NULL starts IS NULL ends IS NULL comment 0 1 1 DROP EVENT event_starts_test; -CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '2020-02-02 20:00:02' ENDS '2022-02-02 20:00:02' DO SELECT 2; +CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '1970-01-02 00:00:00' ENDS '1970-01-03 00:00:00' ON COMPLETION PRESERVE DISABLE DO SELECT 2; SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; execute_at IS NULL starts IS NULL ends IS NULL comment 1 0 0 diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 8d4c3feb100..d8480427fd2 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1424,7 +1424,7 @@ CREATE TABLE t1(c1 CHAR(10)); CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET NEW.c1 = 'ิลำิ'; -CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT 'ิลำิ' AS test; +CREATE EVENT ev1 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO SELECT 'ิลำิ' AS test; set names utf8; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -1444,7 +1444,7 @@ FOR EACH ROW SET NEW.c1 = 'ั‚ะตัั‚' koi8r koi8r_general_ci latin1_swedish_ci SHOW CREATE EVENT ev1; Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'ั‚ะตัั‚' AS test koi8r koi8r_general_ci latin1_swedish_ci +ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO SELECT 'ั‚ะตัั‚' AS test koi8r koi8r_general_ci latin1_swedish_ci DROP VIEW v1; DROP PROCEDURE p1; DROP FUNCTION f1; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result index b86e715869f..7e918dad590 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result @@ -1,7 +1,7 @@ drop table if exists t1; -reset master; -set @a=UNIX_TIMESTAMP("2020-01-21 15:32:22"); +set @a=UNIX_TIMESTAMP("1970-01-21 15:32:22"); set timestamp=@a; +reset master; create table t1 (a int auto_increment not null primary key, b char(3)); insert into t1 values(null, "a"); insert into t1 values(null, "b"); @@ -21,7 +21,7 @@ insert into t1 values(null, "f"); DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -32,54 +32,54 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; @@ -94,7 +94,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -107,50 +107,50 @@ BEGIN /*!*/; SET INSERT_ID=1/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; @@ -165,7 +165,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -178,30 +178,30 @@ BEGIN /*!*/; SET INSERT_ID=3/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; @@ -217,7 +217,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -228,24 +228,24 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; DELIMITER ; @@ -260,7 +260,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -273,7 +273,7 @@ BEGIN /*!*/; SET INSERT_ID=3/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; DELIMITER ; @@ -288,7 +288,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -301,30 +301,30 @@ BEGIN /*!*/; SET INSERT_ID=3/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; @@ -340,7 +340,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -351,24 +351,24 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; DELIMITER ; @@ -385,7 +385,7 @@ flush logs; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -396,59 +396,59 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; DELIMITER /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -461,10 +461,10 @@ BEGIN /*!*/; SET INSERT_ID=6/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; insert into t1 values(null, "f") /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; COMMIT /*!*/; DELIMITER ; @@ -479,7 +479,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -492,55 +492,55 @@ BEGIN /*!*/; SET INSERT_ID=1/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; DELIMITER /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -553,10 +553,10 @@ BEGIN /*!*/; SET INSERT_ID=6/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; insert into t1 values(null, "f") /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; COMMIT /*!*/; DELIMITER ; @@ -571,7 +571,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -584,35 +584,35 @@ BEGIN /*!*/; SET INSERT_ID=3/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; DELIMITER /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -625,10 +625,10 @@ BEGIN /*!*/; SET INSERT_ID=6/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; insert into t1 values(null, "f") /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; COMMIT /*!*/; DELIMITER ; @@ -644,7 +644,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -655,59 +655,59 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; DELIMITER /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -731,7 +731,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -744,35 +744,35 @@ BEGIN /*!*/; SET INSERT_ID=3/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; DELIMITER /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -785,10 +785,10 @@ BEGIN /*!*/; SET INSERT_ID=6/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; insert into t1 values(null, "f") /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; COMMIT /*!*/; DELIMITER ; @@ -804,7 +804,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -815,24 +815,24 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; DELIMITER ; @@ -848,7 +848,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -859,54 +859,54 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; @@ -921,7 +921,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -934,50 +934,50 @@ BEGIN /*!*/; SET INSERT_ID=1/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; @@ -991,7 +991,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1004,30 +1004,30 @@ BEGIN /*!*/; SET INSERT_ID=3/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; @@ -1043,7 +1043,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1054,24 +1054,24 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; DELIMITER ; @@ -1085,7 +1085,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1098,7 +1098,7 @@ BEGIN /*!*/; SET INSERT_ID=3/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; DELIMITER ; @@ -1113,7 +1113,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1126,30 +1126,30 @@ BEGIN /*!*/; SET INSERT_ID=3/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; @@ -1165,7 +1165,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1176,24 +1176,24 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; DELIMITER ; @@ -1209,7 +1209,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1220,59 +1220,59 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; DELIMITER /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1285,10 +1285,10 @@ BEGIN /*!*/; SET INSERT_ID=6/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; insert into t1 values(null, "f") /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; COMMIT /*!*/; DELIMITER ; @@ -1303,7 +1303,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1316,55 +1316,55 @@ BEGIN /*!*/; SET INSERT_ID=1/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; DELIMITER /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1377,10 +1377,10 @@ BEGIN /*!*/; SET INSERT_ID=6/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; insert into t1 values(null, "f") /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; COMMIT /*!*/; DELIMITER ; @@ -1394,7 +1394,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1407,35 +1407,35 @@ BEGIN /*!*/; SET INSERT_ID=3/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; DELIMITER /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1448,10 +1448,10 @@ BEGIN /*!*/; SET INSERT_ID=6/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; insert into t1 values(null, "f") /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; COMMIT /*!*/; DELIMITER ; @@ -1467,7 +1467,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1478,59 +1478,59 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; DELIMITER /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1553,7 +1553,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1566,35 +1566,35 @@ BEGIN /*!*/; SET INSERT_ID=3/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; DELIMITER ; DELIMITER /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1607,10 +1607,10 @@ BEGIN /*!*/; SET INSERT_ID=6/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; insert into t1 values(null, "f") /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; COMMIT /*!*/; DELIMITER ; @@ -1626,7 +1626,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1637,24 +1637,24 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; DELIMITER ; @@ -1670,7 +1670,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; ROLLBACK/*!*/; use `test`/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; @@ -1681,64 +1681,64 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "a") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; BEGIN /*!*/; SET INSERT_ID=2/*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; insert into t1 values(null, "b") /*!*/; -SET TIMESTAMP=1579609942/*!*/; +SET TIMESTAMP=1773142/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; insert into t1 values(null, "c") /*!*/; -SET TIMESTAMP=1579609944/*!*/; +SET TIMESTAMP=1773144/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=4/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "d") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; BEGIN /*!*/; SET INSERT_ID=5/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; insert into t1 values(null, "e") /*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1773146/*!*/; COMMIT /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; insert into t1 values(null, "f") /*!*/; -SET TIMESTAMP=1579609943/*!*/; +SET TIMESTAMP=1773143/*!*/; COMMIT /*!*/; DELIMITER ; diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test index 740c4078f20..50143683548 100644 --- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test +++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test @@ -8,15 +8,15 @@ --disable_warnings drop table if exists t1; --enable_warnings -reset master; # We need this for getting fixed timestamps inside of this test. -# I use a date in the future to keep a growing timestamp along the +# I use a date in the past to keep a growing timestamp along the # binlog (including the Start_log_event). This test will work # unchanged everywhere, because mysql-test-run has fixed TZ, which it # exports (so mysqlbinlog has same fixed TZ). -set @a=UNIX_TIMESTAMP("2020-01-21 15:32:22"); +set @a=UNIX_TIMESTAMP("1970-01-21 15:32:22"); set timestamp=@a; +reset master; create table t1 (a int auto_increment not null primary key, b char(3)); insert into t1 values(null, "a"); insert into t1 values(null, "b"); @@ -70,11 +70,11 @@ let $stop_pos= `select @binlog_start_pos + 770`; --disable_query_log select "--- start-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 +--exec $MYSQL_BINLOG --short-form "--start-datetime=1970-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- stop-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 +--exec $MYSQL_BINLOG --short-form "--stop-datetime=1970-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- Local with 2 binlogs on command line --" as ""; @@ -102,11 +102,11 @@ let $stop_pos= `select @binlog_start_pos + 69`; --disable_query_log select "--- start-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 +--exec $MYSQL_BINLOG --short-form "--start-datetime=1970-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- stop-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 +--exec $MYSQL_BINLOG --short-form "--stop-datetime=1970-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- Remote --" as ""; @@ -137,11 +137,11 @@ let $stop_pos= `select @binlog_start_pos + 770`; --disable_query_log select "--- start-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--exec $MYSQL_BINLOG --short-form "--start-datetime=1970-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- stop-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--exec $MYSQL_BINLOG --short-form "--stop-datetime=1970-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- Remote with 2 binlogs on command line --" as ""; @@ -166,11 +166,11 @@ let $stop_pos= `select @binlog_start_pos + 28`; --disable_query_log select "--- start-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--start-datetime=20200121153224" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 +--exec $MYSQL_BINLOG --short-form "--start-datetime=19700121153224" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- stop-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--stop-datetime=2020/01/21 15@32@24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 +--exec $MYSQL_BINLOG --short-form "--stop-datetime=1970/01/21 15@32@24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- to-last-log --" as ""; diff --git a/mysql-test/t/ddl_i18n_koi8r.test b/mysql-test/t/ddl_i18n_koi8r.test index 40f8d07c55d..9b91823a454 100644 --- a/mysql-test/t/ddl_i18n_koi8r.test +++ b/mysql-test/t/ddl_i18n_koi8r.test @@ -821,7 +821,7 @@ use mysqltest1| # - Event ev1 -CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT ev1 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10); @@ -838,7 +838,7 @@ END| # - Event ev2 -CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT ev2 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; @@ -855,7 +855,7 @@ END| # - Event ev3 -CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; @@ -872,7 +872,7 @@ END| # - Event ev4 -CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะลาลอ1 CHAR(10) CHARACTER SET utf8; diff --git a/mysql-test/t/ddl_i18n_utf8.test b/mysql-test/t/ddl_i18n_utf8.test index 35109e62100..ed4e201d1e4 100644 --- a/mysql-test/t/ddl_i18n_utf8.test +++ b/mysql-test/t/ddl_i18n_utf8.test @@ -821,7 +821,7 @@ use mysqltest1| # - Event ev1 -CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT ev1 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10); @@ -838,7 +838,7 @@ END| # - Event ev2 -CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT ev2 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; @@ -855,7 +855,7 @@ END| # - Event ev3 -CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; @@ -872,7 +872,7 @@ END| # - Event ev4 -CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO +CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO BEGIN DECLARE ะฟะตั€ะตะผ1 CHAR(10) CHARACTER SET utf8; diff --git a/mysql-test/t/events_1.test b/mysql-test/t/events_1.test index 032d5ecd380..ca47decf465 100644 --- a/mysql-test/t/events_1.test +++ b/mysql-test/t/events_1.test @@ -67,7 +67,7 @@ drop event event2; CREATE EVENT event_starts_test ON SCHEDULE EVERY 10 SECOND COMMENT "" DO SELECT 1; SELECT interval_field, interval_value, body FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; -ALTER EVENT event_starts_test ON SCHEDULE AT '2020-02-02 20:00:02'; +ALTER EVENT event_starts_test ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE; SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test COMMENT "non-empty comment"; SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; @@ -75,7 +75,7 @@ ALTER EVENT event_starts_test COMMENT ""; SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; DROP EVENT event_starts_test; -CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '2020-02-02 20:00:02' ENDS '2022-02-02 20:00:02' DO SELECT 2; +CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '1970-01-02 00:00:00' ENDS '1970-01-03 00:00:00' ON COMPLETION PRESERVE DISABLE DO SELECT 2; SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; ALTER EVENT event_starts_test COMMENT "non-empty comment"; SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test'; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index c2edef87d41..4fe088f2bc7 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -1156,7 +1156,7 @@ CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET NEW.c1 = 'ิลำิ'; -CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT 'ิลำิ' AS test; +CREATE EVENT ev1 ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE DO SELECT 'ิลำิ' AS test; # Test: switch the character set and show that SHOW CREATE output is # automatically converted to the new character_set_client. From e8907112790475772b3e5135b58ef95b3fd8ea68 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 26 Mar 2019 00:42:57 +0400 Subject: [PATCH 06/47] Fixed ps-protocol thread_pool_server_audit failure By applying 7bd258c. --- mysql-test/suite/plugins/t/thread_pool_server_audit.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.test b/mysql-test/suite/plugins/t/thread_pool_server_audit.test index 724000c9789..7347d8f99ff 100644 --- a/mysql-test/suite/plugins/t/thread_pool_server_audit.test +++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.test @@ -42,8 +42,10 @@ select 1, 3; insert into t2 values (1), (2); select * from t2; +--disable_ps_protocol --error ER_NO_SUCH_TABLE select * from t_doesnt_exist; +--enable_ps_protocol --error 1064 syntax_error_query; drop table renamed_t1, t2; From f2d549d8dbda1906b3e5ae0c2fa5589f2b9de662 Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Wed, 27 Mar 2019 12:34:03 +0530 Subject: [PATCH 07/47] MDEV-14784: Slave crashes in show_status_array upon running a trigger with select from I_S Problem: ======== When applier thread tries to access 'variable_name' of INFORMATION_SCHEMA.SESSION_VARIABLES table through triggers, it results in an abnormal exit of slave server. Analysis: ======== At the time of replication of stored routines and triggers, their associated security context will be sent by the master. The applier thread on the slave server will use this information to set the required security context for the execution of stored routines and triggers. This is achieved as follows. ->The stored routine object has a member named 'm_security_ctx' which holds the security context received from master. ->The applier thread's security_ctx is stored into a 'backup' object. ->Set the applier thread's security_ctx to 'm_security_ctx'. ->Upon the completion of stored routine execution restore the original security context of applier thread from the backup. During the above process the 'm_security_ctx' object is not initialized properly. Hence the 'external_user' of 'm_security_ctx' has invalid value for this variable and accessing this variable results in abnormal exit of server. Fix: === Invoke the Security_context::init() call from the constructor of stored routine so that 'm_security_ctx' gets initialized properly. --- .../r/rpl_slave_invalid_external_user.result | 15 +++++++ .../t/rpl_slave_invalid_external_user.test | 42 +++++++++++++++++++ sql/sp_head.cc | 1 + 3 files changed, 58 insertions(+) create mode 100644 mysql-test/suite/rpl/r/rpl_slave_invalid_external_user.result create mode 100644 mysql-test/suite/rpl/t/rpl_slave_invalid_external_user.test diff --git a/mysql-test/suite/rpl/r/rpl_slave_invalid_external_user.result b/mysql-test/suite/rpl/r/rpl_slave_invalid_external_user.result new file mode 100644 index 00000000000..29b815420ba --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_slave_invalid_external_user.result @@ -0,0 +1,15 @@ +include/master-slave.inc +[connection master] +CREATE USER test_user@localhost; +SET PASSWORD FOR test_user@localhost = password('PWD'); +GRANT ALL ON *.* TO test_user@localhost WITH GRANT OPTION; +connect conn_test,localhost,test_user,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK; +connection conn_test; +CREATE TABLE t1 (f1 INT); +CREATE TABLE t2 (f2 VARCHAR(64)); +CREATE TRIGGER tr_before BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES; +CREATE DEFINER='root'@'localhost' TRIGGER tr_after AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES; +INSERT INTO t1 VALUES (1); +DROP USER 'test_user'@'localhost'; +DROP TABLE t1, t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_slave_invalid_external_user.test b/mysql-test/suite/rpl/t/rpl_slave_invalid_external_user.test new file mode 100644 index 00000000000..5099d7ee49e --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_slave_invalid_external_user.test @@ -0,0 +1,42 @@ +# ==== Purpose ==== +# +# Test verifies that when applier thread tries to access 'variable_name' of +# INFORMATION_SCHEMA.SESSION_VARIABLES table through triggers it successfully +# retrieves all the session variables. +# +# ==== Implementation ==== +# +# Steps: +# 0 - Create two tables t1 and t2. +# 1 - Create a trigger such that it reads the names of all session variables +# from INFORMATION_SCHEMA.SESSION_VARIABLES table and populates one of the +# tables. +# 2 - Do a DML on master and wait for it to be replicated and ensure that +# slave is in sync with master and it is up and running. +# +# ==== References ==== +# +# MDEV-14784: Slave crashes in show_status_array upon running a trigger with +# select from I_S + +--source include/master-slave.inc +--source include/have_binlog_format_mixed.inc +--enable_connect_log +CREATE USER test_user@localhost; +SET PASSWORD FOR test_user@localhost = password('PWD'); +GRANT ALL ON *.* TO test_user@localhost WITH GRANT OPTION; +connect(conn_test,localhost,test_user,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK); + +--connection conn_test +CREATE TABLE t1 (f1 INT); +CREATE TABLE t2 (f2 VARCHAR(64)); +CREATE TRIGGER tr_before BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES; +CREATE DEFINER='root'@'localhost' TRIGGER tr_after AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES; + +INSERT INTO t1 VALUES (1); +--disable_connect_log +# Cleanup +--connection master +DROP USER 'test_user'@'localhost'; +DROP TABLE t1, t2; +--source include/rpl_end.inc diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 14a57914560..fec7f51eaf0 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -563,6 +563,7 @@ sp_head::sp_head() DBUG_ENTER("sp_head::sp_head"); + m_security_ctx.init(); m_backpatch.empty(); m_cont_backpatch.empty(); m_lex.empty(); From 828cc2ba7cdbe47c55fd679437e6e7f0bc714dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 27 Mar 2019 11:34:53 +0200 Subject: [PATCH 08/47] MDEV-18417/MDEV-18656/MDEV-18417: Work around compiler ASAN bug In a Ubuntu Xenial build environment, the compiler identified as g++-5.real (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 seems to be emitting incorrect code for the compilation unit trx0rec.cc, triggering a bogus-looking AddressSanitizer report of an invalid read of something in the function trx_undo_rec_get_pars(). This is potentially affecting any larger tests where the InnoDB purge subsystem is being exercised. When the optimization level of trx0rec.cc is limited to -O1, no bogus failure is being reported. With -O2 or -O3, a lot of things seemed to be inlined in the function, and the disassembly of the generated code did not make sense to me. --- storage/innobase/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 18efa58b2a3..c3cb0ce94c6 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -1,4 +1,5 @@ # Copyright (c) 2006, 2017, 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 @@ -74,6 +75,12 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DUNIV_DEBUG -DUNIV_SYNC_DEB CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU) IF(NOT MSVC) + # Work around MDEV-18417, MDEV-18656, MDEV-18417 + IF(WITH_ASAN AND CMAKE_COMPILER_IS_GNUCC AND + CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0") + SET_SOURCE_FILES_PROPERTIES(trx/trx0rec.cc PROPERTIES COMPILE_FLAGS -O1) + ENDIF() + # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not # workaround for old gcc on x86, gcc atomic ops only work under -march=i686 IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND From f3ff45f955ec90d22c0c94d11451d6e36b48b7eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 27 Mar 2019 15:00:12 +0200 Subject: [PATCH 09/47] MDEV-15658: Assertion failed in lock_rec_other_trx_holds_expl_callback Fix a race condition that was introduced in debug code by MDEV-14638. lock_rec_other_trx_holds_expl(): After acquiring the lock_sys->mutex, check if the transaction might have been committed. Otherwise, the assertion in the trx_sys.rw_trx_hash traversal callback could fail. --- storage/innobase/lock/lock0lock.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index c8707955a5d..8414ed82e34 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2018, MariaDB Corporation. +Copyright (c) 2014, 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 @@ -5527,6 +5527,20 @@ static void lock_rec_other_trx_holds_expl(trx_t *caller_trx, trx_t *trx, { ut_ad(!page_rec_is_metadata(rec)); lock_mutex_enter(); + ut_ad(trx->is_referenced()); + /* Prevent a data race with trx_prepare(), which could change the + state from ACTIVE to PREPARED. Other state changes should be + blocked by lock_mutex_own() and trx->is_referenced(). */ + trx_mutex_enter(trx); + const trx_state_t state = trx->state; + trx_mutex_exit(trx); + ut_ad(state != TRX_STATE_NOT_STARTED); + if (state == TRX_STATE_COMMITTED_IN_MEMORY) + { + /* The transaction was committed before our lock_mutex_enter(). */ + lock_mutex_exit(); + return; + } lock_rec_other_trx_holds_expl_arg arg= { page_rec_get_heap_no(rec), block, trx }; trx_sys.rw_trx_hash.iterate(caller_trx, From 9a8b8ea66b041719c2e95ed6beaf286628c935b4 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 27 Mar 2019 14:37:14 +0100 Subject: [PATCH 10/47] MDEV-19060 : mariabackup continues, despite failing to open a tablespace Fix mariabackup to crash if opening tablespace fails, insitead of continuing after an error. --- storage/xtradb/fil/fil0fil.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc index d6d2a6f887c..01ebd98929f 100644 --- a/storage/xtradb/fil/fil0fil.cc +++ b/storage/xtradb/fil/fil0fil.cc @@ -4827,12 +4827,6 @@ will_not_choose: srv_force_recovery); return; } - - /* In mariabackup lets not crash. */ - if (IS_XTRABACKUP()) { - return; - } - abort(); } From f97d879bf890fe1d93c459f46410e2be8d26d3b6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 16 Mar 2019 19:24:49 +0100 Subject: [PATCH 11/47] cmake: re-enable -Werror in the maintainer mode now we can afford it. Fix -Werror errors. Note: * old gcc is bad at detecting uninit variables, disable it. * time_t is int or long, cast it for printf's --- cmake/maintainer.cmake | 9 ++++++-- include/mysql/client_plugin.h | 26 +++++++++++++----------- sql-common/client.c | 6 +++--- sql/log.cc | 6 +++--- sql/sql_admin.cc | 4 ++-- sql/wsrep_sst.cc | 9 ++++---- storage/connect/CMakeLists.txt | 21 +++++++++++-------- storage/connect/ha_connect.h | 4 ++++ storage/connect/mycat.cc | 4 ---- storage/innobase/btr/btr0scrub.cc | 4 ++-- storage/innobase/fil/fil0crypt.cc | 4 ++-- storage/innobase/handler/ha_innodb.cc | 2 +- storage/innobase/include/univ.i | 2 -- storage/innobase/lock/lock0lock.cc | 2 +- storage/innobase/os/os0file.cc | 2 +- storage/innobase/row/row0mysql.cc | 8 ++++---- storage/mroonga/lib/mrn_context_pool.cpp | 2 +- storage/spider/spd_table.cc | 6 +++--- storage/xtradb/btr/btr0scrub.cc | 4 ++-- storage/xtradb/fil/fil0crypt.cc | 4 ++-- storage/xtradb/handler/ha_innodb.cc | 2 +- storage/xtradb/include/univ.i | 2 -- storage/xtradb/lock/lock0lock.cc | 2 +- storage/xtradb/row/row0mysql.cc | 8 ++++---- unittest/sql/mf_iocache-t.cc | 2 +- 25 files changed, 76 insertions(+), 69 deletions(-) diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake index 4e902d7fed8..caba370c4ae 100644 --- a/cmake/maintainer.cmake +++ b/cmake/maintainer.cmake @@ -28,10 +28,15 @@ SET(MY_WARNING_FLAGS -Woverloaded-virtual -Wvla -Wwrite-strings + -Werror ) -IF(MYSQL_MAINTAINER_MODE MATCHES "ON") - SET(WHERE) +IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0") + SET(MY_WARNING_FLAGS ${MY_WARNING_FLAGS} -Wno-error=maybe-uninitialized) +ENDIF() + +IF(MYSQL_MAINTAINER_MODE MATCHES "OFF") + RETURN() ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO") SET(WHERE DEBUG) ENDIF() diff --git a/include/mysql/client_plugin.h b/include/mysql/client_plugin.h index b2df0019dfe..84fb3c6798d 100644 --- a/include/mysql/client_plugin.h +++ b/include/mysql/client_plugin.h @@ -32,17 +32,18 @@ */ #undef MYSQL_PLUGIN_EXPORT #if defined(_MSC_VER) - #ifdef __cplusplus - #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) - #else - #define MYSQL_PLUGIN_EXPORT __declspec(dllexport) - #endif + #define MYSQL_PLUGIN_EXPORT_C __declspec(dllexport) #else /*_MSC_VER */ - #ifdef __cplusplus - #define MYSQL_PLUGIN_EXPORT extern "C" - #else - #define MYSQL_PLUGIN_EXPORT - #endif + #define MYSQL_PLUGIN_EXPORT_C +#endif +#ifdef __cplusplus +#define MYSQL_PLUGIN_EXPORT extern "C" MYSQL_PLUGIN_EXPORT_C +#define C_MODE_START extern "C" { +#define C_MODE_END } +#else +#define MYSQL_PLUGIN_EXPORT MYSQL_PLUGIN_EXPORT_C +#define C_MODE_START +#define C_MODE_END #endif #ifndef MYSQL_ABI_CHECK @@ -60,11 +61,12 @@ #define MYSQL_CLIENT_MAX_PLUGINS 3 #define mysql_declare_client_plugin(X) \ - MYSQL_PLUGIN_EXPORT struct st_mysql_client_plugin_ ## X \ + C_MODE_START MYSQL_PLUGIN_EXPORT_C \ + struct st_mysql_client_plugin_ ## X \ _mysql_client_plugin_declaration_ = { \ MYSQL_CLIENT_ ## X ## _PLUGIN, \ MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION, -#define mysql_end_client_plugin } +#define mysql_end_client_plugin }; C_MODE_END /* generic plugin header structure */ #define MYSQL_CLIENT_PLUGIN_HEADER \ diff --git a/sql-common/client.c b/sql-common/client.c index 4fa167a21f1..60aa558dfb3 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1354,7 +1354,7 @@ unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, { uchar *pos; /* fields count may be wrong */ - if (field - result >= fields) + if (field - result >= (my_ptrdiff_t)fields) goto err; cli_fetch_lengths(&lengths[0], row->data, default_value ? 8 : 7); @@ -1401,7 +1401,7 @@ unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, /* old protocol, for backward compatibility */ for (row=data->data; row ; row = row->next,field++) { - if (field - result >= fields) + if (field - result >= (my_ptrdiff_t)fields) goto err; cli_fetch_lengths(&lengths[0], row->data, default_value ? 6 : 5); field->org_table= field->table= strdup_root(alloc,(char*) row->data[0]); @@ -1439,7 +1439,7 @@ unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, } } #endif /* DELETE_SUPPORT_OF_4_0_PROTOCOL */ - if (field - result < fields) + if (field - result < (my_ptrdiff_t)fields) goto err; free_rows(data); /* Free old data */ DBUG_RETURN(result); diff --git a/sql/log.cc b/sql/log.cc index a1e7e5b218f..bab250223f3 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -9593,9 +9593,9 @@ TC_LOG_BINLOG::log_and_order(THD *thd, my_xid xid, bool all, */ if (!xid || !need_unlog) DBUG_RETURN(BINLOG_COOKIE_DUMMY(cache_mngr->delayed_error)); - else - DBUG_RETURN(BINLOG_COOKIE_MAKE(cache_mngr->binlog_id, - cache_mngr->delayed_error)); + + DBUG_RETURN(BINLOG_COOKIE_MAKE(cache_mngr->binlog_id, + cache_mngr->delayed_error)); } /* diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index cbc9780d507..0ec6719037c 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -528,7 +528,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, if (!table->table->part_info) { my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0)); - goto err2; + thd->resume_subsequent_commits(suspended_wfc); + DBUG_RETURN(TRUE); } if (set_part_state(alter_info, table->table->part_info, PART_ADMIN)) { @@ -1159,7 +1160,6 @@ err: } close_thread_tables(thd); // Shouldn't be needed thd->mdl_context.release_transactional_locks(); -err2: thd->resume_subsequent_commits(suspended_wfc); DBUG_RETURN(TRUE); } diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index e2c55583594..addbfeb99f6 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -231,7 +231,7 @@ bool wsrep_sst_wait () total_wtime += difftime(end_time, start_time); WSREP_DEBUG("Waiting for SST to complete. current seqno: %" PRId64 " waited %f secs.", local_seqno, total_wtime); service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL, - "WSREP state transfer ongoing, current seqno: %ld waited %f secs", local_seqno, total_wtime); + "WSREP state transfer ongoing, current seqno: %" PRId64 " waited %f secs", local_seqno, total_wtime); } } @@ -294,9 +294,8 @@ void wsrep_sst_received (wsrep_t* const wsrep, } else if (local_seqno > seqno) { - WSREP_WARN("SST postion is in the past: %lld, current: %lld. " - "Can't continue.", - (long long)seqno, (long long)local_seqno); + WSREP_WARN("SST postion is in the past: %" PRId64 ", current: %" PRId64 + ". Can't continue.", seqno, local_seqno); unireg_abort(1); } @@ -1416,7 +1415,7 @@ void wsrep_SE_init_wait() total_wtime += difftime(end_time, start_time); WSREP_DEBUG("Waiting for SST to complete. current seqno: %" PRId64 " waited %f secs.", local_seqno, total_wtime); service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL, - "WSREP state transfer ongoing, current seqno: %ld waited %f secs", local_seqno, total_wtime); + "WSREP state transfer ongoing, current seqno: %" PRId64 " waited %f secs", local_seqno, total_wtime); } } diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index 0ca794df230..519e075aaaa 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -40,6 +40,10 @@ user_connect.h valblk.h value.h xindex.h xobject.h xtable.h) add_definitions( -DMARIADB -DFORCE_INIT_OF_VARS -Dconnect_EXPORTS) add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT ) +macro(DISABLE_WARNING W) + MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-error=${W}") + MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-${W}" DEBUG) +endmacro() # # OS specific C flags, definitions and source files. @@ -47,14 +51,15 @@ add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT ) IF(UNIX) MY_CHECK_AND_SET_COMPILER_FLAG("-Wall -Wmissing-declarations") if(NOT WITH_WARNINGS) - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-function") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-variable") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-value") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-parentheses") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-strict-aliasing") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-misleading-indentation") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-format-truncation") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-implicit-fallthrough") + DISABLE_WARNING("unused-function") + DISABLE_WARNING("unused-variable") + DISABLE_WARNING("unused-value") + DISABLE_WARNING("parentheses") + DISABLE_WARNING("strict-aliasing") + DISABLE_WARNING("misleading-indentation") + DISABLE_WARNING("format-truncation") + DISABLE_WARNING("implicit-fallthrough") + DISABLE_WARNING("type-limits") endif(NOT WITH_WARNINGS) add_definitions( -DUNIX -DLINUX -DUBUNTU ) diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h index 07b1c2d2e7d..13c9aa4835b 100644 --- a/storage/connect/ha_connect.h +++ b/storage/connect/ha_connect.h @@ -32,6 +32,10 @@ /****************************************************************************/ #include "mycat.h" +#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT) +bool MongoEnabled(void); +#endif // JAVA_SUPPORT || CMGO_SUPPORT + /****************************************************************************/ /* Structures used to pass info between CONNECT and ha_connect. */ /****************************************************************************/ diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index cc5675db5c8..9fb8fc8367d 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -102,10 +102,6 @@ extern "C" HINSTANCE s_hModule; // Saved module handle #endif // !__WIN__ -#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT) -bool MongoEnabled(void); -#endif // JAVA_SUPPORT || CMGO_SUPPORT - PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); /***********************************************************************/ diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc index 2e667e64d0b..0e7c0d5b061 100644 --- a/storage/innobase/btr/btr0scrub.cc +++ b/storage/innobase/btr/btr0scrub.cc @@ -145,10 +145,10 @@ btr_scrub_lock_dict_func(ulint space_id, bool lock_to_close_table, time_t now = time(0); if (now >= last + 30) { fprintf(stderr, - "WARNING: %s:%u waited " TIMETPF " seconds for" + "WARNING: %s:%u waited %ld seconds for" " dict_sys lock, space: %lu" " lock_to_close_table: %d\n", - file, line, now - start, space_id, + file, line, (long)(now - start), space_id, lock_to_close_table); last = now; diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index fb84b5703bf..296096e44d0 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -2453,9 +2453,9 @@ fil_space_crypt_close_tablespace( if (now >= last + 30) { ib_logf(IB_LOG_LEVEL_WARN, - "Waited " TIMETPF " seconds to drop space: %s (" ULINTPF + "Waited %ld seconds to drop space: %s (" ULINTPF ") active threads %u flushing=%d.", - now - start, space->name, space->id, cnt, flushing); + (long)(now - start), space->name, space->id, cnt, flushing); last = now; } } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index c670839b5cd..cd605b6b791 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -10520,7 +10520,7 @@ wsrep_append_foreign_key( key_type, copy); if (rcode) { - DBUG_PRINT("wsrep", ("row key failed: %zu", rcode)); + DBUG_PRINT("wsrep", ("row key failed: %lu", rcode)); WSREP_ERROR("Appending cascaded fk row key failed: %s, %lu", (wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void", rcode); diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 8807e2bf9e9..58ff9e1b5e4 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -454,7 +454,6 @@ macro ULINTPF. */ # define INT64PF "%lld" # define UINT64PF "%llu" # define UINT64PFx "%016llx" -# define TIMETPF "%ld" typedef __int64 ib_int64_t; typedef unsigned __int64 ib_uint64_t; typedef unsigned __int32 ib_uint32_t; @@ -464,7 +463,6 @@ typedef unsigned __int32 ib_uint32_t; # define INT64PF "%" PRId64 # define UINT64PF "%" PRIu64 # define UINT64PFx "%016" PRIx64 -# define TIMETPF "%" PRIdFAST32 typedef int64_t ib_int64_t; typedef uint64_t ib_uint64_t; typedef uint32_t ib_uint32_t; diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 3970a559a4c..f06fcd6c4d8 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -5350,7 +5350,7 @@ lock_table( lock_mutex_enter(); DBUG_EXECUTE_IF("fatal-semaphore-timeout", - { os_thread_sleep(3600000000); }); + { os_thread_sleep(3600000000U); }); /* We have to check if the new lock is compatible with any locks other transactions have in the table lock queue. */ diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 5aa9b6040f8..a417de1261f 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -6183,7 +6183,7 @@ os_file_trim( size_t len = slot->len; size_t trim_len = slot->page_size - len; - os_offset_t off = slot->offset + len; + os_offset_t off __attribute__((unused)) = slot->offset + len; size_t bsize = slot->file_block_size; #ifdef UNIV_TRIM_DEBUG diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 5d0d2d3ea2e..542e2570cb1 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -3316,17 +3316,17 @@ fil_wait_crypt_bg_threads( time_t now = time(0); if (now >= last + 30) { fprintf(stderr, - "WARNING: waited " TIMETPF " seconds " + "WARNING: waited %ld seconds " "for ref-count on table: %s space: %u\n", - now - start, table->name, table->space); + (long)(now - start), table->name, table->space); last = now; } if (now >= start + 300) { fprintf(stderr, - "WARNING: after " TIMETPF " seconds, gave up waiting " + "WARNING: after %ld seconds, gave up waiting " "for ref-count on table: %s space: %u\n", - now - start, table->name, table->space); + (long)(now - start), table->name, table->space); break; } } diff --git a/storage/mroonga/lib/mrn_context_pool.cpp b/storage/mroonga/lib/mrn_context_pool.cpp index d297ee9a338..a26005b16c0 100644 --- a/storage/mroonga/lib/mrn_context_pool.cpp +++ b/storage/mroonga/lib/mrn_context_pool.cpp @@ -77,7 +77,7 @@ namespace mrn { } private: - static const unsigned int CLEAR_THREATHOLD_IN_SECONDS = 60 * 5; + static const int CLEAR_THREATHOLD_IN_SECONDS = 60 * 5; mysql_mutex_t *mutex_; LIST *pool_; diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 130edc5ee8a..5f7e59b47da 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -7027,7 +7027,7 @@ int spider_get_sts( int sts_sync_level, uint flag ) { - int get_type; + int get_type __attribute__ ((unused)); int error_num = 0; DBUG_ENTER("spider_get_sts"); @@ -7149,7 +7149,7 @@ int spider_get_crd( #endif int crd_sync_level ) { - int get_type; + int get_type __attribute__ ((unused)); int error_num = 0; DBUG_ENTER("spider_get_crd"); @@ -8379,7 +8379,7 @@ int spider_discover_table_structure( #ifdef WITH_PARTITION_STORAGE_ENGINE partition_info *part_info = thd->work_part_info; #endif - uint str_len; + uint str_len __attribute__ ((unused)); char buf[MAX_FIELD_WIDTH]; spider_string str(buf, sizeof(buf), system_charset_info); DBUG_ENTER("spider_discover_table_structure"); diff --git a/storage/xtradb/btr/btr0scrub.cc b/storage/xtradb/btr/btr0scrub.cc index 2e667e64d0b..0e7c0d5b061 100644 --- a/storage/xtradb/btr/btr0scrub.cc +++ b/storage/xtradb/btr/btr0scrub.cc @@ -145,10 +145,10 @@ btr_scrub_lock_dict_func(ulint space_id, bool lock_to_close_table, time_t now = time(0); if (now >= last + 30) { fprintf(stderr, - "WARNING: %s:%u waited " TIMETPF " seconds for" + "WARNING: %s:%u waited %ld seconds for" " dict_sys lock, space: %lu" " lock_to_close_table: %d\n", - file, line, now - start, space_id, + file, line, (long)(now - start), space_id, lock_to_close_table); last = now; diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc index fb84b5703bf..296096e44d0 100644 --- a/storage/xtradb/fil/fil0crypt.cc +++ b/storage/xtradb/fil/fil0crypt.cc @@ -2453,9 +2453,9 @@ fil_space_crypt_close_tablespace( if (now >= last + 30) { ib_logf(IB_LOG_LEVEL_WARN, - "Waited " TIMETPF " seconds to drop space: %s (" ULINTPF + "Waited %ld seconds to drop space: %s (" ULINTPF ") active threads %u flushing=%d.", - now - start, space->name, space->id, cnt, flushing); + (long)(now - start), space->name, space->id, cnt, flushing); last = now; } } diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index d943a87ab78..a0df23b60d4 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -11088,7 +11088,7 @@ wsrep_append_foreign_key( key_type, copy); if (rcode) { - DBUG_PRINT("wsrep", ("row key failed: %zu", rcode)); + DBUG_PRINT("wsrep", ("row key failed: %lu", rcode)); WSREP_ERROR("Appending cascaded fk row key failed: %s, %lu", (wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void", rcode); diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 6d1520bc6a3..c35ec40e381 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -471,7 +471,6 @@ macro ULINTPF. */ # define INT64PF "%lld" # define UINT64PF "%llu" # define UINT64PFx "%016llx" -# define TIMETPF "%ld" typedef __int64 ib_int64_t; typedef unsigned __int64 ib_uint64_t; typedef unsigned __int32 ib_uint32_t; @@ -481,7 +480,6 @@ typedef unsigned __int32 ib_uint32_t; # define INT64PF "%" PRId64 # define UINT64PF "%" PRIu64 # define UINT64PFx "%016" PRIx64 -# define TIMETPF "%" PRIdFAST32 typedef int64_t ib_int64_t; typedef uint64_t ib_uint64_t; typedef uint32_t ib_uint32_t; diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index 2183d281b78..9daa2cc906f 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -5401,7 +5401,7 @@ lock_table( lock_mutex_enter(); DBUG_EXECUTE_IF("fatal-semaphore-timeout", - { os_thread_sleep(3600000000); }); + { os_thread_sleep(3600000000U); }); /* We have to check if the new lock is compatible with any locks other transactions have in the table lock queue. */ diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc index 47075c6cbc8..5e7ff6e910b 100644 --- a/storage/xtradb/row/row0mysql.cc +++ b/storage/xtradb/row/row0mysql.cc @@ -3320,17 +3320,17 @@ fil_wait_crypt_bg_threads( time_t now = time(0); if (now >= last + 30) { fprintf(stderr, - "WARNING: waited " TIMETPF " seconds " + "WARNING: waited %ld seconds " "for ref-count on table: %s space: %u\n", - now - start, table->name, table->space); + (long)(now - start), table->name, table->space); last = now; } if (now >= start + 300) { fprintf(stderr, - "WARNING: after " TIMETPF " seconds, gave up waiting " + "WARNING: after %ld seconds, gave up waiting " "for ref-count on table: %s space: %u\n", - now - start, table->name, table->space); + (long)(now - start), table->name, table->space); break; } } diff --git a/unittest/sql/mf_iocache-t.cc b/unittest/sql/mf_iocache-t.cc index 97b2ef0f80f..51656c02e57 100644 --- a/unittest/sql/mf_iocache-t.cc +++ b/unittest/sql/mf_iocache-t.cc @@ -356,7 +356,7 @@ void mdev17133() // random size 2nd read res= my_b_read(&info, buf_i + total + MY_MIN(19, curr_read_size), 19 >= curr_read_size ? 0 : curr_read_size - 19); - ok(res == 0, "rest of read %lu", curr_read_size - 19); + ok(res == 0, "rest of read %zu", curr_read_size - 19); // mark read bytes in the used part of the cache buffer memset(info.buffer, 0, info.read_pos - info.buffer); From 6417297180c7bc9242037894e21b769b7c22ead3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 16 Mar 2019 19:27:51 +0100 Subject: [PATCH 12/47] cmake: remove workarounds for cmake bugs #13248 and #12864 since long we use a different workaround, our own CPackRPM wrapper --- cmake/plugin.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index e38439f2a21..4396a0a6c25 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -236,9 +236,6 @@ MACRO(MYSQL_ADD_PLUGIN) IF (NOT ARG_CLIENT) SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB${ver}" PARENT_SCOPE) ENDIF() - # workarounds for cmake issues #13248 and #12864: - SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE) - SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE) SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} PARENT_SCOPE) IF(NOT ARG_CLIENT AND NOT ARG_CONFIG AND UNIX) SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf") From 39cea72e7beeb46f8b9959c198dfb9bb19d90b26 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 17 Mar 2019 15:05:56 +0100 Subject: [PATCH 13/47] cmake: fix cpack_source_ignore_files add defensive $ for filenames, don't include .gitattributes and *.rpm, correct rules for *.gz and *.zip --- cmake/cpack_source_ignore_files.cmake | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cmake/cpack_source_ignore_files.cmake b/cmake/cpack_source_ignore_files.cmake index 0654fa38388..8e1b7bd5eda 100644 --- a/cmake/cpack_source_ignore_files.cmake +++ b/cmake/cpack_source_ignore_files.cmake @@ -15,18 +15,19 @@ SET(CPACK_SOURCE_IGNORE_FILES \\\\.git/ -\\\\.gitignore -CMakeCache\\\\.txt -cmake_dist\\\\.cmake -CPackSourceConfig\\\\.cmake -CPackConfig.cmake -/cmake_install\\\\.cmake -/CTestTestfile\\\\.cmake +\\\\.gitignore$ +\\\\.gitattributes$ +CMakeCache\\\\.txt$ +cmake_dist\\\\.cmake$ +CPackSourceConfig\\\\.cmake$ +CPackConfig.cmake$ +/cmake_install\\\\.cmake$ +/CTestTestfile\\\\.cmake$ /CMakeFiles/ /version_resources/ /_CPack_Packages/ -$\\\\.gz -$\\\\.zip +\\\\.gz$ +\\\\.zip$ /CMakeFiles/ /version_resources/ /_CPack_Packages/ @@ -50,5 +51,6 @@ include/config\\\\.h$ include/my_config\\\\.h$ /autom4te\\\\.cache/ errmsg\\\\.sys$ +\\\\.rpm$ # ) From 86e80f944fede44afc1c236a841d5417eebe04cb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 16 Mar 2019 19:30:51 +0100 Subject: [PATCH 14/47] cmake: don't do fake rpm Provides instead remove internal modules from Requires/Provides --- cmake/cpack_rpm.cmake | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 962c9f1f56d..6321b125f84 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -67,6 +67,12 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE " %define _bindir ${INSTALL_BINDIRABS} %define _sbindir ${INSTALL_SBINDIRABS} %define _sysconfdir ${INSTALL_SYSCONFDIR} + +%{?filter_setup: +%filter_from_provides /perl(\\\\(mtr\\\\|My::\\\\)/d +%filter_from_requires /\\\\(lib\\\\(ft\\\\|lzma\\\\|tokuportability\\\\)\\\\)\\\\|\\\\(perl(\\\\(.*mtr\\\\|My::\\\\|.*HandlerSocket\\\\|Mysql\\\\)\\\\)/d +%filter_setup +} ") # this creative hack is described here: http://www.cmake.org/pipermail/cmake/2012-January/048416.html @@ -225,36 +231,6 @@ ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7") SET(CPACK_RPM_common_PACKAGE_CONFLICTS "mariadb-libs < 1:%{version}-%{release}") ENDIF() -# workaround for lots of perl dependencies added by rpmbuild -SETA(CPACK_RPM_test_PACKAGE_PROVIDES - "perl(lib::mtr_gcov.pl)" - "perl(lib::mtr_gprof.pl)" - "perl(lib::mtr_io.pl)" - "perl(lib::mtr_misc.pl)" - "perl(lib::mtr_process.pl)" - "perl(lib::v1/mtr_cases.pl)" - "perl(lib::v1/mtr_gcov.pl)" - "perl(lib::v1/mtr_gprof.pl)" - "perl(lib::v1/mtr_im.pl)" - "perl(lib::v1/mtr_io.pl)" - "perl(lib::v1/mtr_match.pl)" - "perl(lib::v1/mtr_misc.pl)" - "perl(lib::v1/mtr_process.pl)" - "perl(lib::v1/mtr_report.pl)" - "perl(lib::v1/mtr_stress.pl)" - "perl(lib::v1/mtr_timer.pl)" - "perl(lib::v1/mtr_unique.pl)" - "perl(mtr_cases)" - "perl(mtr_io.pl)" - "perl(mtr_match)" - "perl(mtr_misc.pl)" - "perl(mtr_gcov.pl)" - "perl(mtr_gprof.pl)" - "perl(mtr_process.pl)" - "perl(mtr_report)" - "perl(mtr_results)" - "perl(mtr_unique)") - # If we want to build build MariaDB-shared-compat, # extract compat libraries from MariaDB-shared-5.3 rpm FILE(GLOB compat_rpm RELATIVE ${CMAKE_SOURCE_DIR} From ecc2711328e2e6e77758b9fe6c2a9892a2fe9192 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 16 Mar 2019 19:33:07 +0100 Subject: [PATCH 15/47] MDEV-7066 No Source RPMs ... (and so no "yum-builddep MariaDB-server" either) create source RPM cpack-way when building binary packages, this source rpm will use same BUILD_CONFIG and WITH_SSL values that were used when creating the source RPM. Only do it for a reasonably new cmake, where source rpms are known to work (3.10.2 is ok, 3.5.2 is not). And force a shorter CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX so that a source rpm could be built from a standard location in /usr/src --- cmake/cpack_rpm.cmake | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 6321b125f84..bfc06d52efe 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -260,5 +260,24 @@ ENDIF(compat_rpm) SET(CPACK_RPM_compat_PACKAGE_PROVIDES "mysql-libs = 5.3.5") # exact version doesn't matter as long as it greater than 5.1 SET(CPACK_RPM_compat_PACKAGE_OBSOLETES "mysql-libs < 5.3.5") -ENDIF(RPM) +################ +IF(CMAKE_VERSION VERSION_GREATER "3.9.99") +SET(CPACK_SOURCE_GENERATOR "RPM") +SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS + "-DBUILD_CONFIG=mysql_release" + "-DRPM=${RPM}" + "-DCPACK_RPM_BUILD_SOURCE_DIRS_PREFIX=/usr/src/debug/${CPACK_RPM_PACKAGE_NAME}-${VERSION}" + ) + +MACRO(ADDIF var) + IF(DEFINED ${var}) + SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-D${var}=${${var}}") + ENDIF() +ENDMACRO() + +ADDIF(BUILD_CONFIG) +ADDIF(WITH_SSL) + +ENDIF() +ENDIF(RPM) From b12f14965db9586e70109fe4cbf5dbd18bf2158d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 16 Mar 2019 19:37:44 +0100 Subject: [PATCH 16/47] MDEV-7066 No Source RPMs ... (and so no "yum-builddep MariaDB-server" either) automatic BuildRequires for source RPM: for every FILEPATH and "Have library XXX" cached variable, detect what rpm package it comes from and add it to the list of dependencies. That is, the source RPM will BuildRequire all those packages that were found by cmake when the source RPM was built. Presumably, our CMakeLists.txt won't check for libraries that aren't needed for a build. It supports libraries/executables/files found with FIND_LIBRARY FIND_FILE FIND_PROGRAM CHECK_LIBRARY_EXISTS --- CMakeLists.txt | 2 + .../build_configurations/mysql_release.cmake | 4 +- cmake/build_depends.cmake | 39 +++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 cmake/build_depends.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bfbcc4995d..54645e0b5c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -499,6 +499,8 @@ IF(UNIX) INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY Docs/README-wsrep COMPONENT Readme) ENDIF() +INCLUDE(build_depends) + INCLUDE(CPack) IF(WIN32 AND SIGNCODE) diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index b73b44cddc3..709d97ec693 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -89,8 +89,8 @@ IF(WIN32) ELSEIF(RPM) SET(WITH_SSL system CACHE STRING "") SET(WITH_ZLIB system CACHE STRING "") - SET(CHECKMODULE /usr/bin/checkmodule CACHE STRING "") - SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE STRING "") + SET(CHECKMODULE /usr/bin/checkmodule CACHE FILEPATH "") + SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE FILEPATH "") SET(WITH_LIBARCHIVE ON CACHE STRING "") ELSEIF(DEB) SET(WITH_SSL system CACHE STRING "") diff --git a/cmake/build_depends.cmake b/cmake/build_depends.cmake new file mode 100644 index 00000000000..0d17c22cf98 --- /dev/null +++ b/cmake/build_depends.cmake @@ -0,0 +1,39 @@ +IF(RPM) + MACRO(FIND_DEP V) + SET(out ${V}_DEP) + IF (NOT DEFINED ${out}) + IF(EXISTS ${${V}} AND NOT IS_DIRECTORY ${${V}}) + EXECUTE_PROCESS(COMMAND ${ARGN} RESULT_VARIABLE res OUTPUT_VARIABLE O OUTPUT_STRIP_TRAILING_WHITESPACE) + ELSE() + SET(res 1) + ENDIF() + IF (res) + SET(O) + ELSE() + MESSAGE(STATUS "Need ${O} for ${${V}}") + ENDIF() + SET(${out} ${O} CACHE INTERNAL "Package that contains ${${V}}" FORCE) + ENDIF() + ENDMACRO() + + GET_CMAKE_PROPERTY(ALL_VARS CACHE_VARIABLES) + FOREACH (V ${ALL_VARS}) + GET_PROPERTY(H CACHE ${V} PROPERTY HELPSTRING) + IF (H MATCHES "^Have library [^/]" AND ${V}) + STRING(REGEX REPLACE "^Have library " "" L ${H}) + SET(V ${L}_LIBRARY) + FIND_LIBRARY(${V} ${L}) + ENDIF() + GET_PROPERTY(T CACHE ${V} PROPERTY TYPE) + IF ((T STREQUAL FILEPATH OR V MATCHES "^CMAKE_COMMAND$") AND ${V} MATCHES "^/") + IF (RPM) + FIND_DEP(${V} rpm -q --qf "%{NAME}" -f ${${V}}) + ELSE() # must be DEB + MESSAGE(FATAL_ERROR "Not implemented") + ENDIF () + SET(BUILD_DEPS ${BUILD_DEPS} ${${V}_DEP}) + ENDIF() + ENDFOREACH() + LIST(REMOVE_DUPLICATES BUILD_DEPS) + STRING(REPLACE ";" " " CPACK_RPM_BUILDREQUIRES "${BUILD_DEPS}") +ENDIF(RPM) From d8084116b54d3d3f1d655a4e051a58ebdfb82570 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 16 Mar 2019 19:44:40 +0100 Subject: [PATCH 17/47] MDEV-7066 No Source RPMs ... (and so no "yum-builddep MariaDB-server" either) special cases: * change systemd detection to use CHECK_LIBRARY_EXISTS at least once, to have it detected by build_depends.cmake * similarly, use find_library for pam * unixODBC is weird, libodbc.so is in the unixODBC package, not in the unixODBC-devel, where normally all .so files belong. Packaging bug? As a workaround, use find_file(sql.h) instead of find_path(sql.h) to make sure that /usr/include/sql.h (not /usr/include) is cached by cmake, and later build_depends.cmake will select unixODBC-devel, as a package owning /usr/include/sql.h file. --- cmake/systemd.cmake | 14 +++----------- plugin/auth_pam/CMakeLists.txt | 1 + storage/connect/CMakeLists.txt | 10 ++++++---- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake index 692d4df9f26..478930c9f3d 100644 --- a/cmake/systemd.cmake +++ b/cmake/systemd.cmake @@ -39,22 +39,14 @@ MACRO(CHECK_SYSTEMD) SET(LIBSYSTEMD systemd) ENDIF() SET(CMAKE_REQUIRED_LIBRARIES ${LIBSYSTEMD}) - CHECK_C_SOURCE_COMPILES( - " - #include - int main() - { - sd_listen_fds(0); - }" - HAVE_SYSTEMD) + CHECK_LIBRARY_EXISTS(systemd sd_listen_fds "" HAVE_SYSTEMD_SD_LISTEN_FDS) CHECK_INCLUDE_FILES(systemd/sd-daemon.h HAVE_SYSTEMD_SD_DAEMON_H) - CHECK_FUNCTION_EXISTS(sd_listen_fds HAVE_SYSTEMD_SD_LISTEN_FDS) CHECK_FUNCTION_EXISTS(sd_notify HAVE_SYSTEMD_SD_NOTIFY) CHECK_FUNCTION_EXISTS(sd_notifyf HAVE_SYSTEMD_SD_NOTIFYF) SET(CMAKE_REQUIRED_LIBRARIES) - IF(HAVE_SYSTEMD AND HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS + IF(HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF) - ADD_DEFINITIONS(-DHAVE_SYSTEMD) + SET(HAVE_SYSTEMD TRUE) SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster galera_recovery) SET(SYSTEMD_DEB_FILES "usr/bin/mariadb-service-convert usr/bin/galera_new_cluster diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt index 51317527c77..606fef002e7 100644 --- a/plugin/auth_pam/CMakeLists.txt +++ b/plugin/auth_pam/CMakeLists.txt @@ -8,6 +8,7 @@ IF(HAVE_PAM_APPL_H) IF(HAVE_STRNDUP) ADD_DEFINITIONS(-DHAVE_STRNDUP) ENDIF(HAVE_STRNDUP) + FIND_LIBRARY(PAM_LIBRARY pam) MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam MODULE_ONLY) ENDIF(HAVE_PAM_APPL_H) diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index 519e075aaaa..e0d05808a38 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -170,7 +170,8 @@ IF(CONNECT_WITH_ODBC) # the library 'libiodbc' gets compiled with 'sql'h. # This will also need changes in the sources (e.g. #include ). - find_path(ODBC_INCLUDE_DIR sql.h + find_file(ODBC_INCLUDES sql.h + PATHS /usr/include /usr/include/odbc /usr/local/include @@ -180,7 +181,7 @@ IF(CONNECT_WITH_ODBC) #"C:/Program Files/Microsoft SDKs/Windows/v7.0A/include" #"C:/Program Files/Microsoft SDKs/Windows/v6.0a/include" #"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include" - DOC "Specify the directory containing sql.h." + DOC "Specify the path to sql.h." ) find_library(ODBC_LIBRARY @@ -199,9 +200,10 @@ IF(CONNECT_WITH_ODBC) DOC "Specify the ODBC driver manager library here." ) - mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDE_DIR) + mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDES) - IF(ODBC_INCLUDE_DIR AND ODBC_LIBRARY) + IF(ODBC_INCLUDES AND ODBC_LIBRARY) + get_filename_component(ODBC_INCLUDE_DIR "${ODBC_INCLUDES}" PATH) set(CMAKE_REQUIRED_LIBRARIES ${ODBC_LIBRARY}) set(CMAKE_REQUIRED_INCLUDES ${ODBC_INCLUDE_DIR}) CHECK_CXX_SOURCE_COMPILES( From deff3f757289bd5b98b1b44d857e7508c4be07eb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 22 Mar 2019 19:28:59 +0100 Subject: [PATCH 18/47] MDEV-18466 Unsafe to log updates on tables referenced by foreign keys with triggers in statement format ignore FK-prelocked tables when looking for write-prelocked tables with auto-increment to complain about "Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column" --- .../suite/binlog/r/binlog_innodb_stm.result | 17 ++++++++++++ .../suite/binlog/t/binlog_innodb_stm.test | 26 +++++++++++++++++++ sql/sql_class.cc | 4 +++ 3 files changed, 47 insertions(+) create mode 100644 mysql-test/suite/binlog/r/binlog_innodb_stm.result create mode 100644 mysql-test/suite/binlog/t/binlog_innodb_stm.test diff --git a/mysql-test/suite/binlog/r/binlog_innodb_stm.result b/mysql-test/suite/binlog/r/binlog_innodb_stm.result new file mode 100644 index 00000000000..829ed7d3c61 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_innodb_stm.result @@ -0,0 +1,17 @@ +create table categories( +cat_id int not null primary key, +cat_name varchar(255) not null, +cat_description text +) engine=innodb; +create table products( +prd_id int not null auto_increment primary key, +prd_name varchar(355) not null, +prd_price decimal, +cat_id int not null, +foreign key fk_cat(cat_id) +references categories(cat_id) +on update cascade +) engine=innodb; +insert into categories values (1, 'drinks', 'drinks'); +update categories set cat_description=2 where cat_id=1; +drop table products, categories; diff --git a/mysql-test/suite/binlog/t/binlog_innodb_stm.test b/mysql-test/suite/binlog/t/binlog_innodb_stm.test new file mode 100644 index 00000000000..4dfa7a76584 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_innodb_stm.test @@ -0,0 +1,26 @@ +source include/have_innodb.inc; +source include/have_binlog_format_statement.inc; + +# +# MDEV-18466 Unsafe to log updates on tables referenced by foreign keys with triggers in statement format +# + +create table categories( + cat_id int not null primary key, + cat_name varchar(255) not null, + cat_description text +) engine=innodb; + +create table products( + prd_id int not null auto_increment primary key, + prd_name varchar(355) not null, + prd_price decimal, + cat_id int not null, + foreign key fk_cat(cat_id) + references categories(cat_id) + on update cascade +) engine=innodb; + +insert into categories values (1, 'drinks', 'drinks'); +update categories set cat_description=2 where cat_id=1; +drop table products, categories; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 02e76520cb4..639c7c1784a 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -5542,6 +5542,9 @@ int xid_cache_iterate(THD *thd, my_hash_walk_action action, void *arg) Call this function only when you have established the list of all tables which you'll want to update (including stored functions, triggers, views inside your statement). + + Ignore tables prelocked for foreign key cascading actions, as these + actions cannot generate new auto_increment values. */ static bool @@ -5551,6 +5554,7 @@ has_write_table_with_auto_increment(TABLE_LIST *tables) { /* we must do preliminary checks as table->table may be NULL */ if (!table->placeholder() && + table->prelocking_placeholder != TABLE_LIST::FK && table->table->found_next_number_field && (table->lock_type >= TL_WRITE_ALLOW_WRITE)) return 1; From 21b2fada7ab7f35c898c02d2f918461409cc9c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 27 Mar 2019 09:28:49 +0200 Subject: [PATCH 19/47] MDEV-18464: Port kill_one_trx fixes from 10.4 to 10.1 Pushed the decision for innodb transaction and system locking down to lock0lock.cc level. With this, we can avoid releasing these mutexes for executions where these mutexes were acquired upfront. This patch will also fix BF aborting of native threads, e.g. threads which have declared wsrep_on=OFF. Earlier, we have used, for innodb trx locks, was_chosen_as_deadlock_victim flag, for marking inodb transactions, which are victims for wsrep BF abort. With native threads (wsrep_on==OFF), re-using was_chosen_as_deadlock_victim flag may lead to inteference with real deadlock, and to deal with this, the patch has added new flag for marking wsrep BF aborts only: victim=true Similar way if replication decides to abort one of the threads we mark victim by: victim=true innobase_kill_query Remove lock sys and trx mutex handling. wsrep_innobase_kill_one_trx Mark victim trx with victim=true trx0trx.h Remove trx_abort_t type and abort type variable from trx struct. Add victim variable to trx. wsrep_kill_victim Remove abort_type lock_report_waiters_to_mysql Take also trx mutex and mark trx as a victim for replication abort. lock_trx_handle_wait_low New low level function to check whether the transaction has already been rolled back because it was selected as a deadlock victim, or if it has to wait then cancel the wait lock. lock_trx_handle_wait If transaction is not marked as victim take lock sys and trx mutex before calling lock_trx_handle_wait_low and release them after that. row_search_for_mysql Remove lock sys and trx mutex taking and releasing. trx_rollback_to_savepoint_for_mysql_low trx_commit_in_memory Clean up victim variable. --- storage/innobase/handler/ha_innodb.cc | 38 ++++---------------- storage/innobase/include/trx0trx.h | 19 ++++------ storage/innobase/lock/lock0lock.cc | 50 +++++++++++++++++---------- storage/innobase/row/row0sel.cc | 4 --- storage/innobase/trx/trx0roll.cc | 3 +- storage/innobase/trx/trx0trx.cc | 8 ++--- storage/xtradb/handler/ha_innodb.cc | 36 ++++--------------- storage/xtradb/include/trx0trx.h | 19 ++++------ storage/xtradb/lock/lock0lock.cc | 50 +++++++++++++++++---------- storage/xtradb/row/row0sel.cc | 4 --- storage/xtradb/trx/trx0roll.cc | 21 ++--------- storage/xtradb/trx/trx0trx.cc | 17 ++------- 12 files changed, 99 insertions(+), 170 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index cd605b6b791..c55eaf59879 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -4929,8 +4929,6 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) /* if victim has been signaled by BF thread and/or aborting is already progressing, following query aborting is not necessary any more. - Also, BF thread should own trx mutex for the victim, which would - conflict with trx_mutex_enter() below */ DBUG_VOID_RETURN; } @@ -4939,34 +4937,8 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) if (trx_t* trx = thd_to_trx(thd)) { ut_ad(trx->mysql_thd == thd); - switch (trx->abort_type) { -#ifdef WITH_WSREP - case TRX_WSREP_ABORT: - break; -#endif - case TRX_SERVER_ABORT: - if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { - lock_mutex_enter(); - } - /* fall through */ - case TRX_REPLICATION_ABORT: - trx_mutex_enter(trx); - } /* Cancel a pending lock request if there are any */ lock_trx_handle_wait(trx); - switch (trx->abort_type) { -#ifdef WITH_WSREP - case TRX_WSREP_ABORT: - break; -#endif - case TRX_SERVER_ABORT: - if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { - lock_mutex_exit(); - } - /* fall through */ - case TRX_REPLICATION_ABORT: - trx_mutex_exit(trx); - } } DBUG_VOID_RETURN; @@ -18683,6 +18655,12 @@ wsrep_innobase_kill_one_trx( wsrep_thd_ws_handle(thd)->trx_id); wsrep_thd_LOCK(thd); + + /* We mark this as victim transaction, which is already marked + as BF victim. Both trx mutex and lock_sys mutex is held until + this victim has aborted. */ + victim_trx->victim = true; + DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock", { const char act[]= @@ -18866,7 +18844,7 @@ wsrep_abort_transaction( my_bool signal) { DBUG_ENTER("wsrep_innobase_abort_thd"); - + trx_t* victim_trx = thd_to_trx(victim_thd); trx_t* bf_trx = (bf_thd) ? thd_to_trx(bf_thd) : NULL; @@ -18878,12 +18856,10 @@ wsrep_abort_transaction( if (victim_trx) { lock_mutex_enter(); trx_mutex_enter(victim_trx); - victim_trx->abort_type = TRX_WSREP_ABORT; int rcode = wsrep_innobase_kill_one_trx(bf_thd, bf_trx, victim_trx, signal); trx_mutex_exit(victim_trx); lock_mutex_exit(); - victim_trx->abort_type = TRX_SERVER_ABORT; wsrep_srv_conc_cancel_wait(victim_trx); DBUG_RETURN(rcode); } else { diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index fe16b8272b8..b40c6ae4667 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2018, MariaDB Corporation. +Copyright (c) 2015, 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 @@ -623,7 +623,6 @@ struct trx_lock_t { lock_sys->mutex. Otherwise, this may only be modified by the thread that is serving the running transaction. */ - mem_heap_t* lock_heap; /*!< memory heap for trx_locks; protected by lock_sys->mutex */ @@ -695,14 +694,6 @@ lock_rec_convert_impl_to_expl()) will access transactions associated to other connections. The locks of transactions are protected by lock_sys->mutex and sometimes by trx->mutex. */ -enum trx_abort_t { - TRX_SERVER_ABORT = 0, -#ifdef WITH_WSREP - TRX_WSREP_ABORT, -#endif - TRX_REPLICATION_ABORT -}; - struct trx_t{ ulint magic_n; @@ -880,8 +871,12 @@ struct trx_t{ /*------------------------------*/ THD* mysql_thd; /*!< MySQL thread handle corresponding to this trx, or NULL */ - trx_abort_t abort_type; /*!< Transaction abort type*/ - + bool victim; /*!< This transaction is + selected as victim for abort + either by replication or + high priority wsrep thread. This + field is protected by trx and + lock sys mutex. */ const char* mysql_log_file_name; /*!< if MySQL binlog is used, this field contains a pointer to the latest file diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index f06fcd6c4d8..33563a03f1a 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2018, MariaDB Corporation. +Copyright (c) 2014, 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 @@ -1793,10 +1793,8 @@ wsrep_kill_victim( } } - lock->trx->abort_type = TRX_WSREP_ABORT; wsrep_innobase_kill_one_trx(trx->mysql_thd, (const trx_t*) trx, lock->trx, TRUE); - lock->trx->abort_type = TRX_SERVER_ABORT; } } } @@ -4782,12 +4780,11 @@ lock_report_waiters_to_mysql( if (w_trx->id != victim_trx_id) { /* If thd_report_wait_for() decides to kill the transaction, then we will get a call back into - innobase_kill_query. We mark this by setting - current_lock_mutex_owner, so we can avoid trying - to recursively take lock_sys->mutex. */ - w_trx->abort_type = TRX_REPLICATION_ABORT; + innobase_kill_query.*/ + trx_mutex_enter(w_trx); + w_trx->victim = true; thd_report_wait_for(mysql_thd, w_trx->mysql_thd); - w_trx->abort_type = TRX_SERVER_ABORT; + trx_mutex_exit(w_trx); } ++i; } @@ -7967,16 +7964,7 @@ lock_trx_release_locks( lock_mutex_exit(); } -/*********************************************************************//** -Check whether the transaction has already been rolled back because it -was selected as a deadlock victim, or if it has to wait then cancel -the wait lock. -@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ -UNIV_INTERN -dberr_t -lock_trx_handle_wait( -/*=================*/ - trx_t* trx) /*!< in/out: trx lock state */ +inline dberr_t lock_trx_handle_wait_low(trx_t* trx) { ut_ad(lock_mutex_own()); ut_ad(trx_mutex_own(trx)); @@ -7993,6 +7981,32 @@ lock_trx_handle_wait( return DB_LOCK_WAIT; } +/*********************************************************************//** +Check whether the transaction has already been rolled back because it +was selected as a deadlock victim, or if it has to wait then cancel +the wait lock. +@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ +UNIV_INTERN +dberr_t +lock_trx_handle_wait( +/*=================*/ + trx_t* trx) /*!< in/out: trx lock state */ +{ + if (!trx->victim) { + lock_mutex_enter(); + trx_mutex_enter(trx); + } + + dberr_t err = lock_trx_handle_wait_low(trx); + + if (!trx->victim) { + lock_mutex_exit(); + trx_mutex_exit(trx); + } + + return err; +} + /*********************************************************************//** Get the number of locks on a table. @return number of locks */ diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 06bf4cc30c0..855266686e6 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -4746,11 +4746,7 @@ no_gap_lock: a deadlock and the transaction had to wait then release the lock it is waiting on. */ - lock_mutex_enter(); - trx_mutex_enter(trx); err = lock_trx_handle_wait(trx); - lock_mutex_exit(); - trx_mutex_exit(trx); switch (err) { case DB_SUCCESS: diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc index 3fd71aff23a..127e834335d 100644 --- a/storage/innobase/trx/trx0roll.cc +++ b/storage/innobase/trx/trx0roll.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2018, MariaDB Corporation. +Copyright (c) 2016, 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 @@ -370,6 +370,7 @@ trx_rollback_to_savepoint_for_mysql_low( trx_mark_sql_stat_end(trx); trx->op_info = ""; + trx->victim = false; return(err); } diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index f36aabba8b4..98ac08a00e7 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2018, MariaDB Corporation. +Copyright (c) 2015, 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 @@ -1339,11 +1339,7 @@ trx_commit_in_memory( ut_ad(!trx->in_ro_trx_list); ut_ad(!trx->in_rw_trx_list); -#ifdef WITH_WSREP - if (trx->mysql_thd && wsrep_on(trx->mysql_thd)) { - trx->lock.was_chosen_as_deadlock_victim = FALSE; - } -#endif + trx->victim = false; trx->dict_operation = TRX_DICT_OP_NONE; trx->error_state = DB_SUCCESS; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index a0df23b60d4..55c49711f19 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -5534,8 +5534,6 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) /* if victim has been signaled by BF thread and/or aborting is already progressing, following query aborting is not necessary any more. - Also, BF thread should own trx mutex for the victim, which would - conflict with trx_mutex_enter() below */ DBUG_VOID_RETURN; } @@ -5543,34 +5541,8 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) if (trx_t* trx = thd_to_trx(thd)) { ut_ad(trx->mysql_thd == thd); - switch (trx->abort_type) { -#ifdef WITH_WSREP - case TRX_WSREP_ABORT: - break; -#endif - case TRX_SERVER_ABORT: - if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { - lock_mutex_enter(); - } - /* fall through */ - case TRX_REPLICATION_ABORT: - trx_mutex_enter(trx); - } /* Cancel a pending lock request if there are any */ lock_trx_handle_wait(trx); - switch (trx->abort_type) { -#ifdef WITH_WSREP - case TRX_WSREP_ABORT: - break; -#endif - case TRX_SERVER_ABORT: - if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { - lock_mutex_exit(); - } - /* fall through */ - case TRX_REPLICATION_ABORT: - trx_mutex_exit(trx); - } } DBUG_VOID_RETURN; @@ -19723,6 +19695,12 @@ wsrep_innobase_kill_one_trx( (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void"); wsrep_thd_LOCK(thd); + + /* We mark this as victim transaction, which is already marked + as BF victim. Both trx mutex and lock_sys mutex is held until + this victim has aborted. */ + victim_trx->victim = true; + DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock", { const char act[]= @@ -19911,12 +19889,10 @@ wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd, if (victim_trx) { lock_mutex_enter(); trx_mutex_enter(victim_trx); - victim_trx->abort_type = TRX_WSREP_ABORT; int rcode = wsrep_innobase_kill_one_trx(bf_thd, bf_trx, victim_trx, signal); trx_mutex_exit(victim_trx); lock_mutex_exit(); - victim_trx->abort_type = TRX_SERVER_ABORT; wsrep_srv_conc_cancel_wait(victim_trx); DBUG_RETURN(rcode); } else { diff --git a/storage/xtradb/include/trx0trx.h b/storage/xtradb/include/trx0trx.h index 77afde4c35c..df01284af05 100644 --- a/storage/xtradb/include/trx0trx.h +++ b/storage/xtradb/include/trx0trx.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2018, MariaDB Corporation. +Copyright (c) 2015, 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 @@ -672,7 +672,6 @@ struct trx_lock_t { lock_sys->mutex. Otherwise, this may only be modified by the thread that is serving the running transaction. */ - mem_heap_t* lock_heap; /*!< memory heap for trx_locks; protected by lock_sys->mutex */ @@ -744,14 +743,6 @@ lock_rec_convert_impl_to_expl()) will access transactions associated to other connections. The locks of transactions are protected by lock_sys->mutex and sometimes by trx->mutex. */ -enum trx_abort_t { - TRX_SERVER_ABORT = 0, -#ifdef WITH_WSREP - TRX_WSREP_ABORT, -#endif - TRX_REPLICATION_ABORT -}; - struct trx_t{ ulint magic_n; @@ -930,8 +921,12 @@ struct trx_t{ /*------------------------------*/ THD* mysql_thd; /*!< MySQL thread handle corresponding to this trx, or NULL */ - trx_abort_t abort_type; /*!< Transaction abort type */ - + bool victim; /*!< This transaction is + selected as victim for abort + either by replication or + high priority wsrep thread. This + field is protected by trx and + lock sys mutex. */ const char* mysql_log_file_name; /*!< if MySQL binlog is used, this field contains a pointer to the latest file diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index 9daa2cc906f..2999c339457 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2018, MariaDB Corporation. +Copyright (c) 2014, 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 @@ -1804,10 +1804,8 @@ wsrep_kill_victim( } } - lock->trx->abort_type = TRX_WSREP_ABORT; wsrep_innobase_kill_one_trx(trx->mysql_thd, (const trx_t*) trx, lock->trx, TRUE); - lock->trx->abort_type = TRX_SERVER_ABORT; } } } @@ -4821,12 +4819,11 @@ lock_report_waiters_to_mysql( if (w_trx->id != victim_trx_id) { /* If thd_report_wait_for() decides to kill the transaction, then we will get a call back into - innobase_kill_query. We mark this by setting - current_lock_mutex_owner, so we can avoid trying - to recursively take lock_sys->mutex. */ - w_trx->abort_type = TRX_REPLICATION_ABORT; + innobase_kill_query.*/ + trx_mutex_enter(w_trx); + w_trx->victim = true; thd_report_wait_for(mysql_thd, w_trx->mysql_thd); - w_trx->abort_type = TRX_SERVER_ABORT; + trx_mutex_exit(w_trx); } ++i; } @@ -8077,16 +8074,7 @@ lock_trx_release_locks( lock_mutex_exit(); } -/*********************************************************************//** -Check whether the transaction has already been rolled back because it -was selected as a deadlock victim, or if it has to wait then cancel -the wait lock. -@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ -UNIV_INTERN -dberr_t -lock_trx_handle_wait( -/*=================*/ - trx_t* trx) /*!< in/out: trx lock state */ +inline dberr_t lock_trx_handle_wait_low(trx_t* trx) { ut_ad(lock_mutex_own()); ut_ad(trx_mutex_own(trx)); @@ -8103,6 +8091,32 @@ lock_trx_handle_wait( return DB_LOCK_WAIT; } +/*********************************************************************//** +Check whether the transaction has already been rolled back because it +was selected as a deadlock victim, or if it has to wait then cancel +the wait lock. +@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ +UNIV_INTERN +dberr_t +lock_trx_handle_wait( +/*=================*/ + trx_t* trx) /*!< in/out: trx lock state */ +{ + if (!trx->victim) { + lock_mutex_enter(); + trx_mutex_enter(trx); + } + + dberr_t err = lock_trx_handle_wait_low(trx); + + if (!trx->victim) { + lock_mutex_exit(); + trx_mutex_exit(trx); + } + + return err; +} + /*********************************************************************//** Get the number of locks on a table. @return number of locks */ diff --git a/storage/xtradb/row/row0sel.cc b/storage/xtradb/row/row0sel.cc index b6b5d107885..87bc2aa2875 100644 --- a/storage/xtradb/row/row0sel.cc +++ b/storage/xtradb/row/row0sel.cc @@ -4755,11 +4755,7 @@ no_gap_lock: a deadlock and the transaction had to wait then release the lock it is waiting on. */ - lock_mutex_enter(); - trx_mutex_enter(trx); err = lock_trx_handle_wait(trx); - lock_mutex_exit(); - trx_mutex_exit(trx); switch (err) { case DB_SUCCESS: diff --git a/storage/xtradb/trx/trx0roll.cc b/storage/xtradb/trx/trx0roll.cc index 56b7120fa34..127e834335d 100644 --- a/storage/xtradb/trx/trx0roll.cc +++ b/storage/xtradb/trx/trx0roll.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2018, MariaDB Corporation. +Copyright (c) 2016, 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 @@ -33,8 +33,6 @@ Created 3/26/1996 Heikki Tuuri #include "trx0roll.ic" #endif -#include - #include "fsp0fsp.h" #include "mach0data.h" #include "trx0rseg.h" @@ -51,9 +49,6 @@ Created 3/26/1996 Heikki Tuuri #include "pars0pars.h" #include "srv0mon.h" #include "trx0sys.h" -#ifdef WITH_WSREP -#include "ha_prototypes.h" -#endif /* WITH_WSREP */ /** This many pages must be undone before a truncate is tried within rollback */ @@ -375,13 +370,7 @@ trx_rollback_to_savepoint_for_mysql_low( trx_mark_sql_stat_end(trx); trx->op_info = ""; - -#ifdef WITH_WSREP - if (wsrep_on(trx->mysql_thd) && - trx->lock.was_chosen_as_deadlock_victim) { - trx->lock.was_chosen_as_deadlock_victim = FALSE; - } -#endif + trx->victim = false; return(err); } @@ -1079,12 +1068,6 @@ trx_roll_try_truncate( if (trx->update_undo) { trx_undo_truncate_end(trx, trx->update_undo, limit); } - -#ifdef WITH_WSREP_OUT - if (wsrep_on(trx->mysql_thd)) { - trx->lock.was_chosen_as_deadlock_victim = FALSE; - } -#endif /* WITH_WSREP */ } /***********************************************************************//** diff --git a/storage/xtradb/trx/trx0trx.cc b/storage/xtradb/trx/trx0trx.cc index 17cba81daf3..8ca247fadc8 100644 --- a/storage/xtradb/trx/trx0trx.cc +++ b/storage/xtradb/trx/trx0trx.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2018, MariaDB Corporation. +Copyright (c) 2015, 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 @@ -1563,11 +1563,7 @@ trx_commit_in_memory( ut_ad(!trx->in_ro_trx_list); ut_ad(!trx->in_rw_trx_list); -#ifdef WITH_WSREP - if (trx->mysql_thd && wsrep_on(trx->mysql_thd)) { - trx->lock.was_chosen_as_deadlock_victim = FALSE; - } -#endif + trx->victim = false; trx->dict_operation = TRX_DICT_OP_NONE; trx->error_state = DB_SUCCESS; @@ -2668,10 +2664,6 @@ trx_start_if_not_started_low( { switch (trx->state) { case TRX_STATE_NOT_STARTED: -#ifdef WITH_WSREP - ut_d(trx->start_file = __FILE__); - ut_d(trx->start_line = __LINE__); -#endif /* WITH_WSREP */ trx_start_low(trx); /* fall through */ case TRX_STATE_ACTIVE: @@ -2705,11 +2697,6 @@ trx_start_for_ddl_low( trx->will_lock = 1; trx->ddl = true; - -#ifdef WITH_WSREP - ut_d(trx->start_file = __FILE__); - ut_d(trx->start_line = __LINE__); -#endif /* WITH_WSREP */ trx_start_low(trx); return; From 81d71ee6b21870772c336bff15b71904914f146a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 5 Feb 2019 15:41:53 +0200 Subject: [PATCH 20/47] MDEV-12009: Allow to force kill user threads/query which are flagged as high priority by Galera As noted on kill_one_thread SUPER should be able to kill even system threads i.e. threads/query flagged as high priority or wsrep applier thread. Normal user, should not able to kill threads/query flagged as high priority (BF) or wsrep applier thread. --- include/mysql/service_wsrep.h | 3 ++ .../suite/galera/r/galera_kill_applier.result | 4 ++ .../suite/galera/t/galera_kill_applier.cnf | 10 ++++ .../suite/galera/t/galera_kill_applier.test | 54 +++++++++++++++++-- sql/sql_parse.cc | 14 +++-- sql/sql_plugin_services.ic | 3 +- sql/wsrep_dummy.cc | 3 ++ sql/wsrep_mysqld.cc | 1 - sql/wsrep_thd.cc | 9 ++++ sql/wsrep_thd.h | 2 + 10 files changed, 95 insertions(+), 8 deletions(-) create mode 100644 mysql-test/suite/galera/t/galera_kill_applier.cnf diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h index 267c8cb4e90..59df7a8b561 100644 --- a/include/mysql/service_wsrep.h +++ b/include/mysql/service_wsrep.h @@ -112,6 +112,7 @@ extern struct wsrep_service_st { int (*wsrep_trx_order_before_func)(MYSQL_THD, MYSQL_THD); void (*wsrep_unlock_rollback_func)(); void (*wsrep_set_data_home_dir_func)(const char *data_dir); + my_bool (*wsrep_thd_is_applier_func)(THD *thd); } *wsrep_service; #ifdef MYSQL_DYNAMIC_PLUGIN @@ -155,6 +156,7 @@ extern struct wsrep_service_st { #define wsrep_trx_order_before(T1,T2) wsrep_service->wsrep_trx_order_before_func(T1,T2) #define wsrep_unlock_rollback() wsrep_service->wsrep_unlock_rollback_func() #define wsrep_set_data_home_dir(A) wsrep_service->wsrep_set_data_home_dir_func(A) +#define wsrep_thd_is_applier(T) wsrep_service->wsrep_thd_is_applier_func(T) #define wsrep_debug get_wsrep_debug() #define wsrep_log_conflicts get_wsrep_log_conflicts() @@ -214,6 +216,7 @@ void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state); bool wsrep_thd_ignore_table(THD *thd); void wsrep_unlock_rollback(); void wsrep_set_data_home_dir(const char *data_dir); +my_bool wsrep_thd_is_applier(THD *thd); #endif diff --git a/mysql-test/suite/galera/r/galera_kill_applier.result b/mysql-test/suite/galera/r/galera_kill_applier.result index fe4911639ed..89f8ead0b65 100644 --- a/mysql-test/suite/galera/r/galera_kill_applier.result +++ b/mysql-test/suite/galera/r/galera_kill_applier.result @@ -1,4 +1,8 @@ +CREATE USER foo@localhost; +GRANT SELECT on test.* TO foo@localhost; +# Open connection to the 1st node using 'test_user1' user. Got one of the listed errors Got one of the listed errors Got one of the listed errors Got one of the listed errors +DROP USER foo@localhost; diff --git a/mysql-test/suite/galera/t/galera_kill_applier.cnf b/mysql-test/suite/galera/t/galera_kill_applier.cnf new file mode 100644 index 00000000000..f2563e66f2e --- /dev/null +++ b/mysql-test/suite/galera/t/galera_kill_applier.cnf @@ -0,0 +1,10 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +auto_increment_offset=1 + +[mysqld.2] +wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' +auto_increment_offset=2 + diff --git a/mysql-test/suite/galera/t/galera_kill_applier.test b/mysql-test/suite/galera/t/galera_kill_applier.test index e14a8b9af23..5e4a587fe57 100644 --- a/mysql-test/suite/galera/t/galera_kill_applier.test +++ b/mysql-test/suite/galera/t/galera_kill_applier.test @@ -1,14 +1,25 @@ # # This test checks that applier threads are immune to KILL QUERY and KILL STATEMENT +# when USER is not SUPER # --source include/galera_cluster.inc ---source include/have_innodb.inc --connection node_1 +CREATE USER foo@localhost; +GRANT SELECT on test.* TO foo@localhost; + --let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1` +--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` + +--echo # Open connection to the 1st node using 'test_user1' user. +--let $port_1= \$NODE_MYPORT_1 +--connect(foo_node_1,localhost,foo,,test,$port_1,) + +--connection foo_node_1 + --disable_query_log --error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR --eval KILL $applier_thread @@ -16,11 +27,48 @@ --error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR --eval KILL QUERY $applier_thread ---let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` - --error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR --eval KILL $aborter_thread --error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR --eval KILL QUERY $aborter_thread --enable_query_log + +# +# SUPER can kill applier threads +# +--connection node_2 + +--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1` + +--disable_query_log +--eval KILL $applier_thread +--enable_query_log + +--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` + +--disable_query_log +--eval KILL $aborter_thread +--enable_query_log + +--source include/restart_mysqld.inc + +--connection node_2 +--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1` + +--disable_query_log +--eval KILL QUERY $applier_thread +--enable_query_log + +--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` + +--disable_query_log +--eval KILL QUERY $aborter_thread +--enable_query_log + +--source include/restart_mysqld.inc + +--connection node_1 +--disconnect foo_node_1 +DROP USER foo@localhost; + diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1f060305d4f..920f7ac0329 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -8292,11 +8292,19 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ It's ok to also kill DELAYED threads with KILL_CONNECTION instead of KILL_SYSTEM_THREAD; The difference is that KILL_CONNECTION may be faster and do a harder kill than KILL_SYSTEM_THREAD; + + Note that if thread is wsrep Brute Force or applier thread we + allow killing it only when we're SUPER. */ - if (((thd->security_ctx->master_access & SUPER_ACL) || - thd->security_ctx->user_matches(tmp->security_ctx)) && - !wsrep_thd_is_BF(tmp, false)) + if ((thd->security_ctx->master_access & SUPER_ACL) || + (thd->security_ctx->user_matches(tmp->security_ctx) +#ifdef WITH_WSREP + && + !tmp->wsrep_applier && + !wsrep_thd_is_BF(tmp, false) +#endif + )) { tmp->awake(kill_signal); error=0; diff --git a/sql/sql_plugin_services.ic b/sql/sql_plugin_services.ic index 427d8937c57..d70c76701fd 100644 --- a/sql/sql_plugin_services.ic +++ b/sql/sql_plugin_services.ic @@ -181,7 +181,8 @@ static struct wsrep_service_st wsrep_handler = { wsrep_trx_is_aborting, wsrep_trx_order_before, wsrep_unlock_rollback, - wsrep_set_data_home_dir + wsrep_set_data_home_dir, + wsrep_thd_is_applier, }; static struct thd_specifics_service_st thd_specifics_handler= diff --git a/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc index 795e2d19252..e2a4dcf3bad 100644 --- a/sql/wsrep_dummy.cc +++ b/sql/wsrep_dummy.cc @@ -20,6 +20,9 @@ my_bool wsrep_thd_is_BF(THD *, my_bool) { return 0; } +my_bool wsrep_thd_is_applier(THD *) +{ return 0; } + int wsrep_trx_order_before(THD *, THD *) { return 0; } diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index ee8509e3fa2..82415691b3f 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -2470,7 +2470,6 @@ extern "C" void wsrep_thd_set_exec_mode(THD *thd, enum wsrep_exec_mode mode) thd->wsrep_exec_mode= mode; } - extern "C" void wsrep_thd_set_query_state( THD *thd, enum wsrep_query_state state) { diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index 551e710cfeb..91f0e1e8d8a 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -596,6 +596,15 @@ my_bool wsrep_thd_is_BF(THD *thd, my_bool sync) return status; } +my_bool wsrep_thd_is_applier(THD *thd) +{ + my_bool ret = FALSE; + if (thd) { + ret = thd->wsrep_applier; + } + return ret; +} + extern "C" my_bool wsrep_thd_is_BF_or_commit(void *thd_ptr, my_bool sync) { diff --git a/sql/wsrep_thd.h b/sql/wsrep_thd.h index 5900668f3fb..f5fcb50280c 100644 --- a/sql/wsrep_thd.h +++ b/sql/wsrep_thd.h @@ -37,6 +37,7 @@ int wsrep_abort_thd(void *bf_thd_ptr, void *victim_thd_ptr, */ extern void wsrep_thd_set_PA_safe(void *thd_ptr, my_bool safe); extern my_bool wsrep_thd_is_BF(THD *thd, my_bool sync); +extern my_bool wsrep_thd_is_applier(THD *thd); extern my_bool wsrep_thd_is_wsrep(void *thd_ptr); enum wsrep_conflict_state wsrep_thd_conflict_state(void *thd_ptr, my_bool sync); @@ -47,6 +48,7 @@ extern "C" int wsrep_thd_in_locking_session(void *thd_ptr); #else /* WITH_WSREP */ #define wsrep_thd_is_BF(T, S) (0) +#define wsrep_thd_is_applier(T) (0) #define wsrep_abort_thd(X,Y,Z) do { } while(0) #define wsrep_create_appliers(T) do { } while(0) From 38cad6875f2c85f5190eaae7b9da7c43e591eff2 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Thu, 28 Mar 2019 13:14:49 +0530 Subject: [PATCH 21/47] MDEV-18899: Server crashes in Field::set_warning_truncated_wrong_value To fix the crash there we need to make sure that the server while storing the statistical values in statistical tables should do it in a multi-byte safe way. Also there is no need to throw warnings if there is truncation while storing values from statistical fields. --- mysql-test/r/stat_tables.result | 57 ++++++++++++++++++++++++++ mysql-test/r/stat_tables_innodb.result | 57 ++++++++++++++++++++++++++ mysql-test/t/stat_tables.test | 40 ++++++++++++++++++ sql/field.cc | 7 +++- sql/sql_statistics.cc | 10 +++-- 5 files changed, 166 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/stat_tables.result b/mysql-test/r/stat_tables.result index 3ebc3b47833..be868e55e84 100644 --- a/mysql-test/r/stat_tables.result +++ b/mysql-test/r/stat_tables.result @@ -624,4 +624,61 @@ SELECT MAX(pk) FROM t1; MAX(pk) NULL DROP TABLE t1; +# +# MDEV-18899: Server crashes in Field::set_warning_truncated_wrong_value +# +set names utf8; +set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity; +set optimizer_use_condition_selectivity=4; +set use_stat_tables=preferably; +set @save_histogram_size= @@histogram_size; +set histogram_size=255; +create table t1 ( a varchar(255) character set utf8); +insert into t1 values (REPEAT('ำฅ',255)), (REPEAT('รง',255)); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +select HEX(RIGHT(min_value, 1)), length(min_value) from mysql.column_stats where db_name='test' and table_name='t1'; +HEX(RIGHT(min_value, 1)) length(min_value) +A7 254 +select HEX(RIGHT(max_value, 1)), length(max_value) from mysql.column_stats where db_name='test' and table_name='t1'; +HEX(RIGHT(max_value, 1)) length(max_value) +A5 254 +analyze select * from t1 where a >= 'ำฅ'; +id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 2.00 50.00 50.00 Using where +set @save_sql_mode= @@sql_mode; +set sql_mode='ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; +update mysql.column_stats set min_value= REPEAT('ำฅ',255) where db_name='test' and table_name='t1'; +Warnings: +Warning 1265 Data truncated for column 'min_value' at row 1 +select HEX(RIGHT(min_value, 1)), length(min_value) from mysql.column_stats where db_name='test' and table_name='t1'; +HEX(RIGHT(min_value, 1)) length(min_value) +D3 255 +analyze select * from t1 where a >= 'ำฅ'; +id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 2.00 50.00 50.00 Using where +set names latin1; +drop table t1; +CREATE TABLE t1 (col1 date); +INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29'); +INSERT INTO t1 VALUES('0000-10-31'); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +update mysql.column_stats set min_value='2004-0-31123' where db_name='test' and table_name='t1'; +select min_value from mysql.column_stats where db_name='test' and table_name='t1'; +min_value +2004-0-31123 +select * from t1; +col1 +2004-01-01 +2004-02-29 +0000-10-31 +drop table t1; +set @@sql_mode= @save_sql_mode; set use_stat_tables=@save_use_stat_tables; +set @@histogram_size= @save_histogram_size; +set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; diff --git a/mysql-test/r/stat_tables_innodb.result b/mysql-test/r/stat_tables_innodb.result index a6c5525a0d3..86088490871 100644 --- a/mysql-test/r/stat_tables_innodb.result +++ b/mysql-test/r/stat_tables_innodb.result @@ -651,6 +651,63 @@ SELECT MAX(pk) FROM t1; MAX(pk) NULL DROP TABLE t1; +# +# MDEV-18899: Server crashes in Field::set_warning_truncated_wrong_value +# +set names utf8; +set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity; +set optimizer_use_condition_selectivity=4; +set use_stat_tables=preferably; +set @save_histogram_size= @@histogram_size; +set histogram_size=255; +create table t1 ( a varchar(255) character set utf8); +insert into t1 values (REPEAT('ำฅ',255)), (REPEAT('รง',255)); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +select HEX(RIGHT(min_value, 1)), length(min_value) from mysql.column_stats where db_name='test' and table_name='t1'; +HEX(RIGHT(min_value, 1)) length(min_value) +A7 254 +select HEX(RIGHT(max_value, 1)), length(max_value) from mysql.column_stats where db_name='test' and table_name='t1'; +HEX(RIGHT(max_value, 1)) length(max_value) +A5 254 +analyze select * from t1 where a >= 'ำฅ'; +id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 2.00 50.00 50.00 Using where +set @save_sql_mode= @@sql_mode; +set sql_mode='ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; +update mysql.column_stats set min_value= REPEAT('ำฅ',255) where db_name='test' and table_name='t1'; +Warnings: +Warning 1265 Data truncated for column 'min_value' at row 1 +select HEX(RIGHT(min_value, 1)), length(min_value) from mysql.column_stats where db_name='test' and table_name='t1'; +HEX(RIGHT(min_value, 1)) length(min_value) +D3 255 +analyze select * from t1 where a >= 'ำฅ'; +id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 2.00 50.00 50.00 Using where +set names latin1; +drop table t1; +CREATE TABLE t1 (col1 date); +INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29'); +INSERT INTO t1 VALUES('0000-10-31'); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +update mysql.column_stats set min_value='2004-0-31123' where db_name='test' and table_name='t1'; +select min_value from mysql.column_stats where db_name='test' and table_name='t1'; +min_value +2004-0-31123 +select * from t1; +col1 +2004-01-01 +2004-02-29 +0000-10-31 +drop table t1; +set @@sql_mode= @save_sql_mode; set use_stat_tables=@save_use_stat_tables; +set @@histogram_size= @save_histogram_size; +set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set optimizer_switch=@save_optimizer_switch_for_stat_tables_test; SET SESSION STORAGE_ENGINE=DEFAULT; diff --git a/mysql-test/t/stat_tables.test b/mysql-test/t/stat_tables.test index b89ab2bbd2d..89c11ed4acf 100644 --- a/mysql-test/t/stat_tables.test +++ b/mysql-test/t/stat_tables.test @@ -401,4 +401,44 @@ SELECT MAX(pk) FROM t1; DROP TABLE t1; +--echo # +--echo # MDEV-18899: Server crashes in Field::set_warning_truncated_wrong_value +--echo # + +set names utf8; +set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity; +set optimizer_use_condition_selectivity=4; +set use_stat_tables=preferably; +set @save_histogram_size= @@histogram_size; +set histogram_size=255; + +create table t1 ( a varchar(255) character set utf8); +insert into t1 values (REPEAT('ำฅ',255)), (REPEAT('รง',255)); + +analyze table t1; +select HEX(RIGHT(min_value, 1)), length(min_value) from mysql.column_stats where db_name='test' and table_name='t1'; +select HEX(RIGHT(max_value, 1)), length(max_value) from mysql.column_stats where db_name='test' and table_name='t1'; +analyze select * from t1 where a >= 'ำฅ'; + +set @save_sql_mode= @@sql_mode; +set sql_mode='ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; +update mysql.column_stats set min_value= REPEAT('ำฅ',255) where db_name='test' and table_name='t1'; +select HEX(RIGHT(min_value, 1)), length(min_value) from mysql.column_stats where db_name='test' and table_name='t1'; +analyze select * from t1 where a >= 'ำฅ'; + +set names latin1; +drop table t1; + +CREATE TABLE t1 (col1 date); +INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29'); +INSERT INTO t1 VALUES('0000-10-31'); +analyze table t1; +update mysql.column_stats set min_value='2004-0-31123' where db_name='test' and table_name='t1'; +select min_value from mysql.column_stats where db_name='test' and table_name='t1'; +select * from t1; +drop table t1; + +set @@sql_mode= @save_sql_mode; set use_stat_tables=@save_use_stat_tables; +set @@histogram_size= @save_histogram_size; +set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; diff --git a/sql/field.cc b/sql/field.cc index 080cf34c76d..0621015c0e4 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7027,8 +7027,11 @@ Field_longstr::check_string_copy_error(const String_copier *copier, if (!(pos= copier->most_important_error_pos())) return FALSE; - convert_to_printable(tmp, sizeof(tmp), pos, (end - pos), cs, 6); - set_warning_truncated_wrong_value("string", tmp); + if (!is_stat_field) + { + convert_to_printable(tmp, sizeof(tmp), pos, (end - pos), cs, 6); + set_warning_truncated_wrong_value("string", tmp); + } return TRUE; } diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index b5811c683e8..0a51346adb2 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -1060,7 +1060,9 @@ public: else { table_field->collected_stats->min_value->val_str(&val); - stat_field->store(val.ptr(), val.length(), &my_charset_bin); + uint32 length= Well_formed_prefix(val.charset(), val.ptr(), + MY_MIN(val.length(), stat_field->field_length)).length(); + stat_field->store(val.ptr(), length, &my_charset_bin); } break; case COLUMN_STAT_MAX_VALUE: @@ -1069,7 +1071,9 @@ public: else { table_field->collected_stats->max_value->val_str(&val); - stat_field->store(val.ptr(), val.length(), &my_charset_bin); + uint32 length= Well_formed_prefix(val.charset(), val.ptr(), + MY_MIN(val.length(), stat_field->field_length)).length(); + stat_field->store(val.ptr(), length, &my_charset_bin); } break; case COLUMN_STAT_NULLS_RATIO: @@ -3059,7 +3063,7 @@ int read_statistics_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables) } } } - + table->stats_is_read= TRUE; DBUG_RETURN(0); From 0623cc7c16c3280d1f81b9049e1561d1b4b6c1d0 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Wed, 27 Mar 2019 18:58:43 +0530 Subject: [PATCH 22/47] MDEV-19051 Avoid unnecessary writing MLOG_INDEX_LOAD 1) Avoid writing of MLOG_INDEX_LOAD redo log record during inplace alter table when the table is empty and also for spatial index. 2) Avoid creation of temporary merge file for spatial index during index creation process. --- storage/innobase/include/btr0bulk.h | 2 + storage/innobase/include/trx0trx.h | 36 ++++++----- storage/innobase/row/row0ftsort.cc | 2 +- storage/innobase/row/row0merge.cc | 93 +++++++++++++---------------- storage/innobase/trx/trx0trx.cc | 30 ++++++---- 5 files changed, 84 insertions(+), 79 deletions(-) diff --git a/storage/innobase/include/btr0bulk.h b/storage/innobase/include/btr0bulk.h index a63ab9ded0d..7e277adfbc3 100644 --- a/storage/innobase/include/btr0bulk.h +++ b/storage/innobase/include/btr0bulk.h @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2014, 2015, 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 @@ -284,6 +285,7 @@ public: m_trx(trx), m_flush_observer(observer) { + ut_ad(!dict_index_is_spatial(index)); #ifdef UNIV_DEBUG if (m_flush_observer) fil_space_inc_redo_skipped_count(m_index->space); diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 8fde5689e40..159dcca2581 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2018, MariaDB Corporation. +Copyright (c) 2015, 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 @@ -40,20 +40,9 @@ Created 3/26/1996 Heikki Tuuri // Forward declaration struct mtr_t; - -// Forward declaration class ReadView; - -// Forward declaration class FlushObserver; - -/** Set flush observer for the transaction -@param[in/out] trx transaction struct -@param[in] observer flush observer */ -void -trx_set_flush_observer( - trx_t* trx, - FlushObserver* observer); +class ut_stage_alter_t; /******************************************************************//** Set detailed error message for the transaction. */ @@ -1132,8 +1121,11 @@ struct trx_t { /*------------------------------*/ char* detailed_error; /*!< detailed error message for last error, or empty. */ - FlushObserver* flush_observer; /*!< flush observer */ - +private: + /** flush observer used to track flushing of non-redo logged pages + during bulk create index */ + FlushObserver* flush_observer; +public: /* Lock wait statistics */ ulint n_rec_lock_waits; /*!< Number of record lock waits, @@ -1177,6 +1169,20 @@ struct trx_t { return(assign_temp_rseg()); } + /** Set the innodb_log_optimize_ddl page flush observer + @param[in] space_id tablespace id + @param[in,out] stage performance_schema accounting */ + void set_flush_observer(ulint space_id, ut_stage_alter_t* stage); + + /** Remove the flush observer */ + void remove_flush_observer(); + + /** @return the flush observer */ + FlushObserver* get_flush_observer() const + { + return flush_observer; + } + private: /** Assign a rollback segment for modifying temporary tables. @return the assigned rollback segment */ diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index de622527766..2e321411a9a 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -1673,7 +1673,7 @@ row_fts_merge_insert( /* Create bulk load instance */ ins_ctx.btr_bulk = UT_NEW_NOKEY( BtrBulk(aux_index, trx, psort_info[0].psort_common->trx - ->flush_observer)); + ->get_flush_observer())); /* Create tuple for insert */ ins_ctx.tuple = dtuple_create(heap, dict_index_get_n_fields(aux_index)); diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 72e0a055af3..a12a2a73ace 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1736,7 +1736,6 @@ row_merge_read_clustered_index( mem_heap_t* mtuple_heap = NULL; mtuple_t prev_mtuple; mem_heap_t* conv_heap = NULL; - FlushObserver* observer = trx->flush_observer; double curr_progress = 0.0; ib_uint64_t read_rows = 0; ib_uint64_t table_total_rows = 0; @@ -2211,9 +2210,8 @@ write_buffers: bool skip_sort = skip_pk_sort && dict_index_is_clust(merge_buf[0]->index); - for (ulint i = 0; i < n_index; i++, skip_sort = false) { + for (ulint k = 0, i = 0; i < n_index; i++, skip_sort = false) { row_merge_buf_t* buf = merge_buf[i]; - merge_file_t* file = &files[i]; ulint rows_added = 0; if (dict_index_is_spatial(buf->index)) { @@ -2237,6 +2235,8 @@ write_buffers: continue; } + merge_file_t* file = &files[k++]; + if (UNIV_LIKELY (row && (rows_added = row_merge_buf_add( buf, fts_index, old_table, new_table, @@ -2244,6 +2244,15 @@ write_buffers: conv_heap, &err, &v_heap, eval_table, trx)))) { + /* Set the page flush observer for the + transaction when buffering the very first + record for a non-redo-logged operation. */ + if (file->n_rec == 0 && i == 0 + && innodb_log_optimize_ddl) { + trx->set_flush_observer( + new_table->space, stage); + } + /* If we are creating FTS index, a single row can generate more records for tokenized word */ @@ -2383,7 +2392,7 @@ write_buffers: clust_btr_bulk = UT_NEW_NOKEY( BtrBulk(index[i], trx, - observer/**/)); + trx->get_flush_observer())); } else { clust_btr_bulk->latch(); } @@ -2495,8 +2504,9 @@ write_buffers: trx->error_key_num = i; goto all_done;); - BtrBulk btr_bulk(index[i], trx, - observer); + BtrBulk btr_bulk( + index[i], trx, + trx->get_flush_observer()); err = row_merge_insert_index_tuples( index[i], old_table, @@ -4597,47 +4607,26 @@ row_merge_build_indexes( } trx_start_if_not_started_xa(trx, true); + ulint n_merge_files = 0; - /* Check if we need a flush observer to flush dirty pages. - Since we disable redo logging in bulk load, so we should flush - dirty pages before online log apply, because online log apply enables - redo logging(we can do further optimization here). - 1. online add index: flush dirty pages right before row_log_apply(). - 2. table rebuild: flush dirty pages before row_log_table_apply(). - - we use bulk load to create all types of indexes except spatial index, - for which redo logging is enabled. If we create only spatial indexes, - we don't need to flush dirty pages at all. */ - bool need_flush_observer = bool(innodb_log_optimize_ddl); - - if (need_flush_observer) { - need_flush_observer = old_table != new_table; - - for (i = 0; i < n_indexes; i++) { - if (!dict_index_is_spatial(indexes[i])) { - need_flush_observer = true; - } + for (ulint i = 0; i < n_indexes; i++) + { + if (!dict_index_is_spatial(indexes[i])) { + n_merge_files++; } } - FlushObserver* flush_observer = NULL; - if (need_flush_observer) { - flush_observer = UT_NEW_NOKEY( - FlushObserver(new_table->space, trx, stage)); - - trx_set_flush_observer(trx, flush_observer); - } - merge_files = static_cast( - ut_malloc_nokey(n_indexes * sizeof *merge_files)); + ut_malloc_nokey(n_merge_files * sizeof *merge_files)); /* Initialize all the merge file descriptors, so that we don't call row_merge_file_destroy() on uninitialized merge file descriptor */ - for (i = 0; i < n_indexes; i++) { + for (i = 0; i < n_merge_files; i++) { merge_files[i].fd = -1; merge_files[i].offset = 0; + merge_files[i].n_rec = 0; } total_static_cost = COST_BUILD_INDEX_STATIC * n_indexes + COST_READ_CLUSTERED_INDEX; @@ -4720,7 +4709,7 @@ row_merge_build_indexes( " and create temporary files"); } - for (i = 0; i < n_indexes; i++) { + for (i = 0; i < n_merge_files; i++) { total_index_blocks += merge_files[i].offset; } @@ -4733,7 +4722,7 @@ row_merge_build_indexes( /* Now we have files containing index entries ready for sorting and inserting. */ - for (i = 0; i < n_indexes; i++) { + for (ulint k = 0, i = 0; i < n_indexes; i++) { dict_index_t* sort_idx = indexes[i]; if (dict_index_is_spatial(sort_idx)) { @@ -4812,13 +4801,13 @@ wait_again: #ifdef FTS_INTERNAL_DIAG_PRINT DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n"); #endif - } else if (merge_files[i].fd >= 0) { + } else if (merge_files[k].fd >= 0) { char buf[NAME_LEN + 1]; row_merge_dup_t dup = { sort_idx, table, col_map, 0}; pct_cost = (COST_BUILD_INDEX_STATIC + - (total_dynamic_cost * merge_files[i].offset / + (total_dynamic_cost * merge_files[k].offset / total_index_blocks)) / (total_static_cost + total_dynamic_cost) * PCT_COST_MERGESORT_INDEX * 100; @@ -4842,7 +4831,7 @@ wait_again: } error = row_merge_sort( - trx, &dup, &merge_files[i], + trx, &dup, &merge_files[k], block, &tmpfd, true, pct_progress, pct_cost, crypt_block, new_table->space, stage); @@ -4864,10 +4853,10 @@ wait_again: if (error == DB_SUCCESS) { BtrBulk btr_bulk(sort_idx, trx, - flush_observer); + trx->get_flush_observer()); pct_cost = (COST_BUILD_INDEX_STATIC + - (total_dynamic_cost * merge_files[i].offset / + (total_dynamic_cost * merge_files[k].offset / total_index_blocks)) / (total_static_cost + total_dynamic_cost) * PCT_COST_INSERT_INDEX * 100; @@ -4884,9 +4873,9 @@ wait_again: error = row_merge_insert_index_tuples( sort_idx, old_table, - merge_files[i].fd, block, NULL, + merge_files[k].fd, block, NULL, &btr_bulk, - merge_files[i].n_rec, pct_progress, pct_cost, + merge_files[k].n_rec, pct_progress, pct_cost, crypt_block, new_table->space, stage); error = btr_bulk.finish(error); @@ -4904,7 +4893,7 @@ wait_again: } /* Close the temporary file to free up space. */ - row_merge_file_destroy(&merge_files[i]); + row_merge_file_destroy(&merge_files[k++]); if (indexes[i]->type & DICT_FTS) { row_fts_psort_info_destroy(psort_info, merge_info); @@ -4916,7 +4905,12 @@ wait_again: ut_ad(sort_idx->online_status == ONLINE_INDEX_COMPLETE); } else { - if (flush_observer) { + if (dict_index_is_spatial(indexes[i])) { + /* We never disable redo logging for + creating SPATIAL INDEX. Avoid writing any + unnecessary MLOG_INDEX_LOAD record. */ + } else if (FlushObserver* flush_observer = + trx->get_flush_observer()) { flush_observer->flush(); row_merge_write_redo(indexes[i]); } @@ -4958,7 +4952,7 @@ func_exit: row_merge_file_destroy_low(tmpfd); - for (i = 0; i < n_indexes; i++) { + for (i = 0; i < n_merge_files; i++) { row_merge_file_destroy(&merge_files[i]); } @@ -5015,8 +5009,7 @@ func_exit: DBUG_EXECUTE_IF("ib_index_crash_after_bulk_load", DBUG_SUICIDE();); - if (flush_observer != NULL) { - ut_ad(need_flush_observer); + if (FlushObserver* flush_observer = trx->get_flush_observer()) { DBUG_EXECUTE_IF("ib_index_build_fail_before_flush", error = DB_INTERRUPTED; @@ -5028,7 +5021,7 @@ func_exit: flush_observer->flush(); - UT_DELETE(flush_observer); + trx->remove_flush_observer(); if (trx_is_interrupted(trx)) { error = DB_INTERRUPTED; diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 704c52ff9af..e548ffbe62b 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2018, MariaDB Corporation. +Copyright (c) 2015, 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 @@ -64,17 +64,6 @@ typedef std::set< std::less, ut_allocator > table_id_set; -/** Set flush observer for the transaction -@param[in/out] trx transaction struct -@param[in] observer flush observer */ -void -trx_set_flush_observer( - trx_t* trx, - FlushObserver* observer) -{ - trx->flush_observer = observer; -} - /*************************************************************//** Set detailed error message for the transaction. */ void @@ -165,7 +154,7 @@ trx_init( trx->lock.table_cached = 0; - trx->flush_observer = NULL; + ut_ad(trx->get_flush_observer() == NULL); } /** For managing the life-cycle of the trx_t instance that we get @@ -1088,6 +1077,21 @@ static trx_rseg_t* trx_assign_rseg_low() return(rseg); } +/** Set the innodb_log_optimize_ddl page flush observer +@param[in] space_id tablespace id +@param[in,out] stage performance_schema accounting */ +void trx_t::set_flush_observer(ulint space_id, ut_stage_alter_t* stage) +{ + flush_observer = UT_NEW_NOKEY(FlushObserver(space_id, this, stage)); +} + +/** Remove the flush observer */ +void trx_t::remove_flush_observer() +{ + UT_DELETE(flush_observer); + flush_observer = NULL; +} + /** Assign a rollback segment for modifying temporary tables. @return the assigned rollback segment */ trx_rseg_t* From d0116e10a5da52503a89a413e481996ce3f65e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 28 Mar 2019 12:27:06 +0200 Subject: [PATCH 23/47] Revert MDEV-18464 and MDEV-12009 This reverts commit 21b2fada7ab7f35c898c02d2f918461409cc9c8e and commit 81d71ee6b21870772c336bff15b71904914f146a. The MDEV-18464 change introduces a few data race issues. Contrary to the documentation, the field trx_t::victim is not always being protected by lock_sys_t::mutex and trx_t::mutex. Most importantly, it seems that KILL QUERY could wrongly avoid acquiring both mutexes when invoking lock_trx_handle_wait_low(), in case another thread had already set trx->victim=true. We also revert MDEV-12009, because it should depend on the MDEV-18464 fix being present. --- include/mysql/service_wsrep.h | 3 -- .../suite/galera/r/galera_kill_applier.result | 4 -- .../suite/galera/t/galera_kill_applier.cnf | 10 ---- .../suite/galera/t/galera_kill_applier.test | 54 ++----------------- sql/sql_parse.cc | 14 ++--- sql/sql_plugin_services.ic | 3 +- sql/wsrep_dummy.cc | 3 -- sql/wsrep_mysqld.cc | 1 + sql/wsrep_thd.cc | 9 ---- sql/wsrep_thd.h | 2 - storage/innobase/handler/ha_innodb.cc | 38 ++++++++++--- storage/innobase/include/trx0trx.h | 19 ++++--- storage/innobase/lock/lock0lock.cc | 50 +++++++---------- storage/innobase/row/row0sel.cc | 4 ++ storage/innobase/trx/trx0roll.cc | 3 +- storage/innobase/trx/trx0trx.cc | 8 ++- storage/xtradb/handler/ha_innodb.cc | 36 ++++++++++--- storage/xtradb/include/trx0trx.h | 19 ++++--- storage/xtradb/lock/lock0lock.cc | 50 +++++++---------- storage/xtradb/row/row0sel.cc | 4 ++ storage/xtradb/trx/trx0roll.cc | 21 +++++++- storage/xtradb/trx/trx0trx.cc | 17 +++++- 22 files changed, 178 insertions(+), 194 deletions(-) delete mode 100644 mysql-test/suite/galera/t/galera_kill_applier.cnf diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h index 59df7a8b561..267c8cb4e90 100644 --- a/include/mysql/service_wsrep.h +++ b/include/mysql/service_wsrep.h @@ -112,7 +112,6 @@ extern struct wsrep_service_st { int (*wsrep_trx_order_before_func)(MYSQL_THD, MYSQL_THD); void (*wsrep_unlock_rollback_func)(); void (*wsrep_set_data_home_dir_func)(const char *data_dir); - my_bool (*wsrep_thd_is_applier_func)(THD *thd); } *wsrep_service; #ifdef MYSQL_DYNAMIC_PLUGIN @@ -156,7 +155,6 @@ extern struct wsrep_service_st { #define wsrep_trx_order_before(T1,T2) wsrep_service->wsrep_trx_order_before_func(T1,T2) #define wsrep_unlock_rollback() wsrep_service->wsrep_unlock_rollback_func() #define wsrep_set_data_home_dir(A) wsrep_service->wsrep_set_data_home_dir_func(A) -#define wsrep_thd_is_applier(T) wsrep_service->wsrep_thd_is_applier_func(T) #define wsrep_debug get_wsrep_debug() #define wsrep_log_conflicts get_wsrep_log_conflicts() @@ -216,7 +214,6 @@ void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state); bool wsrep_thd_ignore_table(THD *thd); void wsrep_unlock_rollback(); void wsrep_set_data_home_dir(const char *data_dir); -my_bool wsrep_thd_is_applier(THD *thd); #endif diff --git a/mysql-test/suite/galera/r/galera_kill_applier.result b/mysql-test/suite/galera/r/galera_kill_applier.result index 89f8ead0b65..fe4911639ed 100644 --- a/mysql-test/suite/galera/r/galera_kill_applier.result +++ b/mysql-test/suite/galera/r/galera_kill_applier.result @@ -1,8 +1,4 @@ -CREATE USER foo@localhost; -GRANT SELECT on test.* TO foo@localhost; -# Open connection to the 1st node using 'test_user1' user. Got one of the listed errors Got one of the listed errors Got one of the listed errors Got one of the listed errors -DROP USER foo@localhost; diff --git a/mysql-test/suite/galera/t/galera_kill_applier.cnf b/mysql-test/suite/galera/t/galera_kill_applier.cnf deleted file mode 100644 index f2563e66f2e..00000000000 --- a/mysql-test/suite/galera/t/galera_kill_applier.cnf +++ /dev/null @@ -1,10 +0,0 @@ -!include ../galera_2nodes.cnf - -[mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' -auto_increment_offset=1 - -[mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' -auto_increment_offset=2 - diff --git a/mysql-test/suite/galera/t/galera_kill_applier.test b/mysql-test/suite/galera/t/galera_kill_applier.test index 5e4a587fe57..e14a8b9af23 100644 --- a/mysql-test/suite/galera/t/galera_kill_applier.test +++ b/mysql-test/suite/galera/t/galera_kill_applier.test @@ -1,25 +1,14 @@ # # This test checks that applier threads are immune to KILL QUERY and KILL STATEMENT -# when USER is not SUPER # --source include/galera_cluster.inc +--source include/have_innodb.inc --connection node_1 -CREATE USER foo@localhost; -GRANT SELECT on test.* TO foo@localhost; - --let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1` ---let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` - ---echo # Open connection to the 1st node using 'test_user1' user. ---let $port_1= \$NODE_MYPORT_1 ---connect(foo_node_1,localhost,foo,,test,$port_1,) - ---connection foo_node_1 - --disable_query_log --error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR --eval KILL $applier_thread @@ -27,48 +16,11 @@ GRANT SELECT on test.* TO foo@localhost; --error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR --eval KILL QUERY $applier_thread +--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` + --error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR --eval KILL $aborter_thread --error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR --eval KILL QUERY $aborter_thread --enable_query_log - -# -# SUPER can kill applier threads -# ---connection node_2 - ---let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1` - ---disable_query_log ---eval KILL $applier_thread ---enable_query_log - ---let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` - ---disable_query_log ---eval KILL $aborter_thread ---enable_query_log - ---source include/restart_mysqld.inc - ---connection node_2 ---let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1` - ---disable_query_log ---eval KILL QUERY $applier_thread ---enable_query_log - ---let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` - ---disable_query_log ---eval KILL QUERY $aborter_thread ---enable_query_log - ---source include/restart_mysqld.inc - ---connection node_1 ---disconnect foo_node_1 -DROP USER foo@localhost; - diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 920f7ac0329..1f060305d4f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -8292,19 +8292,11 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ It's ok to also kill DELAYED threads with KILL_CONNECTION instead of KILL_SYSTEM_THREAD; The difference is that KILL_CONNECTION may be faster and do a harder kill than KILL_SYSTEM_THREAD; - - Note that if thread is wsrep Brute Force or applier thread we - allow killing it only when we're SUPER. */ - if ((thd->security_ctx->master_access & SUPER_ACL) || - (thd->security_ctx->user_matches(tmp->security_ctx) -#ifdef WITH_WSREP - && - !tmp->wsrep_applier && - !wsrep_thd_is_BF(tmp, false) -#endif - )) + if (((thd->security_ctx->master_access & SUPER_ACL) || + thd->security_ctx->user_matches(tmp->security_ctx)) && + !wsrep_thd_is_BF(tmp, false)) { tmp->awake(kill_signal); error=0; diff --git a/sql/sql_plugin_services.ic b/sql/sql_plugin_services.ic index d70c76701fd..427d8937c57 100644 --- a/sql/sql_plugin_services.ic +++ b/sql/sql_plugin_services.ic @@ -181,8 +181,7 @@ static struct wsrep_service_st wsrep_handler = { wsrep_trx_is_aborting, wsrep_trx_order_before, wsrep_unlock_rollback, - wsrep_set_data_home_dir, - wsrep_thd_is_applier, + wsrep_set_data_home_dir }; static struct thd_specifics_service_st thd_specifics_handler= diff --git a/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc index e2a4dcf3bad..795e2d19252 100644 --- a/sql/wsrep_dummy.cc +++ b/sql/wsrep_dummy.cc @@ -20,9 +20,6 @@ my_bool wsrep_thd_is_BF(THD *, my_bool) { return 0; } -my_bool wsrep_thd_is_applier(THD *) -{ return 0; } - int wsrep_trx_order_before(THD *, THD *) { return 0; } diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 82415691b3f..ee8509e3fa2 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -2470,6 +2470,7 @@ extern "C" void wsrep_thd_set_exec_mode(THD *thd, enum wsrep_exec_mode mode) thd->wsrep_exec_mode= mode; } + extern "C" void wsrep_thd_set_query_state( THD *thd, enum wsrep_query_state state) { diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index 91f0e1e8d8a..551e710cfeb 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -596,15 +596,6 @@ my_bool wsrep_thd_is_BF(THD *thd, my_bool sync) return status; } -my_bool wsrep_thd_is_applier(THD *thd) -{ - my_bool ret = FALSE; - if (thd) { - ret = thd->wsrep_applier; - } - return ret; -} - extern "C" my_bool wsrep_thd_is_BF_or_commit(void *thd_ptr, my_bool sync) { diff --git a/sql/wsrep_thd.h b/sql/wsrep_thd.h index f5fcb50280c..5900668f3fb 100644 --- a/sql/wsrep_thd.h +++ b/sql/wsrep_thd.h @@ -37,7 +37,6 @@ int wsrep_abort_thd(void *bf_thd_ptr, void *victim_thd_ptr, */ extern void wsrep_thd_set_PA_safe(void *thd_ptr, my_bool safe); extern my_bool wsrep_thd_is_BF(THD *thd, my_bool sync); -extern my_bool wsrep_thd_is_applier(THD *thd); extern my_bool wsrep_thd_is_wsrep(void *thd_ptr); enum wsrep_conflict_state wsrep_thd_conflict_state(void *thd_ptr, my_bool sync); @@ -48,7 +47,6 @@ extern "C" int wsrep_thd_in_locking_session(void *thd_ptr); #else /* WITH_WSREP */ #define wsrep_thd_is_BF(T, S) (0) -#define wsrep_thd_is_applier(T) (0) #define wsrep_abort_thd(X,Y,Z) do { } while(0) #define wsrep_create_appliers(T) do { } while(0) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index c55eaf59879..cd605b6b791 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -4929,6 +4929,8 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) /* if victim has been signaled by BF thread and/or aborting is already progressing, following query aborting is not necessary any more. + Also, BF thread should own trx mutex for the victim, which would + conflict with trx_mutex_enter() below */ DBUG_VOID_RETURN; } @@ -4937,8 +4939,34 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) if (trx_t* trx = thd_to_trx(thd)) { ut_ad(trx->mysql_thd == thd); + switch (trx->abort_type) { +#ifdef WITH_WSREP + case TRX_WSREP_ABORT: + break; +#endif + case TRX_SERVER_ABORT: + if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { + lock_mutex_enter(); + } + /* fall through */ + case TRX_REPLICATION_ABORT: + trx_mutex_enter(trx); + } /* Cancel a pending lock request if there are any */ lock_trx_handle_wait(trx); + switch (trx->abort_type) { +#ifdef WITH_WSREP + case TRX_WSREP_ABORT: + break; +#endif + case TRX_SERVER_ABORT: + if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { + lock_mutex_exit(); + } + /* fall through */ + case TRX_REPLICATION_ABORT: + trx_mutex_exit(trx); + } } DBUG_VOID_RETURN; @@ -18655,12 +18683,6 @@ wsrep_innobase_kill_one_trx( wsrep_thd_ws_handle(thd)->trx_id); wsrep_thd_LOCK(thd); - - /* We mark this as victim transaction, which is already marked - as BF victim. Both trx mutex and lock_sys mutex is held until - this victim has aborted. */ - victim_trx->victim = true; - DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock", { const char act[]= @@ -18844,7 +18866,7 @@ wsrep_abort_transaction( my_bool signal) { DBUG_ENTER("wsrep_innobase_abort_thd"); - + trx_t* victim_trx = thd_to_trx(victim_thd); trx_t* bf_trx = (bf_thd) ? thd_to_trx(bf_thd) : NULL; @@ -18856,10 +18878,12 @@ wsrep_abort_transaction( if (victim_trx) { lock_mutex_enter(); trx_mutex_enter(victim_trx); + victim_trx->abort_type = TRX_WSREP_ABORT; int rcode = wsrep_innobase_kill_one_trx(bf_thd, bf_trx, victim_trx, signal); trx_mutex_exit(victim_trx); lock_mutex_exit(); + victim_trx->abort_type = TRX_SERVER_ABORT; wsrep_srv_conc_cancel_wait(victim_trx); DBUG_RETURN(rcode); } else { diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index b40c6ae4667..fe16b8272b8 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2019, MariaDB Corporation. +Copyright (c) 2015, 2018, 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 @@ -623,6 +623,7 @@ struct trx_lock_t { lock_sys->mutex. Otherwise, this may only be modified by the thread that is serving the running transaction. */ + mem_heap_t* lock_heap; /*!< memory heap for trx_locks; protected by lock_sys->mutex */ @@ -694,6 +695,14 @@ lock_rec_convert_impl_to_expl()) will access transactions associated to other connections. The locks of transactions are protected by lock_sys->mutex and sometimes by trx->mutex. */ +enum trx_abort_t { + TRX_SERVER_ABORT = 0, +#ifdef WITH_WSREP + TRX_WSREP_ABORT, +#endif + TRX_REPLICATION_ABORT +}; + struct trx_t{ ulint magic_n; @@ -871,12 +880,8 @@ struct trx_t{ /*------------------------------*/ THD* mysql_thd; /*!< MySQL thread handle corresponding to this trx, or NULL */ - bool victim; /*!< This transaction is - selected as victim for abort - either by replication or - high priority wsrep thread. This - field is protected by trx and - lock sys mutex. */ + trx_abort_t abort_type; /*!< Transaction abort type*/ + const char* mysql_log_file_name; /*!< if MySQL binlog is used, this field contains a pointer to the latest file diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 33563a03f1a..f06fcd6c4d8 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2019, MariaDB Corporation. +Copyright (c) 2014, 2018, 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 @@ -1793,8 +1793,10 @@ wsrep_kill_victim( } } + lock->trx->abort_type = TRX_WSREP_ABORT; wsrep_innobase_kill_one_trx(trx->mysql_thd, (const trx_t*) trx, lock->trx, TRUE); + lock->trx->abort_type = TRX_SERVER_ABORT; } } } @@ -4780,11 +4782,12 @@ lock_report_waiters_to_mysql( if (w_trx->id != victim_trx_id) { /* If thd_report_wait_for() decides to kill the transaction, then we will get a call back into - innobase_kill_query.*/ - trx_mutex_enter(w_trx); - w_trx->victim = true; + innobase_kill_query. We mark this by setting + current_lock_mutex_owner, so we can avoid trying + to recursively take lock_sys->mutex. */ + w_trx->abort_type = TRX_REPLICATION_ABORT; thd_report_wait_for(mysql_thd, w_trx->mysql_thd); - trx_mutex_exit(w_trx); + w_trx->abort_type = TRX_SERVER_ABORT; } ++i; } @@ -7964,7 +7967,16 @@ lock_trx_release_locks( lock_mutex_exit(); } -inline dberr_t lock_trx_handle_wait_low(trx_t* trx) +/*********************************************************************//** +Check whether the transaction has already been rolled back because it +was selected as a deadlock victim, or if it has to wait then cancel +the wait lock. +@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ +UNIV_INTERN +dberr_t +lock_trx_handle_wait( +/*=================*/ + trx_t* trx) /*!< in/out: trx lock state */ { ut_ad(lock_mutex_own()); ut_ad(trx_mutex_own(trx)); @@ -7981,32 +7993,6 @@ inline dberr_t lock_trx_handle_wait_low(trx_t* trx) return DB_LOCK_WAIT; } -/*********************************************************************//** -Check whether the transaction has already been rolled back because it -was selected as a deadlock victim, or if it has to wait then cancel -the wait lock. -@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ -UNIV_INTERN -dberr_t -lock_trx_handle_wait( -/*=================*/ - trx_t* trx) /*!< in/out: trx lock state */ -{ - if (!trx->victim) { - lock_mutex_enter(); - trx_mutex_enter(trx); - } - - dberr_t err = lock_trx_handle_wait_low(trx); - - if (!trx->victim) { - lock_mutex_exit(); - trx_mutex_exit(trx); - } - - return err; -} - /*********************************************************************//** Get the number of locks on a table. @return number of locks */ diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 855266686e6..06bf4cc30c0 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -4746,7 +4746,11 @@ no_gap_lock: a deadlock and the transaction had to wait then release the lock it is waiting on. */ + lock_mutex_enter(); + trx_mutex_enter(trx); err = lock_trx_handle_wait(trx); + lock_mutex_exit(); + trx_mutex_exit(trx); switch (err) { case DB_SUCCESS: diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc index 127e834335d..3fd71aff23a 100644 --- a/storage/innobase/trx/trx0roll.cc +++ b/storage/innobase/trx/trx0roll.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2019, MariaDB Corporation. +Copyright (c) 2016, 2018, 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 @@ -370,7 +370,6 @@ trx_rollback_to_savepoint_for_mysql_low( trx_mark_sql_stat_end(trx); trx->op_info = ""; - trx->victim = false; return(err); } diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 98ac08a00e7..f36aabba8b4 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2019, MariaDB Corporation. +Copyright (c) 2015, 2018, 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 @@ -1339,7 +1339,11 @@ trx_commit_in_memory( ut_ad(!trx->in_ro_trx_list); ut_ad(!trx->in_rw_trx_list); - trx->victim = false; +#ifdef WITH_WSREP + if (trx->mysql_thd && wsrep_on(trx->mysql_thd)) { + trx->lock.was_chosen_as_deadlock_victim = FALSE; + } +#endif trx->dict_operation = TRX_DICT_OP_NONE; trx->error_state = DB_SUCCESS; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 55c49711f19..a0df23b60d4 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -5534,6 +5534,8 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) /* if victim has been signaled by BF thread and/or aborting is already progressing, following query aborting is not necessary any more. + Also, BF thread should own trx mutex for the victim, which would + conflict with trx_mutex_enter() below */ DBUG_VOID_RETURN; } @@ -5541,8 +5543,34 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) if (trx_t* trx = thd_to_trx(thd)) { ut_ad(trx->mysql_thd == thd); + switch (trx->abort_type) { +#ifdef WITH_WSREP + case TRX_WSREP_ABORT: + break; +#endif + case TRX_SERVER_ABORT: + if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { + lock_mutex_enter(); + } + /* fall through */ + case TRX_REPLICATION_ABORT: + trx_mutex_enter(trx); + } /* Cancel a pending lock request if there are any */ lock_trx_handle_wait(trx); + switch (trx->abort_type) { +#ifdef WITH_WSREP + case TRX_WSREP_ABORT: + break; +#endif + case TRX_SERVER_ABORT: + if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { + lock_mutex_exit(); + } + /* fall through */ + case TRX_REPLICATION_ABORT: + trx_mutex_exit(trx); + } } DBUG_VOID_RETURN; @@ -19695,12 +19723,6 @@ wsrep_innobase_kill_one_trx( (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void"); wsrep_thd_LOCK(thd); - - /* We mark this as victim transaction, which is already marked - as BF victim. Both trx mutex and lock_sys mutex is held until - this victim has aborted. */ - victim_trx->victim = true; - DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock", { const char act[]= @@ -19889,10 +19911,12 @@ wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd, if (victim_trx) { lock_mutex_enter(); trx_mutex_enter(victim_trx); + victim_trx->abort_type = TRX_WSREP_ABORT; int rcode = wsrep_innobase_kill_one_trx(bf_thd, bf_trx, victim_trx, signal); trx_mutex_exit(victim_trx); lock_mutex_exit(); + victim_trx->abort_type = TRX_SERVER_ABORT; wsrep_srv_conc_cancel_wait(victim_trx); DBUG_RETURN(rcode); } else { diff --git a/storage/xtradb/include/trx0trx.h b/storage/xtradb/include/trx0trx.h index df01284af05..77afde4c35c 100644 --- a/storage/xtradb/include/trx0trx.h +++ b/storage/xtradb/include/trx0trx.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2019, MariaDB Corporation. +Copyright (c) 2015, 2018, 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 @@ -672,6 +672,7 @@ struct trx_lock_t { lock_sys->mutex. Otherwise, this may only be modified by the thread that is serving the running transaction. */ + mem_heap_t* lock_heap; /*!< memory heap for trx_locks; protected by lock_sys->mutex */ @@ -743,6 +744,14 @@ lock_rec_convert_impl_to_expl()) will access transactions associated to other connections. The locks of transactions are protected by lock_sys->mutex and sometimes by trx->mutex. */ +enum trx_abort_t { + TRX_SERVER_ABORT = 0, +#ifdef WITH_WSREP + TRX_WSREP_ABORT, +#endif + TRX_REPLICATION_ABORT +}; + struct trx_t{ ulint magic_n; @@ -921,12 +930,8 @@ struct trx_t{ /*------------------------------*/ THD* mysql_thd; /*!< MySQL thread handle corresponding to this trx, or NULL */ - bool victim; /*!< This transaction is - selected as victim for abort - either by replication or - high priority wsrep thread. This - field is protected by trx and - lock sys mutex. */ + trx_abort_t abort_type; /*!< Transaction abort type */ + const char* mysql_log_file_name; /*!< if MySQL binlog is used, this field contains a pointer to the latest file diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index 2999c339457..9daa2cc906f 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2019, MariaDB Corporation. +Copyright (c) 2014, 2018, 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 @@ -1804,8 +1804,10 @@ wsrep_kill_victim( } } + lock->trx->abort_type = TRX_WSREP_ABORT; wsrep_innobase_kill_one_trx(trx->mysql_thd, (const trx_t*) trx, lock->trx, TRUE); + lock->trx->abort_type = TRX_SERVER_ABORT; } } } @@ -4819,11 +4821,12 @@ lock_report_waiters_to_mysql( if (w_trx->id != victim_trx_id) { /* If thd_report_wait_for() decides to kill the transaction, then we will get a call back into - innobase_kill_query.*/ - trx_mutex_enter(w_trx); - w_trx->victim = true; + innobase_kill_query. We mark this by setting + current_lock_mutex_owner, so we can avoid trying + to recursively take lock_sys->mutex. */ + w_trx->abort_type = TRX_REPLICATION_ABORT; thd_report_wait_for(mysql_thd, w_trx->mysql_thd); - trx_mutex_exit(w_trx); + w_trx->abort_type = TRX_SERVER_ABORT; } ++i; } @@ -8074,7 +8077,16 @@ lock_trx_release_locks( lock_mutex_exit(); } -inline dberr_t lock_trx_handle_wait_low(trx_t* trx) +/*********************************************************************//** +Check whether the transaction has already been rolled back because it +was selected as a deadlock victim, or if it has to wait then cancel +the wait lock. +@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ +UNIV_INTERN +dberr_t +lock_trx_handle_wait( +/*=================*/ + trx_t* trx) /*!< in/out: trx lock state */ { ut_ad(lock_mutex_own()); ut_ad(trx_mutex_own(trx)); @@ -8091,32 +8103,6 @@ inline dberr_t lock_trx_handle_wait_low(trx_t* trx) return DB_LOCK_WAIT; } -/*********************************************************************//** -Check whether the transaction has already been rolled back because it -was selected as a deadlock victim, or if it has to wait then cancel -the wait lock. -@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ -UNIV_INTERN -dberr_t -lock_trx_handle_wait( -/*=================*/ - trx_t* trx) /*!< in/out: trx lock state */ -{ - if (!trx->victim) { - lock_mutex_enter(); - trx_mutex_enter(trx); - } - - dberr_t err = lock_trx_handle_wait_low(trx); - - if (!trx->victim) { - lock_mutex_exit(); - trx_mutex_exit(trx); - } - - return err; -} - /*********************************************************************//** Get the number of locks on a table. @return number of locks */ diff --git a/storage/xtradb/row/row0sel.cc b/storage/xtradb/row/row0sel.cc index 87bc2aa2875..b6b5d107885 100644 --- a/storage/xtradb/row/row0sel.cc +++ b/storage/xtradb/row/row0sel.cc @@ -4755,7 +4755,11 @@ no_gap_lock: a deadlock and the transaction had to wait then release the lock it is waiting on. */ + lock_mutex_enter(); + trx_mutex_enter(trx); err = lock_trx_handle_wait(trx); + lock_mutex_exit(); + trx_mutex_exit(trx); switch (err) { case DB_SUCCESS: diff --git a/storage/xtradb/trx/trx0roll.cc b/storage/xtradb/trx/trx0roll.cc index 127e834335d..56b7120fa34 100644 --- a/storage/xtradb/trx/trx0roll.cc +++ b/storage/xtradb/trx/trx0roll.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2019, MariaDB Corporation. +Copyright (c) 2016, 2018, 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 @@ -33,6 +33,8 @@ Created 3/26/1996 Heikki Tuuri #include "trx0roll.ic" #endif +#include + #include "fsp0fsp.h" #include "mach0data.h" #include "trx0rseg.h" @@ -49,6 +51,9 @@ Created 3/26/1996 Heikki Tuuri #include "pars0pars.h" #include "srv0mon.h" #include "trx0sys.h" +#ifdef WITH_WSREP +#include "ha_prototypes.h" +#endif /* WITH_WSREP */ /** This many pages must be undone before a truncate is tried within rollback */ @@ -370,7 +375,13 @@ trx_rollback_to_savepoint_for_mysql_low( trx_mark_sql_stat_end(trx); trx->op_info = ""; - trx->victim = false; + +#ifdef WITH_WSREP + if (wsrep_on(trx->mysql_thd) && + trx->lock.was_chosen_as_deadlock_victim) { + trx->lock.was_chosen_as_deadlock_victim = FALSE; + } +#endif return(err); } @@ -1068,6 +1079,12 @@ trx_roll_try_truncate( if (trx->update_undo) { trx_undo_truncate_end(trx, trx->update_undo, limit); } + +#ifdef WITH_WSREP_OUT + if (wsrep_on(trx->mysql_thd)) { + trx->lock.was_chosen_as_deadlock_victim = FALSE; + } +#endif /* WITH_WSREP */ } /***********************************************************************//** diff --git a/storage/xtradb/trx/trx0trx.cc b/storage/xtradb/trx/trx0trx.cc index 8ca247fadc8..17cba81daf3 100644 --- a/storage/xtradb/trx/trx0trx.cc +++ b/storage/xtradb/trx/trx0trx.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2019, MariaDB Corporation. +Copyright (c) 2015, 2018, 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 @@ -1563,7 +1563,11 @@ trx_commit_in_memory( ut_ad(!trx->in_ro_trx_list); ut_ad(!trx->in_rw_trx_list); - trx->victim = false; +#ifdef WITH_WSREP + if (trx->mysql_thd && wsrep_on(trx->mysql_thd)) { + trx->lock.was_chosen_as_deadlock_victim = FALSE; + } +#endif trx->dict_operation = TRX_DICT_OP_NONE; trx->error_state = DB_SUCCESS; @@ -2664,6 +2668,10 @@ trx_start_if_not_started_low( { switch (trx->state) { case TRX_STATE_NOT_STARTED: +#ifdef WITH_WSREP + ut_d(trx->start_file = __FILE__); + ut_d(trx->start_line = __LINE__); +#endif /* WITH_WSREP */ trx_start_low(trx); /* fall through */ case TRX_STATE_ACTIVE: @@ -2697,6 +2705,11 @@ trx_start_for_ddl_low( trx->will_lock = 1; trx->ddl = true; + +#ifdef WITH_WSREP + ut_d(trx->start_file = __FILE__); + ut_d(trx->start_line = __LINE__); +#endif /* WITH_WSREP */ trx_start_low(trx); return; From 05ad7fc3ed886351e23b61af1856d666d979146f Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 28 Mar 2019 11:42:21 +0100 Subject: [PATCH 24/47] MDEV-19054 : mysql_upgrade_service now allows MySQL 5.7 to MariaDB 10.2 upgrade. --- sql/winservice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/winservice.c b/sql/winservice.c index efbbb527c9b..f817ab2b142 100644 --- a/sql/winservice.c +++ b/sql/winservice.c @@ -108,7 +108,7 @@ BOOL exclude_service(mysqld_service_properties *props) } if ((props->version_major == 0) || (props->version_major > 5 && props->version_major < 10) || - (props->version_major == 5 && props->version_minor > 6)) + (props->version_major == 5 && props->version_minor > 7)) { return TRUE; } From e42192d7b3821640bcf18c58dc303a2338c6d1aa Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Thu, 28 Mar 2019 20:35:39 +0530 Subject: [PATCH 25/47] MDEV-13895: GTID and Master_Delay causes excessive initial delay Problem: ======== When attempting to delay a Slave attached with GTID, there appears to be an extra delay applied initially. For example, this output reflects a Slave that is already delayed by 43200 seconds. When switching to GTID replication, replication is paused until SQL_Remaining_Delay counts down to 0: CHANGE MASTER TO master_use_gtid=current_pos; CHANGE MASTER TO MASTER_DELAY=43200; Seconds_Behind_Master: 44847 Using_Gtid: Current_Pos SQL_Delay: 43200 SQL_Remaining_Delay: 43089 Slave_SQL_Running_State: Waiting until MASTER_DELAY seconds after master executed event Analysis: ========= When slave initiates a GTID based connection request to master, the master sends two GTID_LIST events. The first one is actual GTID_LIST event and the second one is a fake GTID_LIST event. This is sent by master to provide its current binlary log file position. The fake GTID_LIST events will have their ev->when=0. 'when' (the timestamp) is set to 0 so that slave could distinguish between real and fake Rotate events. On slave side when MASTER_DELAY is configured to "X" the applier will ensure that there is a time delay of "X" seconds before the event is applied. General behaviour of MASTER_DELAY example:- Master timestamp of event e1=10 timestamp of event e2=11 On slave MASTER_DELAY=5 Event e1 will be applied at = 15 e2 will be applied at =16 In bug scenario:- On Master: With GTIDs timestamp of event e1=10 timestamp of event e2=0 On Slave: e1 will be applied at = 10 + 5 =15 For e2, since "e2->when=0" e2->when is set to current timestamp. i.e since the e2->when and current timestamp on slave is the same applier waits for additional master_delay=5 seconds. the ev->when contributes to "rli->last_master_timestamp". rli->last_master_timestamp= ev->when + (time_t) ev->exec_time; Fake events should not update the "ev->when" to "current timestamp" on slave. Fix: === Remove the assignment of current timestamp to "ev->when" when "ev->when=0". --- .../r/rpl_gtid_excess_initial_delay.result | 23 ++++++++ .../rpl/t/rpl_gtid_excess_initial_delay.test | 58 +++++++++++++++++++ sql/slave.cc | 6 -- 3 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_gtid_excess_initial_delay.result create mode 100644 mysql-test/suite/rpl/t/rpl_gtid_excess_initial_delay.test diff --git a/mysql-test/suite/rpl/r/rpl_gtid_excess_initial_delay.result b/mysql-test/suite/rpl/r/rpl_gtid_excess_initial_delay.result new file mode 100644 index 00000000000..641d186ab78 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_gtid_excess_initial_delay.result @@ -0,0 +1,23 @@ +include/master-slave.inc +[connection master] +CREATE TABLE t1 (i INT); +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID= current_pos, MASTER_DELAY= 10; +include/start_slave.inc +connection master; +INSERT INTO t1 VALUES (1); +include/sync_slave_io_with_master.inc +connection slave; +"Sleeping for 15" +# Asserted this: Seconds_Behind_Master should be less than MASTER_DELAY +# Asserted this: One row shoule be found in table t1. +"======= Clean up ========" +STOP SLAVE; +CHANGE MASTER TO MASTER_USE_GTID=no, MASTER_DELAY=0; +START SLAVE; +connection master; +DROP TABLE t1; +connection slave; +connection master; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_excess_initial_delay.test b/mysql-test/suite/rpl/t/rpl_gtid_excess_initial_delay.test new file mode 100644 index 00000000000..d840b67e9e8 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_gtid_excess_initial_delay.test @@ -0,0 +1,58 @@ +# ==== Purpose ==== +# +# Test verifies that when "Master_Delay" is specified on slave with GTIDS there +# will not be any extra delay initially. +# +# ==== Implementation ==== +# +# Steps: +# 0 - Stop the slave and execute CHANGE MASTER command with +# master_use_gtid= curren_pos and master_delay= 10 +# 1 - On slave introduce a sleep of 15 seconds and check that the +# Seconds_Behind_Master is within specified master_delay limit. It should +# not be more that "10" seconds. +# +# ==== References ==== +# +# MDEV-13895: GTID and Master_Delay causes excessive initial delay + +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc + +CREATE TABLE t1 (i INT); +--sync_slave_with_master + +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID= current_pos, MASTER_DELAY= 10; +--source include/start_slave.inc + +--connection master +INSERT INTO t1 VALUES (1); +--source include/sync_slave_io_with_master.inc + +--connection slave +--let $actual_delay= query_get_value(SHOW SLAVE STATUS, SQL_Delay, 1) +--let $sleep_time= `SELECT 5 + $actual_delay` +--echo "Sleeping for $sleep_time" +--sleep $sleep_time + +--let $assert_cond= [SHOW SLAVE STATUS, Seconds_Behind_Master, 1] <= 10 +--let $assert_text= Seconds_Behind_Master should be less than MASTER_DELAY +--source include/rpl_assert.inc + +# The row should be available in table after master_delay=20 seconds. +--let $assert_text= One row shoule be found in table t1. +--let $assert_cond= COUNT(*) = 1 FROM t1 +--source include/rpl_assert.inc + +--echo "======= Clean up ========" +STOP SLAVE; +CHANGE MASTER TO MASTER_USE_GTID=no, MASTER_DELAY=0; +START SLAVE; + +--connection master +DROP TABLE t1; +--sync_slave_with_master + +--connection master +--source include/rpl_end.inc diff --git a/sql/slave.cc b/sql/slave.cc index f3e08f14213..6b234697f09 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3532,12 +3532,6 @@ apply_event_and_update_pos_setup(Log_event* ev, THD* thd, rpl_group_info *rgi) thd->variables.server_id = ev->server_id; thd->set_time(); // time the query thd->lex->current_select= 0; - if (!ev->when) - { - my_hrtime_t hrtime= my_hrtime(); - ev->when= hrtime_to_my_time(hrtime); - ev->when_sec_part= hrtime_sec_part(hrtime); - } thd->variables.option_bits= (thd->variables.option_bits & ~OPTION_SKIP_REPLICATION) | (ev->flags & LOG_EVENT_SKIP_REPLICATION_F ? OPTION_SKIP_REPLICATION : 0); From 8fcd9478cc6fdb1d4cdb84a552d7dcf8e6f596d3 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Thu, 28 Mar 2019 15:54:42 +0300 Subject: [PATCH 26/47] MDEV-18080, part#1: MyRocks is slow with log-bin=off The cause for this was fix MDEV-15372, which was trying to speed up the parallel slave. Part#1: Do not attempt the "optimization" for transactions that are not replication slave workers. --- storage/rocksdb/ha_rocksdb.cc | 38 +++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 6ce00cb4d1c..022511320a6 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -3750,20 +3750,32 @@ static int rocksdb_commit(handlerton* hton, THD* thd, bool commit_tx) - For a COMMIT statement that finishes a multi-statement transaction - For a statement that has its own transaction */ - - // First, commit without syncing. This establishes the commit order - tx->set_sync(false); - bool tx_had_writes = tx->get_write_count()? true : false ; - if (tx->commit()) { - DBUG_RETURN(HA_ERR_ROCKSDB_COMMIT_FAILED); - } - thd_wakeup_subsequent_commits(thd, 0); - - if (tx_had_writes && rocksdb_flush_log_at_trx_commit == FLUSH_LOG_SYNC) + if (thd->slave_thread) { - rocksdb::Status s= rdb->FlushWAL(true); - if (!s.ok()) - DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + // An attempt to make parallel slave performant (not fully successful, + // see MDEV-15372): + + // First, commit without syncing. This establishes the commit order + tx->set_sync(false); + bool tx_had_writes = tx->get_write_count()? true : false ; + if (tx->commit()) { + DBUG_RETURN(HA_ERR_ROCKSDB_COMMIT_FAILED); + } + thd_wakeup_subsequent_commits(thd, 0); + + if (tx_had_writes && rocksdb_flush_log_at_trx_commit == FLUSH_LOG_SYNC) + { + rocksdb::Status s= rdb->FlushWAL(true); + if (!s.ok()) + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + } + } + else + { + /* Not a slave thread */ + if (tx->commit()) { + DBUG_RETURN(HA_ERR_ROCKSDB_COMMIT_FAILED); + } } } else { /* From fc168c3a5e58d8b364a2e87e0d876a261ec7fced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 29 Mar 2019 11:38:45 +0200 Subject: [PATCH 27/47] MDEV-15587 AES test fails, segfaults in EVP_CipherInit_ex When HAVE_YASSL is defined (due to cmake -DWITH_SSL=bundled or otherwise), mysys_ssl/my_crypt.cc will #include "yassl.cc" from the same directory. When MariaDB 10.2 or later is compiled with GCC 8 and optimizations are enabled, then the check if (iv) in EVP_CipherInit_ex() can be wrongly optimized away. The reason appears to be that __attribute__((nonnull)) is attached to the variable iv, because there is a (no-op) call memcpy(oiv, iv, ivlen=0) earlier in the code path. It is possible that this started failing after the code was refactored in MDEV-10332 (MariaDB 10.2.6). In MariaDB 10.1, there is a similar memcpy() call in MyCTX_nopad::init(), but the code appears to work fine. --- mysys_ssl/my_crypt.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mysys_ssl/my_crypt.cc b/mysys_ssl/my_crypt.cc index db303f37b0e..2d6f5188034 100644 --- a/mysys_ssl/my_crypt.cc +++ b/mysys_ssl/my_crypt.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2014 Google Inc. - Copyright (c) 2014, 2017 MariaDB Corporation + Copyright (c) 2014, 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 @@ -93,7 +93,8 @@ public: this->key= key; this->klen= klen; this->buf_len= 0; - memcpy(oiv, iv, ivlen); + if (ivlen) + memcpy(oiv, iv, ivlen); DBUG_ASSERT(ivlen == 0 || ivlen == sizeof(oiv)); int res= MyCTX::init(cipher, encrypt, key, klen, iv, ivlen); From cc71e7501cb623b2d600c47dbe10a31dcf6e8fcf Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 28 Mar 2019 12:07:20 +0100 Subject: [PATCH 28/47] post-merge: -Werror fixes in 10.2 --- cmake/mariadb_connector_c.cmake | 5 +++++ sql/spatial.cc | 12 ++++++------ storage/innobase/buf/buf0dump.cc | 2 +- strings/json_lib.c | 4 ++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/cmake/mariadb_connector_c.cmake b/cmake/mariadb_connector_c.cmake index 368a6cc8da5..0f08c3464c4 100644 --- a/cmake/mariadb_connector_c.cmake +++ b/cmake/mariadb_connector_c.cmake @@ -37,3 +37,8 @@ SET(CLIENT_PLUGIN_PVIO_SOCKET STATIC) MESSAGE("== Configuring MariaDB Connector/C") ADD_SUBDIRECTORY(libmariadb) + +#remove after merging libmariadb > v3.0.9 +IF(TARGET caching_sha2_password AND CMAKE_C_FLAGS_DEBUG MATCHES "-Werror") + SET_PROPERTY(TARGET caching_sha2_password APPEND_STRING PROPERTY COMPILE_FLAGS -Wno-unused-function) +ENDIF() diff --git a/sql/spatial.cc b/sql/spatial.cc index 2aca528dd15..5f045f8cbfa 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -238,17 +238,17 @@ int Geometry::as_wkt(String *wkt, const char **end) static const uchar type_keyname[]= "type"; -static const int type_keyname_len= 4; +static const uint type_keyname_len= 4; static const uchar coord_keyname[]= "coordinates"; -static const int coord_keyname_len= 11; +static const uint coord_keyname_len= 11; static const uchar geometries_keyname[]= "geometries"; -static const int geometries_keyname_len= 10; +static const uint geometries_keyname_len= 10; static const uchar features_keyname[]= "features"; -static const int features_keyname_len= 8; +static const uint features_keyname_len= 8; static const uchar geometry_keyname[]= "geometry"; -static const int geometry_keyname_len= 8; +static const uint geometry_keyname_len= 8; -static const int max_keyname_len= 11; /*'coordinates' keyname is the longest.*/ +static const uint max_keyname_len= 11; /*'coordinates' keyname is the longest.*/ static const uchar feature_type[]= "feature"; static const int feature_type_len= 7; diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc index ed2131bdcee..fa6754fa065 100644 --- a/storage/innobase/buf/buf0dump.cc +++ b/storage/innobase/buf/buf0dump.cc @@ -392,7 +392,7 @@ buf_dump( if (SHUTTING_DOWN() && !(j % 1024)) { service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL, "Dumping buffer pool " - ULINTPF "/" ULINTPF ", " + ULINTPF "/%lu, " "page " ULINTPF "/" ULINTPF, i + 1, srv_buf_pool_instances, j + 1, n_pages); diff --git a/strings/json_lib.c b/strings/json_lib.c index 394517a4ab6..3ce9b0c503f 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -1409,7 +1409,7 @@ int json_find_paths_next(json_engine_t *je, json_find_paths_t *state) if (!json_key_matches(je, &key_name)) continue; } - if (cur_step - state->paths[p_c].last_step == state->cur_depth) + if (cur_step == state->paths[p_c].last_step + state->cur_depth) path_found= TRUE; else { @@ -1442,7 +1442,7 @@ int json_find_paths_next(json_engine_t *je, json_find_paths_t *state) cur_step->n_item == state->array_counters[state->cur_depth]) { /* Array item matches. */ - if (cur_step - state->paths[p_c].last_step == state->cur_depth) + if (cur_step == state->paths[p_c].last_step + state->cur_depth) path_found= TRUE; else { From 5c0bb0766d46840bf96555ecd5cb2ed17028c847 Mon Sep 17 00:00:00 2001 From: Ian Gilfillan Date: Fri, 29 Mar 2019 11:56:52 +0200 Subject: [PATCH 29/47] Update 10.3 man pages --- man/mariabackup.1 | 2 +- man/mbstream.1 | 2 +- man/my_safe_process.1 | 2 +- man/mysql_ldb.1 | 2 +- man/tokuft_logprint.1 | 2 +- man/wsrep_sst_mariabackup.1 | 2 +- man/wsrep_sst_rsync_wan.1 | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/man/mariabackup.1 b/man/mariabackup.1 index 628c9cf74fa..865ff0b8111 100644 --- a/man/mariabackup.1 +++ b/man/mariabackup.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBMARIABACKUP\FR" "1" "9 August 2018" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBMARIABACKUP\FR" "1" "29 March 2019" "MariaDB 10\&.3" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/man/mbstream.1 b/man/mbstream.1 index 2aba73fe400..5a3ab1e2867 100644 --- a/man/mbstream.1 +++ b/man/mbstream.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBMBSTREAM\FR" "1" "9 August 2018" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBMBSTREAM\FR" "1" "29 March 2019" "MariaDB 10\&.3" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/man/my_safe_process.1 b/man/my_safe_process.1 index fac8ed69fc8..4809124be70 100644 --- a/man/my_safe_process.1 +++ b/man/my_safe_process.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBMY_SAFE_PROCESS\FR" "1" "29 March 2017" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBMY_SAFE_PROCESS\FR" "1" "29 March 2019" "MariaDB 10\&.3" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/man/mysql_ldb.1 b/man/mysql_ldb.1 index 5c08a1a14df..f29044a0aa6 100644 --- a/man/mysql_ldb.1 +++ b/man/mysql_ldb.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBMYSQL_LDB\FR" "1" "9 August 2018" "MariaDB 10\&.2" "MariaDB Database System" +.TH "\FBMYSQL_LDB\FR" "1" "29 March 2019" "MariaDB 10\&.3" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/man/tokuft_logprint.1 b/man/tokuft_logprint.1 index bc3b85a55d6..0a9ff539b73 100644 --- a/man/tokuft_logprint.1 +++ b/man/tokuft_logprint.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBTOKUFT_LOGPRINT\FR" "1" "27 March 2017" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBTOKUFT_LOGPRINT\FR" "1" "29 March 2019" "MariaDB 10\&.3" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/man/wsrep_sst_mariabackup.1 b/man/wsrep_sst_mariabackup.1 index 34ae4b6f82e..1dadf705b96 100644 --- a/man/wsrep_sst_mariabackup.1 +++ b/man/wsrep_sst_mariabackup.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBWSREP_SST_MARIABACKUP\FR" "1" "8 August 2018" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBWSREP_SST_MARIABACKUP\FR" "1" "29 March 2019" "MariaDB 10\&.3" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/man/wsrep_sst_rsync_wan.1 b/man/wsrep_sst_rsync_wan.1 index 6d465d554a8..00b5f7572f7 100644 --- a/man/wsrep_sst_rsync_wan.1 +++ b/man/wsrep_sst_rsync_wan.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBWSREP_SST_RSYNC_WAN\FR" "1" "9 August 2018" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBWSREP_SST_RSYNC_WAN\FR" "1" "29 March 2019" "MariaDB 10\&.3" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- From 65bd38204b65a8ce7ba150d721054941c03847e2 Mon Sep 17 00:00:00 2001 From: Ian Gilfillan Date: Fri, 29 Mar 2019 12:06:34 +0200 Subject: [PATCH 30/47] Update 10.2 man pages --- man/mariabackup.1 | 2 +- man/mbstream.1 | 2 +- man/my_safe_process.1 | 2 +- man/tokuft_logprint.1 | 2 +- man/wsrep_sst_mariabackup.1 | 2 +- man/wsrep_sst_rsync_wan.1 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/man/mariabackup.1 b/man/mariabackup.1 index 628c9cf74fa..d29d1248ec4 100644 --- a/man/mariabackup.1 +++ b/man/mariabackup.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBMARIABACKUP\FR" "1" "9 August 2018" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBMARIABACKUP\FR" "1" "29 March 2019" "MariaDB 10\&.2" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/man/mbstream.1 b/man/mbstream.1 index 2aba73fe400..d16718c074b 100644 --- a/man/mbstream.1 +++ b/man/mbstream.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBMBSTREAM\FR" "1" "9 August 2018" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBMBSTREAM\FR" "1" "29 March 2019" "MariaDB 10\&.2" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/man/my_safe_process.1 b/man/my_safe_process.1 index fac8ed69fc8..6cef2d56dd3 100644 --- a/man/my_safe_process.1 +++ b/man/my_safe_process.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBMY_SAFE_PROCESS\FR" "1" "29 March 2017" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBMY_SAFE_PROCESS\FR" "1" "29 March 2019" "MariaDB 10\&.2" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/man/tokuft_logprint.1 b/man/tokuft_logprint.1 index bc3b85a55d6..d6f69e0aeeb 100644 --- a/man/tokuft_logprint.1 +++ b/man/tokuft_logprint.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBTOKUFT_LOGPRINT\FR" "1" "27 March 2017" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBTOKUFT_LOGPRINT\FR" "1" "29 March 2019" "MariaDB 10\&.2" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/man/wsrep_sst_mariabackup.1 b/man/wsrep_sst_mariabackup.1 index 34ae4b6f82e..df5a3256075 100644 --- a/man/wsrep_sst_mariabackup.1 +++ b/man/wsrep_sst_mariabackup.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBWSREP_SST_MARIABACKUP\FR" "1" "8 August 2018" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBWSREP_SST_MARIABACKUP\FR" "1" "29 August 2019" "MariaDB 10\&.2" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- diff --git a/man/wsrep_sst_rsync_wan.1 b/man/wsrep_sst_rsync_wan.1 index 6d465d554a8..a9f07b2dc24 100644 --- a/man/wsrep_sst_rsync_wan.1 +++ b/man/wsrep_sst_rsync_wan.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBWSREP_SST_RSYNC_WAN\FR" "1" "9 August 2018" "MariaDB 10\&.1" "MariaDB Database System" +.TH "\FBWSREP_SST_RSYNC_WAN\FR" "1" "29 March 2019" "MariaDB 10\&.2" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- From 8df04fb894bd06706ee6292d4dd991aacfc1989a Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Mon, 30 Jul 2018 19:50:42 +0300 Subject: [PATCH 31/47] MDEV-15412 For any non-existing transaction ID, AS OF provides the current table contents without a warning Fail with error on non-existing TRX_ID. Closes #832 --- mysql-test/suite/versioning/r/trx_id.result | 14 ++++++-------- mysql-test/suite/versioning/t/trx_id.test | 10 ++++++---- sql/item_vers.cc | 3 --- sql/table.cc | 4 ++++ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/mysql-test/suite/versioning/r/trx_id.result b/mysql-test/suite/versioning/r/trx_id.result index 7d5e908b85a..fbcabf9673b 100644 --- a/mysql-test/suite/versioning/r/trx_id.result +++ b/mysql-test/suite/versioning/r/trx_id.result @@ -334,18 +334,16 @@ x # # HEX hybrids resolve to TRANSACTION # -SELECT * FROM t1 FOR SYSTEM_TIME AS OF (0x60); -x -1 -SELECT * FROM t2 FOR SYSTEM_TIME AS OF (0x60); +SELECT * FROM t1 FOR SYSTEM_TIME AS OF (0xFFFFFFFF); +ERROR HY000: TRX_ID 4294967295 not found in `mysql.transaction_registry` +SELECT * FROM t2 FOR SYSTEM_TIME AS OF (0xFFFFFFFF); ERROR HY000: Transaction system versioning for `t2` is not supported # # BIT literals resolve to TRANSACTION # -SELECT * FROM t1 FOR SYSTEM_TIME AS OF (b'1100000'); -x -1 -SELECT * FROM t2 FOR SYSTEM_TIME AS OF (b'1100000'); +SELECT * FROM t1 FOR SYSTEM_TIME AS OF (b'11111111111111111111111111111111'); +ERROR HY000: TRX_ID 4294967295 not found in `mysql.transaction_registry` +SELECT * FROM t2 FOR SYSTEM_TIME AS OF (b'11111111111111111111111111111111'); ERROR HY000: Transaction system versioning for `t2` is not supported DROP TABLE t1, t2; # diff --git a/mysql-test/suite/versioning/t/trx_id.test b/mysql-test/suite/versioning/t/trx_id.test index 885455a6977..b0691e4580c 100644 --- a/mysql-test/suite/versioning/t/trx_id.test +++ b/mysql-test/suite/versioning/t/trx_id.test @@ -361,18 +361,20 @@ SELECT * FROM t2 FOR SYSTEM_TIME AS OF '2038-12-30 00:00:00'; --echo # HEX hybrids resolve to TRANSACTION --echo # -SELECT * FROM t1 FOR SYSTEM_TIME AS OF (0x60); +--error ER_VERS_NO_TRX_ID +SELECT * FROM t1 FOR SYSTEM_TIME AS OF (0xFFFFFFFF); --error ER_VERS_ENGINE_UNSUPPORTED -SELECT * FROM t2 FOR SYSTEM_TIME AS OF (0x60); +SELECT * FROM t2 FOR SYSTEM_TIME AS OF (0xFFFFFFFF); --echo # --echo # BIT literals resolve to TRANSACTION --echo # -SELECT * FROM t1 FOR SYSTEM_TIME AS OF (b'1100000'); +--error ER_VERS_NO_TRX_ID +SELECT * FROM t1 FOR SYSTEM_TIME AS OF (b'11111111111111111111111111111111'); --error ER_VERS_ENGINE_UNSUPPORTED -SELECT * FROM t2 FOR SYSTEM_TIME AS OF (b'1100000'); +SELECT * FROM t2 FOR SYSTEM_TIME AS OF (b'11111111111111111111111111111111'); DROP TABLE t1, t2; diff --git a/sql/item_vers.cc b/sql/item_vers.cc index d7361f687f9..cfedc6b0f81 100644 --- a/sql/item_vers.cc +++ b/sql/item_vers.cc @@ -62,10 +62,7 @@ Item_func_trt_ts::get_date(MYSQL_TIME *res, ulonglong fuzzy_date) null_value= !trt.query(trx_id); if (null_value) - { - my_error(ER_VERS_NO_TRX_ID, MYF(0), (longlong) trx_id); return true; - } return trt[trt_field]->get_date(res, fuzzy_date); } diff --git a/sql/table.cc b/sql/table.cc index 4c61cba83cd..d99dc771ee5 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -8822,7 +8822,10 @@ bool TR_table::query(ulonglong trx_id) return false; select= make_select(table, 0, 0, conds, NULL, 0, &error); if (unlikely(error || !select)) + { + my_error(ER_OUT_OF_RESOURCES, MYF(0)); return false; + } // FIXME: (performance) force index 'transaction_id' error= init_read_record(&info, thd, table, select, NULL, 1 /* use_record_cache */, true /* print_error */, @@ -8832,6 +8835,7 @@ bool TR_table::query(ulonglong trx_id) if (select->skip_record(thd) > 0) return true; } + my_error(ER_VERS_NO_TRX_ID, MYF(0), (longlong) trx_id); return false; } From f6ee132491f45dfe1856a627a686d29efbfa3034 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Wed, 19 Dec 2018 14:05:40 +0300 Subject: [PATCH 32/47] Versioning tests stability improvement Fix SELECT resultset order. --- mysql-test/suite/versioning/r/rpl.result | 54 ++++++------- .../suite/versioning/r/update,trx_id.rdiff | 19 +++-- mysql-test/suite/versioning/r/update.result | 80 +++++++++---------- mysql-test/suite/versioning/t/rpl.test | 44 +++++----- mysql-test/suite/versioning/t/update.test | 20 ++--- 5 files changed, 110 insertions(+), 107 deletions(-) diff --git a/mysql-test/suite/versioning/r/rpl.result b/mysql-test/suite/versioning/r/rpl.result index c5770a91c77..fd62a65f473 100644 --- a/mysql-test/suite/versioning/r/rpl.result +++ b/mysql-test/suite/versioning/r/rpl.result @@ -4,38 +4,38 @@ connection slave; connection master; CREATE TABLE t1 (x int) with system versioning; insert into t1 values (1); -SELECT * FROM t1; +select * from t1 order by x; x 1 delete from t1; -select * from t1; +select * from t1 order by x; x -select * from t1 for system_time all; +select * from t1 for system_time all order by row_end, x; x 1 connection slave; -select * from t1; +select * from t1 order by x; x -select * from t1 for system_time all; +select * from t1 for system_time all order by row_end, x; x 1 connection master; insert into t1 values (2); connection slave; -select * from t1; +select * from t1 order by x; x 2 connection master; update t1 set x = 3; connection slave; -select * from t1; +select * from t1 order by x; x 3 -select * from t1 for system_time all; +select * from t1 for system_time all order by row_end, x; x 1 -3 2 +3 # check unversioned -> versioned replication connection master; create or replace table t1 (x int primary key); @@ -44,28 +44,28 @@ alter table t1 with system versioning; connection master; insert into t1 values (1); connection slave; -select * from t1; +select * from t1 order by x; x 1 -select * from t1 for system_time all; +select * from t1 for system_time all order by row_end, x; x 1 connection master; update t1 set x= 2 where x = 1; connection slave; -select * from t1; +select * from t1 order by x; x 2 -select * from t1 for system_time all; +select * from t1 for system_time all order by row_end, x; x 1 2 connection master; delete from t1; connection slave; -select * from t1; +select * from t1 order by x; x -select * from t1 for system_time all; +select * from t1 for system_time all order by row_end, x; x 1 2 @@ -78,22 +78,22 @@ connection master; insert into t1 values (1); update t1 set x= 2 where x = 1; connection slave; -select * from t1; +select * from t1 order by x; x 2 -select * from t1 for system_time all; +select * from t1 for system_time all order by row_end, x; x -2 1 +2 connection master; delete from t1; connection slave; -select * from t1; +select * from t1 order by x; x -select * from t1 for system_time all; +select * from t1 for system_time all order by row_end, x; x -2 1 +2 # multi-update connection master; create or replace table t1 (x int) with system versioning; @@ -102,20 +102,20 @@ insert into t1 values (1); insert into t2 values (2); update t1, t2 set t1.x=11, t2.x=22; connection slave; -select * from t1; +select * from t1 order by x; x 11 -select * from t2; +select * from t2 order by x; x 22 -select * from t1 for system_time all; +select * from t1 for system_time all order by row_end, x; x -11 1 -select * from t2 for system_time all; +11 +select * from t2 for system_time all order by row_end, x; x -22 2 +22 # MDEV-14767 system_versioning_alter_history breaks ALTER replication ## Case 1: KEEP on the master, ALTER will work on the slave connection master; diff --git a/mysql-test/suite/versioning/r/update,trx_id.rdiff b/mysql-test/suite/versioning/r/update,trx_id.rdiff index 037ec548072..7ce75714235 100644 --- a/mysql-test/suite/versioning/r/update,trx_id.rdiff +++ b/mysql-test/suite/versioning/r/update,trx_id.rdiff @@ -1,13 +1,16 @@ ---- suite/versioning/r/update.result -+++ suite/versioning/r/update.reject -@@ -88,10 +88,8 @@ - 5 3 1 - 3 1 0 +--- update.result 2018-12-19 13:55:35.873917389 +0300 ++++ update,trx_id.reject 2018-12-19 13:55:35.533917399 +0300 +@@ -81,12 +81,10 @@ + commit; + select x, y, sys_trx_end = MAXVAL as current from t1 for system_time all order by sys_trx_end, x, y; + x y current +-3 1 0 2 1 0 -3 2 0 ++3 1 0 4 1 0 5 1 0 -5 2 0 - drop table t1; - create table t1 ( - id int primary key auto_increment, + 1 1 1 + 2 2 1 + 3 3 1 diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result index 8e42e7d413d..334d8d8899b 100644 --- a/mysql-test/suite/versioning/r/update.result +++ b/mysql-test/suite/versioning/r/update.result @@ -6,7 +6,7 @@ sys_trx_end SYS_DATATYPE as row end invisible, period for system_time (sys_trx_start, sys_trx_end)) with system versioning; insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000); -select x, y from t1; +select x, y from t1 order by x, y; x y 1 1000 2 2000 @@ -18,7 +18,7 @@ x y 8 8000 9 9000 update t1 set y = y + 1 where x > 7; -select x, y from t1; +select x, y from t1 order by x, y; x y 1 1000 2 2000 @@ -29,19 +29,19 @@ x y 7 7000 8 8001 9 9001 -select x, y from t1 for system_time all; +select x, y from t1 for system_time all order by sys_trx_end, x, y; x y -1 1000 -2 2000 -3 3000 -4 4000 -5 5000 -6 6000 -7 7000 -8 8001 -9 9001 8 8000 9 9000 +1 1000 +2 2000 +3 3000 +4 4000 +5 5000 +6 6000 +7 7000 +8 8001 +9 9001 drop table t1; create table t1 ( id bigint primary key, @@ -79,19 +79,19 @@ update t1 set y= y + 1 where x = 3; update t1 set y= y + 1 where x > 3; update t1 set y= y + 1 where x > 4; commit; -select x, y, sys_trx_end = MAXVAL as current from t1 for system_time all; +select x, y, sys_trx_end = MAXVAL as current from t1 for system_time all order by sys_trx_end, x, y; x y current -1 1 1 -2 2 1 -3 3 1 -4 2 1 -5 3 1 3 1 0 2 1 0 3 2 0 4 1 0 5 1 0 5 2 0 +1 1 1 +2 2 1 +3 3 1 +4 2 1 +5 3 1 drop table t1; create table t1 ( id int primary key auto_increment, @@ -129,15 +129,15 @@ with system versioning; insert into t1(x, y) values (1, 1000), (3, 3000), (4, 4000), (5, 5000); insert into t1(x, y) values(3, 3000) on duplicate key update y = y+1; insert into t1(x, y) values(4, 4444) on duplicate key update y = y+1; -select x, y from t1 for system_time all; +select x, y from t1 for system_time all order by sys_trx_end, x, y; x y -1 1000 3 3000 +1 1000 3 3001 4 4000 4 4444 5 5000 -select x, y from t1; +select x, y from t1 order by x, y; x y 1 1000 3 3001 @@ -156,20 +156,20 @@ create table t2 like t1; insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000); insert into t2(x, y) values (1, 1010), (2, 2010), (3, 3010), (4, 4010), (5, 5010), (6, 6010), (7, 7010), (8, 8010), (9, 9010); update t1, t2 set t1.y = t1.x + t1.y, t2.y = t2.x + t2.y where t1.x > 7 and t2.x < 7; -select x, y from t1 for system_time all; +select x, y from t1 for system_time all order by sys_trx_end, x, y; x y -1 1000 -2 2000 -3 3000 -4 4000 -5 5000 -6 6000 -7 7000 -8 8008 -9 9009 8 8000 9 9000 -select x, y from t1; +1 1000 +2 2000 +3 3000 +4 4000 +5 5000 +6 6000 +7 7000 +8 8008 +9 9009 +select x, y from t1 order by x, y; x y 1 1000 2 2000 @@ -180,8 +180,14 @@ x y 7 7000 8 8008 9 9009 -select x, y from t2 for system_time all; +select x, y from t2 for system_time all order by sys_trx_end, x, y; x y +1 1010 +2 2010 +3 3010 +4 4010 +5 5010 +6 6010 1 1011 2 2012 3 3013 @@ -191,13 +197,7 @@ x y 7 7010 8 8010 9 9010 -1 1010 -2 2010 -3 3010 -4 4010 -5 5010 -6 6010 -select x, y from t2; +select x, y from t2 order by x, y; x y 1 1011 2 2012 diff --git a/mysql-test/suite/versioning/t/rpl.test b/mysql-test/suite/versioning/t/rpl.test index a9e3af45af8..e59d41c38a3 100644 --- a/mysql-test/suite/versioning/t/rpl.test +++ b/mysql-test/suite/versioning/t/rpl.test @@ -14,24 +14,24 @@ let $slave_com_update_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_updat connection master; CREATE TABLE t1 (x int) with system versioning; insert into t1 values (1); -SELECT * FROM t1; +select * from t1 order by x; delete from t1; -select * from t1; -select * from t1 for system_time all; +select * from t1 order by x; +select * from t1 for system_time all order by row_end, x; sync_slave_with_master; -select * from t1; -select * from t1 for system_time all; +select * from t1 order by x; +select * from t1 for system_time all order by row_end, x; connection master; insert into t1 values (2); sync_slave_with_master; -select * from t1; +select * from t1 order by x; connection master; update t1 set x = 3; sync_slave_with_master; -select * from t1; -select * from t1 for system_time all; +select * from t1 order by x; +select * from t1 for system_time all order by row_end, x; --echo # check unversioned -> versioned replication connection master; @@ -42,20 +42,20 @@ alter table t1 with system versioning; connection master; insert into t1 values (1); sync_slave_with_master; -select * from t1; -select * from t1 for system_time all; +select * from t1 order by x; +select * from t1 for system_time all order by row_end, x; connection master; update t1 set x= 2 where x = 1; sync_slave_with_master; -select * from t1; -select * from t1 for system_time all; +select * from t1 order by x; +select * from t1 for system_time all order by row_end, x; connection master; delete from t1; sync_slave_with_master; -select * from t1; -select * from t1 for system_time all; +select * from t1 order by x; +select * from t1 for system_time all order by row_end, x; --echo # same thing (UPDATE, DELETE), but without PK connection master; @@ -67,14 +67,14 @@ connection master; insert into t1 values (1); update t1 set x= 2 where x = 1; sync_slave_with_master; -select * from t1; -select * from t1 for system_time all; +select * from t1 order by x; +select * from t1 for system_time all order by row_end, x; connection master; delete from t1; sync_slave_with_master; -select * from t1; -select * from t1 for system_time all; +select * from t1 order by x; +select * from t1 for system_time all order by row_end, x; --echo # multi-update connection master; @@ -84,10 +84,10 @@ insert into t1 values (1); insert into t2 values (2); update t1, t2 set t1.x=11, t2.x=22; sync_slave_with_master; -select * from t1; -select * from t2; -select * from t1 for system_time all; -select * from t2 for system_time all; +select * from t1 order by x; +select * from t2 order by x; +select * from t1 for system_time all order by row_end, x; +select * from t2 for system_time all order by row_end, x; --echo # MDEV-14767 system_versioning_alter_history breaks ALTER replication --echo ## Case 1: KEEP on the master, ALTER will work on the slave diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test index 67d7db952ae..95c844c88a2 100644 --- a/mysql-test/suite/versioning/t/update.test +++ b/mysql-test/suite/versioning/t/update.test @@ -11,10 +11,10 @@ eval create table t1( with system versioning; insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000); -select x, y from t1; +select x, y from t1 order by x, y; update t1 set y = y + 1 where x > 7; -select x, y from t1; -select x, y from t1 for system_time all; +select x, y from t1 order by x, y; +select x, y from t1 for system_time all order by sys_trx_end, x, y; drop table t1; replace_result $sys_datatype_expl SYS_DATATYPE; @@ -56,7 +56,7 @@ update t1 set y= y + 1 where x > 4; commit; replace_result $sys_datatype_max MAXVAL; -eval select x, y, sys_trx_end = $sys_datatype_max as current from t1 for system_time all; +eval select x, y, sys_trx_end = $sys_datatype_max as current from t1 for system_time all order by sys_trx_end, x, y; drop table t1; @@ -95,8 +95,8 @@ with system versioning; insert into t1(x, y) values (1, 1000), (3, 3000), (4, 4000), (5, 5000); insert into t1(x, y) values(3, 3000) on duplicate key update y = y+1; insert into t1(x, y) values(4, 4444) on duplicate key update y = y+1; -select x, y from t1 for system_time all; -select x, y from t1; +select x, y from t1 for system_time all order by sys_trx_end, x, y; +select x, y from t1 order by x, y; drop table t1; replace_result $sys_datatype_expl SYS_DATATYPE; @@ -111,10 +111,10 @@ create table t2 like t1; insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000); insert into t2(x, y) values (1, 1010), (2, 2010), (3, 3010), (4, 4010), (5, 5010), (6, 6010), (7, 7010), (8, 8010), (9, 9010); update t1, t2 set t1.y = t1.x + t1.y, t2.y = t2.x + t2.y where t1.x > 7 and t2.x < 7; -select x, y from t1 for system_time all; -select x, y from t1; -select x, y from t2 for system_time all; -select x, y from t2; +select x, y from t1 for system_time all order by sys_trx_end, x, y; +select x, y from t1 order by x, y; +select x, y from t2 for system_time all order by sys_trx_end, x, y; +select x, y from t2 order by x, y; drop table t1; drop table t2; From e6230e844c096e321294f5489d6088cfd8f0293f Mon Sep 17 00:00:00 2001 From: Nikita Malyavin Date: Fri, 22 Feb 2019 22:17:41 +1000 Subject: [PATCH 33/47] MDEV-15951 system versioning by trx id doesn't work with partitioning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix partitioning for trx_id-versioned tables. `partition by hash`, `range` and others now work. `partition by system_time` is forbidden. Currently we cannot use row_start and row_end in `partition by`, because insertion of versioned field is done by engine's handler, as well as row_start/row_end's value set up, which is a transaction id -- so it's also forbidden. The drawback is that it's now impossible to use `partition by key()` without parameters for such tables, because it references row_start and row_end implicitly. * add handler::vers_can_native() * drop Table_scope_and_contents_source_st::vers_native() * drop partition_element::find_engine_flag as unused * forbid versioning partitioning for trx_id as not supported * adopt vers tests for trx_id partitioning * forbid any row_end referencing in `partition by` clauses, ย  including implicit `by key()` --- .../suite/versioning/r/partition.result | 31 +++++-- .../versioning/r/partition_innodb.result | 69 ++++++++++++++++ .../suite/versioning/t/partition.combinations | 5 -- mysql-test/suite/versioning/t/partition.test | 40 ++++++++-- .../suite/versioning/t/partition_innodb.test | 80 +++++++++++++++++++ sql/ha_partition.h | 16 ++++ sql/handler.cc | 32 +------- sql/handler.h | 8 +- sql/partition_element.h | 15 ---- sql/share/errmsg-utf8.txt | 4 +- sql/sql_partition.cc | 8 ++ sql/table.cc | 2 +- 12 files changed, 244 insertions(+), 66 deletions(-) create mode 100644 mysql-test/suite/versioning/r/partition_innodb.result delete mode 100644 mysql-test/suite/versioning/t/partition.combinations create mode 100644 mysql-test/suite/versioning/t/partition_innodb.test diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result index bfec0ce2d4b..3c33967b780 100644 --- a/mysql-test/suite/versioning/r/partition.result +++ b/mysql-test/suite/versioning/r/partition.result @@ -1,6 +1,10 @@ set system_versioning_alter_history=keep; # Check conventional partitioning on temporal tables -create table t1 (x int) +create or replace table t1 ( +x int, +row_start SYS_DATATYPE as row start invisible, +row_end SYS_DATATYPE as row end invisible, +period for system_time(row_start, row_end)) with system versioning partition by range columns (x) ( partition p0 values less than (100), @@ -34,7 +38,13 @@ select * from t1 partition (p1) for system_time all; x 300 # Engine change native <-> non-native versioning prohibited -create or replace table t1 (i int) engine=DEFAULT_ENGINE with system versioning partition by hash(i); +create or replace table t1 ( +i int, +row_start SYS_DATATYPE as row start invisible, +row_end SYS_DATATYPE as row end invisible, +period for system_time(row_start, row_end)) +engine=DEFAULT_ENGINE +with system versioning partition by hash(i); alter table t1 engine=NON_DEFAULT_ENGINE; ERROR HY000: Not allowed for system-versioned `test`.`t1`. Change to/from native system versioning engine is not supported. ## CREATE TABLE @@ -322,14 +332,21 @@ select * from t1 partition (p1sp0); x select * from t1 partition (p1sp1); x -create or replace table t1 (a bigint) +create or replace table t1 ( +a bigint, +row_start SYS_DATATYPE as row start invisible, +row_end SYS_DATATYPE as row end invisible, +period for system_time(row_start, row_end)) with system versioning partition by range (a) (partition p0 values less than (20) engine innodb, partition p1 values less than maxvalue engine innodb); insert into t1 values (1); create or replace table t1 ( -f_int1 integer default 0 +f_int1 integer default 0, +row_start SYS_DATATYPE as row start invisible, +row_end SYS_DATATYPE as row end invisible, +period for system_time(row_start, row_end) ) with system versioning partition by range(f_int1) subpartition by hash(f_int1) @@ -338,7 +355,11 @@ subpartition by hash(f_int1) subpartition subpart12 storage engine = 'innodb')); insert into t1 values (1); create or replace table t1 (i int) engine=innodb partition by key(i); -alter table t1 add system versioning; +alter table t1 +add column row_start SYS_DATATYPE as row start invisible, +add column row_end SYS_DATATYPE as row end invisible, +add period for system_time(row_start, row_end), +add system versioning; insert into t1 values(); # MDEV-14722 Assertion in ha_commit_trans for sub-statement create or replace table t1 (i int) with system versioning diff --git a/mysql-test/suite/versioning/r/partition_innodb.result b/mysql-test/suite/versioning/r/partition_innodb.result new file mode 100644 index 00000000000..3b285365280 --- /dev/null +++ b/mysql-test/suite/versioning/r/partition_innodb.result @@ -0,0 +1,69 @@ +# MDEV-15951 system versioning by trx id doesn't work with partitioning +# currently trx_id does not support partitioning by system_time +create or replace table t1( +i int, +row_start bigint unsigned generated always as row start, +row_end bigint unsigned generated always as row end, +period for system_time(row_start, row_end) +) engine=InnoDB with system versioning partition by system_time ( +partition p0 history, +partition pn current +); +ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `t1` +create or replace table t1( +i int, +row_start bigint unsigned generated always as row start, +row_end bigint unsigned generated always as row end, +period for system_time(row_start, row_end) +) engine=InnoDB with system versioning; +alter table t1 partition by system_time ( +partition p0 history, +partition pn current +); +ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `#sql-temporary` +create or replace table t ( +a int primary key, +row_start bigint unsigned as row start invisible, +row_end bigint unsigned as row end invisible, +period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by key() ( +partition p1, +partition p2 +); +ERROR HY000: Transactional system versioned tables do not support partitioning by ROW START or ROW END +create or replace table t ( +a int primary key, +row_start bigint unsigned as row start invisible, +row_end bigint unsigned as row end invisible, +period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by key(a, row_start) ( +partition p1, +partition p2 +); +ERROR HY000: Transactional system versioned tables do not support partitioning by ROW START or ROW END +create or replace table t ( +a int primary key, +row_start bigint unsigned as row start invisible, +row_end bigint unsigned as row end invisible, +period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by hash(a + row_end * 2) ( +partition p1, +partition p2 +); +ERROR HY000: Transactional system versioned tables do not support partitioning by ROW START or ROW END +create or replace table t ( +a int primary key, +row_start bigint unsigned as row start invisible, +row_end bigint unsigned as row end invisible, +period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by range columns (a, row_start) ( +partition p1 values less than (100, 100) +); +ERROR HY000: Transactional system versioned tables do not support partitioning by ROW START or ROW END +# Test cleanup +drop database test; +create database test; diff --git a/mysql-test/suite/versioning/t/partition.combinations b/mysql-test/suite/versioning/t/partition.combinations deleted file mode 100644 index 4d73ef5a5ea..00000000000 --- a/mysql-test/suite/versioning/t/partition.combinations +++ /dev/null @@ -1,5 +0,0 @@ -[timestamp] -default-storage-engine=innodb - -[myisam] -default-storage-engine=myisam diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index d9e784b082b..88411468516 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -1,10 +1,16 @@ -- source include/have_partition.inc -- source suite/versioning/common.inc +-- source suite/versioning/engines.inc set system_versioning_alter_history=keep; --echo # Check conventional partitioning on temporal tables -create table t1 (x int) +--replace_result $sys_datatype_expl SYS_DATATYPE +eval create or replace table t1 ( + x int, + row_start $sys_datatype_expl as row start invisible, + row_end $sys_datatype_expl as row end invisible, + period for system_time(row_start, row_end)) with system versioning partition by range columns (x) ( partition p0 values less than (100), @@ -24,8 +30,14 @@ select * from t1 partition (p0) for system_time all; select * from t1 partition (p1) for system_time all; --echo # Engine change native <-> non-native versioning prohibited ---replace_result $default_engine DEFAULT_ENGINE -eval create or replace table t1 (i int) engine=$default_engine with system versioning partition by hash(i); +--replace_result $sys_datatype_expl SYS_DATATYPE $default_engine DEFAULT_ENGINE +eval create or replace table t1 ( + i int, + row_start $sys_datatype_expl as row start invisible, + row_end $sys_datatype_expl as row end invisible, + period for system_time(row_start, row_end)) +engine=$default_engine +with system versioning partition by hash(i); --replace_result $non_default_engine NON_DEFAULT_ENGINE --error ER_VERS_ALTER_ENGINE_PROHIBITED eval alter table t1 engine=$non_default_engine; @@ -273,15 +285,24 @@ select * from t1 partition (p0sp1); select * from t1 partition (p1sp0); select * from t1 partition (p1sp1); -create or replace table t1 (a bigint) +--replace_result $sys_datatype_expl SYS_DATATYPE +eval create or replace table t1 ( + a bigint, + row_start $sys_datatype_expl as row start invisible, + row_end $sys_datatype_expl as row end invisible, + period for system_time(row_start, row_end)) with system versioning partition by range (a) (partition p0 values less than (20) engine innodb, partition p1 values less than maxvalue engine innodb); insert into t1 values (1); -create or replace table t1 ( - f_int1 integer default 0 +--replace_result $sys_datatype_expl SYS_DATATYPE +eval create or replace table t1 ( + f_int1 integer default 0, + row_start $sys_datatype_expl as row start invisible, + row_end $sys_datatype_expl as row end invisible, + period for system_time(row_start, row_end) ) with system versioning partition by range(f_int1) subpartition by hash(f_int1) @@ -291,7 +312,12 @@ subpartition subpart12 storage engine = 'innodb')); insert into t1 values (1); create or replace table t1 (i int) engine=innodb partition by key(i); -alter table t1 add system versioning; +--replace_result $sys_datatype_expl SYS_DATATYPE +eval alter table t1 + add column row_start $sys_datatype_expl as row start invisible, + add column row_end $sys_datatype_expl as row end invisible, + add period for system_time(row_start, row_end), + add system versioning; insert into t1 values(); --echo # MDEV-14722 Assertion in ha_commit_trans for sub-statement diff --git a/mysql-test/suite/versioning/t/partition_innodb.test b/mysql-test/suite/versioning/t/partition_innodb.test new file mode 100644 index 00000000000..bb4fe50ce91 --- /dev/null +++ b/mysql-test/suite/versioning/t/partition_innodb.test @@ -0,0 +1,80 @@ +--source include/have_innodb.inc +--source include/have_partition.inc + +--echo # MDEV-15951 system versioning by trx id doesn't work with partitioning +--echo # currently trx_id does not support partitioning by system_time +--error ER_VERS_FIELD_WRONG_TYPE +create or replace table t1( + i int, + row_start bigint unsigned generated always as row start, + row_end bigint unsigned generated always as row end, + period for system_time(row_start, row_end) +) engine=InnoDB with system versioning partition by system_time ( + partition p0 history, + partition pn current +); + +create or replace table t1( + i int, + row_start bigint unsigned generated always as row start, + row_end bigint unsigned generated always as row end, + period for system_time(row_start, row_end) +) engine=InnoDB with system versioning; + +--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ +--error ER_VERS_FIELD_WRONG_TYPE +alter table t1 partition by system_time ( + partition p0 history, + partition pn current +); + +--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED +create or replace table t ( + a int primary key, + row_start bigint unsigned as row start invisible, + row_end bigint unsigned as row end invisible, + period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by key() ( + partition p1, + partition p2 +); + +--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED +create or replace table t ( + a int primary key, + row_start bigint unsigned as row start invisible, + row_end bigint unsigned as row end invisible, + period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by key(a, row_start) ( + partition p1, + partition p2 +); + +--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED +create or replace table t ( + a int primary key, + row_start bigint unsigned as row start invisible, + row_end bigint unsigned as row end invisible, + period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by hash(a + row_end * 2) ( + partition p1, + partition p2 +); + +--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED +create or replace table t ( + a int primary key, + row_start bigint unsigned as row start invisible, + row_end bigint unsigned as row end invisible, + period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by range columns (a, row_start) ( + partition p1 values less than (100, 100) +); + +--echo # Test cleanup +drop database test; +create database test; diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 202f27840dc..e1f1503f8ec 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -412,6 +412,22 @@ public: virtual void return_record_by_parent(); + virtual bool vers_can_native(THD *thd) + { + if (thd->lex->part_info) + { + // PARTITION BY SYSTEM_TIME is not supported for now + return thd->lex->part_info->part_type != VERSIONING_PARTITION; + } + else + { + bool can= true; + for (uint i= 0; i < m_tot_parts && can; i++) + can= can && m_file[i]->vers_can_native(thd); + return can; + } + } + /* ------------------------------------------------------------------------- MODULE create/delete handler object diff --git a/sql/handler.cc b/sql/handler.cc index e01392d236c..f2ea9365974 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -7035,28 +7035,6 @@ bool Vers_parse_info::fix_implicit(THD *thd, Alter_info *alter_info) return false; } -bool Table_scope_and_contents_source_pod_st::vers_native(THD *thd) const -{ - if (ha_check_storage_engine_flag(db_type, HTON_NATIVE_SYS_VERSIONING)) - return true; - -#ifdef WITH_PARTITION_STORAGE_ENGINE - partition_info *info= thd->work_part_info; - if (info && !(used_fields & HA_CREATE_USED_ENGINE)) - { - if (handlerton *hton= info->default_engine_type) - return ha_check_storage_engine_flag(hton, HTON_NATIVE_SYS_VERSIONING); - - List_iterator_fast it(info->partitions); - while (partition_element *partition_element= it++) - { - if (partition_element->find_engine_flag(HTON_NATIVE_SYS_VERSIONING)) - return true; - } - } -#endif - return false; -} bool Table_scope_and_contents_source_st::vers_fix_system_fields( THD *thd, Alter_info *alter_info, const TABLE_LIST &create_table, @@ -7133,7 +7111,7 @@ bool Table_scope_and_contents_source_st::vers_check_system_fields( if (!(options & HA_VERSIONED_TABLE)) return false; return vers_info.check_sys_fields(create_table.table_name, create_table.db, - alter_info, vers_native(thd)); + alter_info); } @@ -7242,8 +7220,7 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info, if (alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING) { - bool native= create_info->vers_native(thd); - if (check_sys_fields(table_name, share->db, alter_info, native)) + if (check_sys_fields(table_name, share->db, alter_info)) return true; } @@ -7350,7 +7327,7 @@ bool Vers_parse_info::check_conditions(const Lex_table_name &table_name, bool Vers_parse_info::check_sys_fields(const Lex_table_name &table_name, const Lex_table_name &db, - Alter_info *alter_info, bool native) + Alter_info *alter_info) { if (check_conditions(table_name, db)) return true; @@ -7381,8 +7358,7 @@ bool Vers_parse_info::check_sys_fields(const Lex_table_name &table_name, { f_check_unit= VERS_TIMESTAMP; } - else if (native - && f->type_handler() == &type_handler_longlong + else if (f->type_handler() == &type_handler_longlong && (f->flags & UNSIGNED_FLAG) && f->length == (MY_INT64_NUM_DECIMAL_DIGITS - 1)) { diff --git a/sql/handler.h b/sql/handler.h index f3401bdfc48..384166cf5c4 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1993,7 +1993,7 @@ public: TABLE_LIST &src_table, TABLE_LIST &table); bool check_sys_fields(const Lex_table_name &table_name, const Lex_table_name &db, - Alter_info *alter_info, bool native); + Alter_info *alter_info); /** At least one field was specified 'WITH/WITHOUT SYSTEM VERSIONING'. @@ -2077,8 +2077,6 @@ struct Table_scope_and_contents_source_pod_st // For trivial members bool table_was_deleted; sequence_definition *seq_create_info; - bool vers_native(THD *thd) const; - void init() { bzero(this, sizeof(*this)); @@ -3456,6 +3454,10 @@ public: ha_pre_index_end() : pre_inited == RND ? ha_pre_rnd_end() : 0 ); } + virtual bool vers_can_native(THD *thd) + { + return ht->flags & HTON_NATIVE_SYS_VERSIONING; + } /** @brief diff --git a/sql/partition_element.h b/sql/partition_element.h index 45900c77cfc..2c89562adda 100644 --- a/sql/partition_element.h +++ b/sql/partition_element.h @@ -176,21 +176,6 @@ public: DBUG_ASSERT(ev->col_val_array); return ev->col_val_array[idx]; } - - bool find_engine_flag(uint32 flag) - { - if (ha_check_storage_engine_flag(engine_type, flag)) - return true; - - List_iterator_fast it(subpartitions); - while (partition_element *element= it++) - { - if (element->find_engine_flag(flag)) - return true; - } - - return false; - } }; #endif /* PARTITION_ELEMENT_INCLUDED */ diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 71010ddc111..c7a5a2a48f0 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7907,8 +7907,8 @@ ER_UNUSED_24 ER_VERS_TEMPORARY eng "TEMPORARY tables do not support system versioning" -ER_VERS_NOT_SUPPORTED - eng "%s is not supported for %s system-versioned tables" +ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED + eng "Transactional system versioned tables do not support partitioning by ROW START or ROW END" ER_INDEX_FILE_FULL eng "The index file for table '%-.192s' is full" ER_UPDATED_COLUMN_ONLY_ONCE diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 9e6c333d3c9..80565eab208 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -341,7 +341,15 @@ static bool set_up_field_array(THD *thd, TABLE *table, while ((field= *(ptr++))) { if (field->flags & GET_FIXED_FIELDS_FLAG) + { + if (table->versioned(VERS_TRX_ID) + && unlikely(field->flags & VERS_SYSTEM_FIELD)) + { + my_error(ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED, MYF(0)); + DBUG_RETURN(TRUE); + } num_fields++; + } } if (unlikely(num_fields > MAX_REF_PARTS)) { diff --git a/sql/table.cc b/sql/table.cc index d99dc771ee5..80995abc1f9 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1781,7 +1781,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, goto err; DBUG_PRINT("info", ("Columns with system versioning: [%d, %d]", row_start, row_end)); versioned= VERS_TIMESTAMP; - vers_can_native= plugin_hton(se_plugin)->flags & HTON_NATIVE_SYS_VERSIONING; + vers_can_native= handler_file->vers_can_native(thd); row_start_field= row_start; row_end_field= row_end; status_var_increment(thd->status_var.feature_system_versioning); From 8123d799113177aaaa1ffcdfa88c728fa82972ca Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 26 Mar 2019 20:19:32 +0100 Subject: [PATCH 34/47] MDEV-15951 system versioning by trx id doesn't work with partitioning Clarify the error message, use the wording from the manual. Closes #870 --- mysql-test/suite/versioning/r/partition_innodb.result | 8 ++++---- mysql-test/suite/versioning/r/select.result | 2 +- mysql-test/suite/versioning/r/trx_id.result | 8 ++++---- sql/share/errmsg-utf8.txt | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mysql-test/suite/versioning/r/partition_innodb.result b/mysql-test/suite/versioning/r/partition_innodb.result index 3b285365280..de3521b6aa3 100644 --- a/mysql-test/suite/versioning/r/partition_innodb.result +++ b/mysql-test/suite/versioning/r/partition_innodb.result @@ -31,7 +31,7 @@ partition by key() ( partition p1, partition p2 ); -ERROR HY000: Transactional system versioned tables do not support partitioning by ROW START or ROW END +ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END create or replace table t ( a int primary key, row_start bigint unsigned as row start invisible, @@ -42,7 +42,7 @@ partition by key(a, row_start) ( partition p1, partition p2 ); -ERROR HY000: Transactional system versioned tables do not support partitioning by ROW START or ROW END +ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END create or replace table t ( a int primary key, row_start bigint unsigned as row start invisible, @@ -53,7 +53,7 @@ partition by hash(a + row_end * 2) ( partition p1, partition p2 ); -ERROR HY000: Transactional system versioned tables do not support partitioning by ROW START or ROW END +ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END create or replace table t ( a int primary key, row_start bigint unsigned as row start invisible, @@ -63,7 +63,7 @@ period for system_time(row_start, row_end) partition by range columns (a, row_start) ( partition p1 values less than (100, 100) ); -ERROR HY000: Transactional system versioned tables do not support partitioning by ROW START or ROW END +ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END # Test cleanup drop database test; create database test; diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result index be0781af002..c887e524e63 100644 --- a/mysql-test/suite/versioning/r/select.result +++ b/mysql-test/suite/versioning/r/select.result @@ -319,7 +319,7 @@ ERROR HY000: Table `t` is not system-versioned # TRANSACTION/TIMESTAMP specifier in SYSTEM_TIME [MDEV-14645, Issue #396] create or replace table t1 (x int) with system versioning engine myisam; select * from t1 for system_time as of transaction 1; -ERROR HY000: Transaction system versioning for `t1` is not supported +ERROR HY000: Transaction-precise system versioning for `t1` is not supported create or replace table t1 ( x int, sys_trx_start bigint unsigned as row start invisible, diff --git a/mysql-test/suite/versioning/r/trx_id.result b/mysql-test/suite/versioning/r/trx_id.result index fbcabf9673b..951e5ce3dd9 100644 --- a/mysql-test/suite/versioning/r/trx_id.result +++ b/mysql-test/suite/versioning/r/trx_id.result @@ -322,7 +322,7 @@ DECLARE var BIT(10); SELECT * FROM t2 FOR SYSTEM_TIME AS OF var; END; $$ -ERROR HY000: Transaction system versioning for `t2` is not supported +ERROR HY000: Transaction-precise system versioning for `t2` is not supported # # String literals resolve to TIMESTAMP # @@ -337,14 +337,14 @@ x SELECT * FROM t1 FOR SYSTEM_TIME AS OF (0xFFFFFFFF); ERROR HY000: TRX_ID 4294967295 not found in `mysql.transaction_registry` SELECT * FROM t2 FOR SYSTEM_TIME AS OF (0xFFFFFFFF); -ERROR HY000: Transaction system versioning for `t2` is not supported +ERROR HY000: Transaction-precise system versioning for `t2` is not supported # # BIT literals resolve to TRANSACTION # SELECT * FROM t1 FOR SYSTEM_TIME AS OF (b'11111111111111111111111111111111'); ERROR HY000: TRX_ID 4294967295 not found in `mysql.transaction_registry` SELECT * FROM t2 FOR SYSTEM_TIME AS OF (b'11111111111111111111111111111111'); -ERROR HY000: Transaction system versioning for `t2` is not supported +ERROR HY000: Transaction-precise system versioning for `t2` is not supported DROP TABLE t1, t2; # # MDEV-16094 Crash when using AS OF with a stored function @@ -368,7 +368,7 @@ PERIOD FOR SYSTEM_TIME(start_timestamp, end_timestamp) SELECT * FROM tts FOR SYSTEM_TIME AS OF fts(); x start_timestamp end_timestamp SELECT * FROM tts FOR SYSTEM_TIME AS OF ftx(); -ERROR HY000: Transaction system versioning for `tts` is not supported +ERROR HY000: Transaction-precise system versioning for `tts` is not supported SELECT * FROM ttx FOR SYSTEM_TIME AS OF fts(); x start_timestamp end_timestamp SELECT * FROM ttx FOR SYSTEM_TIME AS OF ftx(); diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index c7a5a2a48f0..ba0529f28e2 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7827,7 +7827,7 @@ ER_VERS_FIELD_WRONG_TYPE eng "%`s must be of type %s for system-versioned table %`s" ER_VERS_ENGINE_UNSUPPORTED - eng "Transaction system versioning for %`s is not supported" + eng "Transaction-precise system versioning for %`s is not supported" ER_UNUSED_23 eng "You should never see it" @@ -7908,7 +7908,7 @@ ER_VERS_TEMPORARY eng "TEMPORARY tables do not support system versioning" ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED - eng "Transactional system versioned tables do not support partitioning by ROW START or ROW END" + eng "Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END" ER_INDEX_FILE_FULL eng "The index file for table '%-.192s' is full" ER_UPDATED_COLUMN_ONLY_ONCE From 39d7e5969ba06f78d44e5cbd1ea72f882f3a5e66 Mon Sep 17 00:00:00 2001 From: Nikita Malyavin Date: Thu, 5 Jul 2018 21:03:37 +1000 Subject: [PATCH 35/47] MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables * mark columns for binlog before inserting history row Closes #822 --- mysql-test/suite/versioning/r/rpl.result | 13 +++++++++++++ mysql-test/suite/versioning/t/rpl.test | 17 +++++++++++++++++ sql/sql_update.cc | 1 + 3 files changed, 31 insertions(+) diff --git a/mysql-test/suite/versioning/r/rpl.result b/mysql-test/suite/versioning/r/rpl.result index fd62a65f473..8db963f9ea4 100644 --- a/mysql-test/suite/versioning/r/rpl.result +++ b/mysql-test/suite/versioning/r/rpl.result @@ -164,4 +164,17 @@ update t1 set i = 0; connection slave; connection master; drop table t1; +# MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables +set @old_row_image= @@binlog_row_image; +set binlog_row_image= minimal; +create or replace table t1 (pk int, i int, primary key(pk)) +with system versioning; +insert into t1 values (1,10),(2,20); +update t1 set i = 0; +connection slave; +connection master; +drop table t1; +set binlog_row_image= @old_row_image; +drop database test; +create database test; include/rpl_end.inc diff --git a/mysql-test/suite/versioning/t/rpl.test b/mysql-test/suite/versioning/t/rpl.test index e59d41c38a3..2549684da51 100644 --- a/mysql-test/suite/versioning/t/rpl.test +++ b/mysql-test/suite/versioning/t/rpl.test @@ -133,4 +133,21 @@ sync_slave_with_master; connection master; drop table t1; +--echo # MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables +set @old_row_image= @@binlog_row_image; +set binlog_row_image= minimal; + +create or replace table t1 (pk int, i int, primary key(pk)) +with system versioning; +insert into t1 values (1,10),(2,20); +update t1 set i = 0; + +--sync_slave_with_master +--connection master +drop table t1; +set binlog_row_image= @old_row_image; + +drop database test; +create database test; + --source include/rpl_end.inc diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 1d7dec31d56..5e5b6644377 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -956,6 +956,7 @@ update_begin: if (table->versioned(VERS_TIMESTAMP)) { store_record(table, record[2]); + table->mark_columns_per_binlog_row_image(); error= vers_insert_history_row(table); restore_record(table, record[2]); } From a82cfe109cbc033253ddaba82f9c2de663601002 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 27 Mar 2019 16:35:19 +0100 Subject: [PATCH 36/47] cleanup: move rbr-only test to rpl_row.test --- mysql-test/suite/versioning/r/rpl.result | 13 ------------- mysql-test/suite/versioning/r/rpl_row.result | 14 ++++++++++++++ mysql-test/suite/versioning/t/rpl.test | 17 ----------------- mysql-test/suite/versioning/t/rpl_row.test | 18 ++++++++++++++++++ 4 files changed, 32 insertions(+), 30 deletions(-) create mode 100644 mysql-test/suite/versioning/r/rpl_row.result create mode 100644 mysql-test/suite/versioning/t/rpl_row.test diff --git a/mysql-test/suite/versioning/r/rpl.result b/mysql-test/suite/versioning/r/rpl.result index 8db963f9ea4..fd62a65f473 100644 --- a/mysql-test/suite/versioning/r/rpl.result +++ b/mysql-test/suite/versioning/r/rpl.result @@ -164,17 +164,4 @@ update t1 set i = 0; connection slave; connection master; drop table t1; -# MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables -set @old_row_image= @@binlog_row_image; -set binlog_row_image= minimal; -create or replace table t1 (pk int, i int, primary key(pk)) -with system versioning; -insert into t1 values (1,10),(2,20); -update t1 set i = 0; -connection slave; -connection master; -drop table t1; -set binlog_row_image= @old_row_image; -drop database test; -create database test; include/rpl_end.inc diff --git a/mysql-test/suite/versioning/r/rpl_row.result b/mysql-test/suite/versioning/r/rpl_row.result new file mode 100644 index 00000000000..03ac8dc9eb8 --- /dev/null +++ b/mysql-test/suite/versioning/r/rpl_row.result @@ -0,0 +1,14 @@ +include/master-slave.inc +[connection master] +# MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables +set @old_row_image= @@binlog_row_image; +set binlog_row_image= minimal; +create or replace table t1 (pk int, i int, primary key(pk)) +with system versioning; +insert into t1 values (1,10),(2,20); +update t1 set i = 0; +connection slave; +connection master; +drop table t1; +set binlog_row_image= @old_row_image; +include/rpl_end.inc diff --git a/mysql-test/suite/versioning/t/rpl.test b/mysql-test/suite/versioning/t/rpl.test index 2549684da51..e59d41c38a3 100644 --- a/mysql-test/suite/versioning/t/rpl.test +++ b/mysql-test/suite/versioning/t/rpl.test @@ -133,21 +133,4 @@ sync_slave_with_master; connection master; drop table t1; ---echo # MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables -set @old_row_image= @@binlog_row_image; -set binlog_row_image= minimal; - -create or replace table t1 (pk int, i int, primary key(pk)) -with system versioning; -insert into t1 values (1,10),(2,20); -update t1 set i = 0; - ---sync_slave_with_master ---connection master -drop table t1; -set binlog_row_image= @old_row_image; - -drop database test; -create database test; - --source include/rpl_end.inc diff --git a/mysql-test/suite/versioning/t/rpl_row.test b/mysql-test/suite/versioning/t/rpl_row.test new file mode 100644 index 00000000000..17ce2dfdcf8 --- /dev/null +++ b/mysql-test/suite/versioning/t/rpl_row.test @@ -0,0 +1,18 @@ +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +--echo # MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables +set @old_row_image= @@binlog_row_image; +set binlog_row_image= minimal; + +create or replace table t1 (pk int, i int, primary key(pk)) +with system versioning; +insert into t1 values (1,10),(2,20); +update t1 set i = 0; + +--sync_slave_with_master +--connection master +drop table t1; +set binlog_row_image= @old_row_image; + +--source include/rpl_end.inc From ed661a0e59c0a41cee2ee44fc219febdf49de10e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 29 Mar 2019 19:42:01 +0100 Subject: [PATCH 37/47] post-merge: -Werror fixes in 10.3 --- sql/item.h | 2 +- storage/cassandra/ha_cassandra.cc | 2 +- storage/cassandra/ha_cassandra.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/item.h b/sql/item.h index d61667f3f2f..c11a4fe56c0 100644 --- a/sql/item.h +++ b/sql/item.h @@ -520,7 +520,7 @@ class Rewritable_query_parameter Value of 0 means that this object doesn't have to be replaced (for example SP variables in control statements) */ - uint pos_in_query; + my_ptrdiff_t pos_in_query; /* Byte length of parameter name in the statement. This is not diff --git a/storage/cassandra/ha_cassandra.cc b/storage/cassandra/ha_cassandra.cc index c55e9976ede..0104fc06420 100644 --- a/storage/cassandra/ha_cassandra.cc +++ b/storage/cassandra/ha_cassandra.cc @@ -2360,7 +2360,7 @@ public: }; -int ha_cassandra::update_row(const uchar *old_data, uchar *new_data) +int ha_cassandra::update_row(const uchar *old_data, const uchar *new_data) { DYNAMIC_COLUMN_VALUE *oldvals, *vals; LEX_STRING *oldnames, *names; diff --git a/storage/cassandra/ha_cassandra.h b/storage/cassandra/ha_cassandra.h index 5da1bbcaa78..49fd87ad15c 100644 --- a/storage/cassandra/ha_cassandra.h +++ b/storage/cassandra/ha_cassandra.h @@ -240,7 +240,7 @@ public: int close(void); int write_row(uchar *buf); - int update_row(const uchar *old_data, uchar *new_data); + int update_row(const uchar *old_data, const uchar *new_data); int delete_row(const uchar *buf); /** @brief @@ -268,7 +268,7 @@ public: THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); ///< required - my_bool register_query_cache_table(THD *thd, char *table_key, + my_bool register_query_cache_table(THD *thd, const char *table_key, uint key_length, qc_engine_callback *engine_callback, From b66164ab563cbf0468864bd89ada70c7d419e513 Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Wed, 29 Aug 2018 13:50:52 +0300 Subject: [PATCH 38/47] remove dead code --- storage/innobase/dict/dict0stats.cc | 59 ----- storage/innobase/handler/handler0alter.cc | 279 ---------------------- storage/innobase/include/dict0stats.h | 15 -- storage/innobase/include/ha_prototypes.h | 1 - storage/innobase/include/mem0mem.h | 64 ----- storage/innobase/include/mem0mem.ic | 96 -------- 6 files changed, 514 deletions(-) diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index efa5892fc66..d6d7845b2c3 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -3838,65 +3838,6 @@ dict_stats_rename_table( return(ret); } -#ifdef MYSQL_RENAME_INDEX -/*********************************************************************//** -Renames an index in InnoDB persistent stats storage. -This function creates its own transaction and commits it. -@return DB_SUCCESS or error code. DB_STATS_DO_NOT_EXIST will be returned -if the persistent stats do not exist. */ -dberr_t -dict_stats_rename_index( -/*====================*/ - const dict_table_t* table, /*!< in: table whose index - is renamed */ - const char* old_index_name, /*!< in: old index name */ - const char* new_index_name) /*!< in: new index name */ -{ - rw_lock_x_lock(dict_operation_lock); - mutex_enter(&dict_sys->mutex); - - if (!dict_stats_persistent_storage_check(true)) { - mutex_exit(&dict_sys->mutex); - rw_lock_x_unlock(dict_operation_lock); - return(DB_STATS_DO_NOT_EXIST); - } - - char dbname_utf8[MAX_DB_UTF8_LEN]; - char tablename_utf8[MAX_TABLE_UTF8_LEN]; - - dict_fs2utf8(table->name.m_name, dbname_utf8, sizeof(dbname_utf8), - tablename_utf8, sizeof(tablename_utf8)); - - pars_info_t* pinfo; - - pinfo = pars_info_create(); - - pars_info_add_str_literal(pinfo, "dbname_utf8", dbname_utf8); - pars_info_add_str_literal(pinfo, "tablename_utf8", tablename_utf8); - pars_info_add_str_literal(pinfo, "new_index_name", new_index_name); - pars_info_add_str_literal(pinfo, "old_index_name", old_index_name); - - dberr_t ret; - - ret = dict_stats_exec_sql( - pinfo, - "PROCEDURE RENAME_INDEX_IN_INDEX_STATS () IS\n" - "BEGIN\n" - "UPDATE \"" INDEX_STATS_NAME "\" SET\n" - "index_name = :new_index_name\n" - "WHERE\n" - "database_name = :dbname_utf8 AND\n" - "table_name = :tablename_utf8 AND\n" - "index_name = :old_index_name;\n" - "END;\n", NULL); - - mutex_exit(&dict_sys->mutex); - rw_lock_x_unlock(dict_operation_lock); - - return(ret); -} -#endif /* MYSQL_RENAME_INDEX */ - /* tests @{ */ #ifdef UNIV_ENABLE_UNIT_TEST_DICT_STATS diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 3faf62479ff..7bae1a0a87f 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -104,9 +104,6 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_NOREBUILD | INNOBASE_FOREIGN_OPERATIONS | Alter_inplace_info::DROP_INDEX | Alter_inplace_info::DROP_UNIQUE_INDEX -#ifdef MYSQL_RENAME_INDEX - | Alter_inplace_info::RENAME_INDEX -#endif | Alter_inplace_info::ALTER_COLUMN_NAME | Alter_inplace_info::ALTER_COLUMN_EQUAL_PACK_LENGTH //| Alter_inplace_info::ALTER_INDEX_COMMENT @@ -2028,23 +2025,6 @@ innobase_check_index_keys( } } -#ifdef MYSQL_RENAME_INDEX - /* If a key by the same name is being created and - renamed, the name clash is OK. E.g. - ALTER TABLE t ADD INDEX i (col), RENAME INDEX i TO x - where the index "i" exists prior to the ALTER command. - In this case we: - 1. rename the existing index from "i" to "x" - 2. add the new index "i" */ - for (uint i = 0; i < info->index_rename_count; i++) { - const KEY_PAIR* pair - = &info->index_rename_buffer[i]; - - if (0 == strcmp(key.name, pair->old_key->name)) { - goto name_ok; - } - } -#endif /* MYSQL_RENAME_INDEX */ my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key.name); @@ -5236,192 +5216,6 @@ innobase_check_foreign_key_index( return(false); } -#ifdef MYSQL_RENAME_INDEX -/** -Rename a given index in the InnoDB data dictionary. - -@param index index to rename -@param new_name new name of the index -@param[in,out] trx dict transaction to use, not going to be committed here - -@retval true Failure -@retval false Success */ -static MY_ATTRIBUTE((warn_unused_result)) -bool -rename_index_in_data_dictionary( -/*============================*/ - const dict_index_t* index, - const char* new_name, - trx_t* trx) -{ - DBUG_ENTER("rename_index_in_data_dictionary"); - - ut_ad(mutex_own(&dict_sys->mutex)); - ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X)); - ut_ad(trx->dict_operation_lock_mode == RW_X_LATCH); - - pars_info_t* pinfo; - dberr_t err; - - pinfo = pars_info_create(); - - pars_info_add_ull_literal(pinfo, "table_id", index->table->id); - pars_info_add_ull_literal(pinfo, "index_id", index->id); - pars_info_add_str_literal(pinfo, "new_name", new_name); - - trx->op_info = "Renaming an index in SYS_INDEXES"; - - DBUG_EXECUTE_IF( - "ib_rename_index_fail1", - DBUG_SET("+d,innodb_report_deadlock"); - ); - - err = que_eval_sql( - pinfo, - "PROCEDURE RENAME_INDEX_IN_SYS_INDEXES () IS\n" - "BEGIN\n" - "UPDATE SYS_INDEXES SET\n" - "NAME = :new_name\n" - "WHERE\n" - "ID = :index_id AND\n" - "TABLE_ID = :table_id;\n" - "END;\n", - FALSE, trx); /* pinfo is freed by que_eval_sql() */ - - DBUG_EXECUTE_IF( - "ib_rename_index_fail1", - DBUG_SET("-d,innodb_report_deadlock"); - ); - - trx->op_info = ""; - - if (err != DB_SUCCESS) { - my_error_innodb(err, index->table->name.m_name, 0); - DBUG_RETURN(true); - } - - DBUG_RETURN(false); -} - -/** -Rename all indexes in data dictionary of a given table that are -specified in ha_alter_info. - -@param ctx alter context, used to fetch the list of indexes to -rename -@param ha_alter_info fetch the new names from here -@param[in,out] trx dict transaction to use, not going to be committed here - -@retval true Failure -@retval false Success */ -static MY_ATTRIBUTE((warn_unused_result)) -bool -rename_indexes_in_data_dictionary( -/*==============================*/ - const ha_innobase_inplace_ctx* ctx, - const Alter_inplace_info* ha_alter_info, - trx_t* trx) -{ - DBUG_ENTER("rename_indexes_in_data_dictionary"); - - ut_ad(ctx->num_to_rename == ha_alter_info->index_rename_count); - - for (ulint i = 0; i < ctx->num_to_rename; i++) { - - KEY_PAIR* pair = &ha_alter_info->index_rename_buffer[i]; - dict_index_t* index; - - index = ctx->rename[i]; - - ut_ad(strcmp(index->name, pair->old_key->name) == 0); - - if (rename_index_in_data_dictionary(index, - pair->new_key->name, - trx)) { - /* failed */ - DBUG_RETURN(true); - } - } - - DBUG_RETURN(false); -} - -/** -Rename a given index in the InnoDB data dictionary cache. - -@param[in,out] index index to rename -@param new_name new index name -*/ -static -void -rename_index_in_cache( -/*==================*/ - dict_index_t* index, - const char* new_name) -{ - DBUG_ENTER("rename_index_in_cache"); - - ut_ad(mutex_own(&dict_sys->mutex)); - ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X)); - - size_t old_name_len = strlen(index->name); - size_t new_name_len = strlen(new_name); - - if (old_name_len >= new_name_len) { - /* reuse the old buffer for the name if it is large enough */ - memcpy(const_cast(index->name()), new_name, - new_name_len + 1); - } else { - /* Free the old chunk of memory if it is at the topmost - place in the heap, otherwise the old chunk will be freed - when the index is evicted from the cache. This code will - kick-in in a repeated ALTER sequences where the old name is - alternately longer/shorter than the new name: - 1. ALTER TABLE t RENAME INDEX a TO aa; - 2. ALTER TABLE t RENAME INDEX aa TO a; - 3. go to 1. */ - index->name = mem_heap_strdup_replace( - index->heap, - /* Presumed topmost element of the heap: */ - index->name, old_name_len + 1, - new_name); - } - - DBUG_VOID_RETURN; -} - -/** -Rename all indexes in data dictionary cache of a given table that are -specified in ha_alter_info. - -@param ctx alter context, used to fetch the list of indexes to rename -@param ha_alter_info fetch the new names from here -*/ -static -void -rename_indexes_in_cache( -/*====================*/ - const ha_innobase_inplace_ctx* ctx, - const Alter_inplace_info* ha_alter_info) -{ - DBUG_ENTER("rename_indexes_in_cache"); - - ut_ad(ctx->num_to_rename == ha_alter_info->index_rename_count); - - for (ulint i = 0; i < ctx->num_to_rename; i++) { - KEY_PAIR* pair = &ha_alter_info->index_rename_buffer[i]; - dict_index_t* index; - - index = ctx->rename[i]; - - ut_ad(strcmp(index->name, pair->old_key->name) == 0); - - rename_index_in_cache(index, pair->new_key->name); - } - - DBUG_VOID_RETURN; -} -#endif /* MYSQL_RENAME_INDEX */ /** Fill the stored column information in s_cols list. @param[in] altered_table mysql table object @@ -6020,43 +5814,6 @@ check_if_can_drop_indexes: n_rename_index = 0; rename_index = NULL; -#ifdef MYSQL_RENAME_INDEX - - n_rename_index = ha_alter_info->index_rename_count; - - /* Create a list of dict_index_t objects that are to be renamed, - also checking for requests to rename nonexistent indexes. If - the table is going to be rebuilt (new_clustered == true in - prepare_inplace_alter_table_dict()), then this can be skipped, - but we don't for simplicity (we have not determined the value of - new_clustered yet). */ - if (n_rename_index > 0) { - rename_index = static_cast( - mem_heap_alloc( - heap, - n_rename_index * sizeof(*rename_index))); - for (ulint i = 0; i < n_rename_index; i++) { - dict_index_t* index = NULL; - const char* old_name = NULL; - - const char* old_name = ha_alter_info - ->index_rename_buffer[i].old_key->name; - - index = dict_table_get_index_on_name(indexed_table, - old_name); - - if (index == NULL) { - my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), - old_name, - m_prebuilt->table->name.m_name); - goto err_exit; - } - - rename_index[i] = index; - } - } -#endif /* MYSQL_RENAME_INDEX */ - n_add_fk = 0; if (ha_alter_info->handler_flags @@ -8088,14 +7845,6 @@ commit_try_norebuild( DBUG_RETURN(true); } -#ifdef MYSQL_RENAME_INDEX - if ((ha_alter_info->handler_flags - & Alter_inplace_info::RENAME_INDEX) - && rename_indexes_in_data_dictionary(ctx, ha_alter_info, trx)) { - DBUG_RETURN(true); - } -#endif /* MYSQL_RENAME_INDEX */ - if ((ha_alter_info->handler_flags & Alter_inplace_info::DROP_VIRTUAL_COLUMN) && innobase_drop_virtual_try( @@ -8295,31 +8044,6 @@ alter_stats_norebuild( } } -#ifdef MYSQL_RENAME_INDEX - for (i = 0; i < ha_alter_info->index_rename_count; i++) { - KEY_PAIR* pair = &ha_alter_info->index_rename_buffer[i]; - dberr_t err; - - err = dict_stats_rename_index(ctx->new_table, - pair->old_key->name, - pair->new_key->name); - - if (err != DB_SUCCESS) { - push_warning_printf( - thd, - Sql_condition::WARN_LEVEL_WARN, - ER_ERROR_ON_RENAME, - "Error renaming an index of table '%s'" - " from '%s' to '%s' in InnoDB persistent" - " statistics storage: %s", - table_name, - pair->old_key->name, - pair->new_key->name, - ut_strerr(err)); - } - } -#endif /* MYSQL_RENAME_INDEX */ - for (i = 0; i < ctx->num_to_add_index; i++) { dict_index_t* index = ctx->add_index[i]; DBUG_ASSERT(index->table == ctx->new_table); @@ -8847,9 +8571,6 @@ foreign_fail: innobase_rename_or_enlarge_columns_cache( ha_alter_info, table, ctx->new_table); -#ifdef MYSQL_RENAME_INDEX - rename_indexes_in_cache(ctx, ha_alter_info); -#endif if (fk_fail && m_prebuilt->trx->check_foreigns) { goto foreign_fail; } diff --git a/storage/innobase/include/dict0stats.h b/storage/innobase/include/dict0stats.h index 95507dca36c..e846ecabf5a 100644 --- a/storage/innobase/include/dict0stats.h +++ b/storage/innobase/include/dict0stats.h @@ -187,21 +187,6 @@ dict_stats_rename_table( char* errstr, /*!< out: error string if != DB_SUCCESS is returned */ size_t errstr_sz); /*!< in: errstr size */ -#ifdef MYSQL_RENAME_INDEX -/*********************************************************************//** -Renames an index in InnoDB persistent stats storage. -This function creates its own transaction and commits it. -@return DB_SUCCESS or error code. DB_STATS_DO_NOT_EXIST will be returned -if the persistent stats do not exist. */ -dberr_t -dict_stats_rename_index( -/*====================*/ - const dict_table_t* table, /*!< in: table whose index - is renamed */ - const char* old_index_name, /*!< in: old index name */ - const char* new_index_name) /*!< in: new index name */ - __attribute__((warn_unused_result)); -#endif /* MYSQL_RENAME_INDEX */ /** Save an individual index's statistic into the persistent statistics storage. diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index 8af4d320997..742914e97f1 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -40,7 +40,6 @@ class THD; // JAN: TODO missing features: #undef MYSQL_FT_INIT_EXT #undef MYSQL_PFS -#undef MYSQL_RENAME_INDEX #undef MYSQL_STORE_FTS_DOC_ID /*******************************************************************//** diff --git a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h index 0ae784a58d0..17a388ab68c 100644 --- a/storage/innobase/include/mem0mem.h +++ b/storage/innobase/include/mem0mem.h @@ -193,70 +193,6 @@ mem_heap_get_top( mem_heap_t* heap, ulint n); -/** Checks if a given chunk of memory is the topmost element stored in the -heap. If this is the case, then calling mem_heap_free_top() would free -that element from the heap. -@param[in] heap memory heap -@param[in] buf presumed topmost element -@param[in] buf_sz size of buf in bytes -@return true if topmost */ -UNIV_INLINE -bool -mem_heap_is_top( - mem_heap_t* heap, - const void* buf, - ulint buf_sz) - MY_ATTRIBUTE((warn_unused_result)); - -/*****************************************************************//** -Allocate a new chunk of memory from a memory heap, possibly discarding -the topmost element. If the memory chunk specified with (top, top_sz) -is the topmost element, then it will be discarded, otherwise it will -be left untouched and this function will be equivallent to -mem_heap_alloc(). -@return allocated storage, NULL if did not succeed (only possible for -MEM_HEAP_BTR_SEARCH type heaps) */ -UNIV_INLINE -void* -mem_heap_replace( -/*=============*/ - mem_heap_t* heap, /*!< in/out: memory heap */ - const void* top, /*!< in: chunk to discard if possible */ - ulint top_sz, /*!< in: size of top in bytes */ - ulint new_sz);/*!< in: desired size of the new chunk */ -/*****************************************************************//** -Allocate a new chunk of memory from a memory heap, possibly discarding -the topmost element and then copy the specified data to it. If the memory -chunk specified with (top, top_sz) is the topmost element, then it will be -discarded, otherwise it will be left untouched and this function will be -equivallent to mem_heap_dup(). -@return allocated storage, NULL if did not succeed (only possible for -MEM_HEAP_BTR_SEARCH type heaps) */ -UNIV_INLINE -void* -mem_heap_dup_replace( -/*=================*/ - mem_heap_t* heap, /*!< in/out: memory heap */ - const void* top, /*!< in: chunk to discard if possible */ - ulint top_sz, /*!< in: size of top in bytes */ - const void* data, /*!< in: new data to duplicate */ - ulint data_sz);/*!< in: size of data in bytes */ -/*****************************************************************//** -Allocate a new chunk of memory from a memory heap, possibly discarding -the topmost element and then copy the specified string to it. If the memory -chunk specified with (top, top_sz) is the topmost element, then it will be -discarded, otherwise it will be left untouched and this function will be -equivallent to mem_heap_strdup(). -@return allocated string, NULL if did not succeed (only possible for -MEM_HEAP_BTR_SEARCH type heaps) */ -UNIV_INLINE -char* -mem_heap_strdup_replace( -/*====================*/ - mem_heap_t* heap, /*!< in/out: memory heap */ - const void* top, /*!< in: chunk to discard if possible */ - ulint top_sz, /*!< in: size of top in bytes */ - const char* str); /*!< in: new data to duplicate */ /*****************************************************************//** Frees the topmost element in a memory heap. The size of the element must be given. */ diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic index 42dda9e0bb9..9d6d23ebe38 100644 --- a/storage/innobase/include/mem0mem.ic +++ b/storage/innobase/include/mem0mem.ic @@ -327,102 +327,6 @@ mem_heap_get_top( return((void*) buf); } -/** Checks if a given chunk of memory is the topmost element stored in the -heap. If this is the case, then calling mem_heap_free_top() would free -that element from the heap. -@param[in] heap memory heap -@param[in] buf presumed topmost element -@param[in] buf_sz size of buf in bytes -@return true if topmost */ -UNIV_INLINE -bool -mem_heap_is_top( - mem_heap_t* heap, - const void* buf, - ulint buf_sz) -{ - const byte* first_free_byte; - const byte* presumed_start_of_buf; - - ut_d(mem_block_validate(heap)); - - first_free_byte = mem_heap_get_heap_top(heap); - - presumed_start_of_buf = first_free_byte - MEM_SPACE_NEEDED(buf_sz); - - return(presumed_start_of_buf == buf); -} - -/*****************************************************************//** -Allocate a new chunk of memory from a memory heap, possibly discarding -the topmost element. If the memory chunk specified with (top, top_sz) -is the topmost element, then it will be discarded, otherwise it will -be left untouched and this function will be equivallent to -mem_heap_alloc(). -@return allocated storage, NULL if did not succeed (only possible for -MEM_HEAP_BTR_SEARCH type heaps) */ -UNIV_INLINE -void* -mem_heap_replace( -/*=============*/ - mem_heap_t* heap, /*!< in/out: memory heap */ - const void* top, /*!< in: chunk to discard if possible */ - ulint top_sz, /*!< in: size of top in bytes */ - ulint new_sz) /*!< in: desired size of the new chunk */ -{ - if (mem_heap_is_top(heap, top, top_sz)) { - mem_heap_free_top(heap, top_sz); - } - - return(mem_heap_alloc(heap, new_sz)); -} - -/*****************************************************************//** -Allocate a new chunk of memory from a memory heap, possibly discarding -the topmost element and then copy the specified data to it. If the memory -chunk specified with (top, top_sz) is the topmost element, then it will be -discarded, otherwise it will be left untouched and this function will be -equivallent to mem_heap_dup(). -@return allocated storage, NULL if did not succeed (only possible for -MEM_HEAP_BTR_SEARCH type heaps) */ -UNIV_INLINE -void* -mem_heap_dup_replace( -/*=================*/ - mem_heap_t* heap, /*!< in/out: memory heap */ - const void* top, /*!< in: chunk to discard if possible */ - ulint top_sz, /*!< in: size of top in bytes */ - const void* data, /*!< in: new data to duplicate */ - ulint data_sz)/*!< in: size of data in bytes */ -{ - void* p = mem_heap_replace(heap, top, top_sz, data_sz); - - memcpy(p, data, data_sz); - - return(p); -} - -/*****************************************************************//** -Allocate a new chunk of memory from a memory heap, possibly discarding -the topmost element and then copy the specified string to it. If the memory -chunk specified with (top, top_sz) is the topmost element, then it will be -discarded, otherwise it will be left untouched and this function will be -equivallent to mem_heap_strdup(). -@return allocated string, NULL if did not succeed (only possible for -MEM_HEAP_BTR_SEARCH type heaps) */ -UNIV_INLINE -char* -mem_heap_strdup_replace( -/*====================*/ - mem_heap_t* heap, /*!< in/out: memory heap */ - const void* top, /*!< in: chunk to discard if possible */ - ulint top_sz, /*!< in: size of top in bytes */ - const char* str) /*!< in: new data to duplicate */ -{ - return(reinterpret_cast(mem_heap_dup_replace( - heap, top, top_sz, str, strlen(str) + 1))); -} - /*****************************************************************//** Frees the topmost element in a memory heap. The size of the element must be given. */ From 76934212ebe51dd8c4a2a08c8ecc1612005d2e53 Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Sun, 23 Sep 2018 12:19:24 +0300 Subject: [PATCH 39/47] remove unneeded code rec_get_offsets() was previously called in a btr_cur_optimistic_update() --- storage/innobase/btr/btr0cur.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 8f26ac9e0e5..f849ebb0546 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -4345,10 +4345,7 @@ btr_cur_pessimistic_update( } rec = btr_cur_get_rec(cursor); - - *offsets = rec_get_offsets( - rec, index, *offsets, page_is_leaf(page), - ULINT_UNDEFINED, offsets_heap); + ut_ad(rec_offs_validate(rec, index, *offsets)); dtuple_t* new_entry = row_rec_to_index_entry( rec, index, *offsets, &n_ext, entry_heap); From c2d9a346ffed962929c33c79d34a2f16f2abf181 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Sat, 30 Mar 2019 19:50:55 +0300 Subject: [PATCH 40/47] MDEV-19089 part #1: adapt rocksdb_stress suite for MariaDB --- .../rocksdb_stress/include/have_rocksdb.inc | 10 +++++++ .../rocksdb_stress/include/have_rocksdb.opt | 12 ++++++++ .../rocksdb_stress/include/rocksdb_stress.inc | 11 ++++---- .../rocksdb/mysql-test/rocksdb_stress/my.cnf | 2 +- .../mysql-test/rocksdb_stress/suite.opt | 2 ++ .../mysql-test/rocksdb_stress/suite.pm | 28 +++++++++++++++++++ .../rocksdb_stress/t/rocksdb_stress.test | 2 +- .../t/rocksdb_stress_crash.test | 2 +- 8 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 storage/rocksdb/mysql-test/rocksdb_stress/include/have_rocksdb.inc create mode 100644 storage/rocksdb/mysql-test/rocksdb_stress/include/have_rocksdb.opt create mode 100644 storage/rocksdb/mysql-test/rocksdb_stress/suite.opt create mode 100644 storage/rocksdb/mysql-test/rocksdb_stress/suite.pm diff --git a/storage/rocksdb/mysql-test/rocksdb_stress/include/have_rocksdb.inc b/storage/rocksdb/mysql-test/rocksdb_stress/include/have_rocksdb.inc new file mode 100644 index 00000000000..1f762d38c64 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_stress/include/have_rocksdb.inc @@ -0,0 +1,10 @@ +if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'rocksdb' AND support IN ('YES', 'DEFAULT', 'ENABLED')`) +{ + --skip Test requires engine RocksDB. +} + +--disable_query_log +# Table statistics can vary depending on when the memtables are flushed, so +# flush them at the beginning of the test to ensure the test runs consistently. +set global rocksdb_force_flush_memtable_now = true; +--enable_query_log diff --git a/storage/rocksdb/mysql-test/rocksdb_stress/include/have_rocksdb.opt b/storage/rocksdb/mysql-test/rocksdb_stress/include/have_rocksdb.opt new file mode 100644 index 00000000000..36d7dda1609 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_stress/include/have_rocksdb.opt @@ -0,0 +1,12 @@ +--loose-enable-rocksdb +--loose-enable-rocksdb_global_info +--loose-enable-rocksdb_ddl +--loose-enable-rocksdb_cf_options +--loose-enable_rocksdb_perf_context +--loose-enable_rocksdb_perf_context_global +--loose-enable-rocksdb_index_file_map +--loose-enable-rocksdb_dbstats +--loose-enable-rocksdb_cfstats +--loose-enable-rocksdb_lock_info +--loose-enable-rocksdb_trx +--loose-enable-rocksdb_locks diff --git a/storage/rocksdb/mysql-test/rocksdb_stress/include/rocksdb_stress.inc b/storage/rocksdb/mysql-test/rocksdb_stress/include/rocksdb_stress.inc index a8ac90fcc3f..3838987bf88 100644 --- a/storage/rocksdb/mysql-test/rocksdb_stress/include/rocksdb_stress.inc +++ b/storage/rocksdb/mysql-test/rocksdb_stress/include/rocksdb_stress.inc @@ -9,11 +9,12 @@ let $MYSQL_BASEDIR = `SELECT @@BASEDIR`; let $exec = - python $MYSQL_BASEDIR/mysql-test/suite/rocksdb_stress/t/load_generator.py - -L $MYSQL_TMP_DIR/load_generator.log -H $master_host -t $table - -P $MASTER_MYPORT -n $num_records -m $max_records - -l $num_loaders -c $num_checkers -r $num_requests - -E $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + python + $MYSQL_BASEDIR/storage/rocksdb/mysql-test/rocksdb_stress/t/load_generator.py \ + -L $MYSQL_TMP_DIR/load_generator.log -H $master_host -t $table \ + -P $MASTER_MYPORT -n $num_records -m $max_records \ + -l $num_loaders -c $num_checkers -r $num_requests \ + -E $MYSQLTEST_VARDIR/tmp/mysqld.1.expect \ -D $reap_delay; exec $exec; diff --git a/storage/rocksdb/mysql-test/rocksdb_stress/my.cnf b/storage/rocksdb/mysql-test/rocksdb_stress/my.cnf index fb985f5d1b4..780e46b4f22 100644 --- a/storage/rocksdb/mysql-test/rocksdb_stress/my.cnf +++ b/storage/rocksdb/mysql-test/rocksdb_stress/my.cnf @@ -1,5 +1,5 @@ !include include/default_my.cnf -!include suite/rocksdb/my.cnf +!include ../storage/rocksdb/mysql-test/rocksdb/my.cnf !include suite/rpl/my.cnf [mysqld.1] diff --git a/storage/rocksdb/mysql-test/rocksdb_stress/suite.opt b/storage/rocksdb/mysql-test/rocksdb_stress/suite.opt new file mode 100644 index 00000000000..22c9d7a300e --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_stress/suite.opt @@ -0,0 +1,2 @@ +--plugin-load=$HA_ROCKSDB_SO --default-storage-engine=rocksdb + diff --git a/storage/rocksdb/mysql-test/rocksdb_stress/suite.pm b/storage/rocksdb/mysql-test/rocksdb_stress/suite.pm new file mode 100644 index 00000000000..3423d34ded5 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_stress/suite.pm @@ -0,0 +1,28 @@ +package My::Suite::Rocksdb; + +use My::SysInfo; + +# +# Note: ../rocksdb_sys_vars/suite.pm file has a similar +# function. If you modify this file, consider modifying that one, too. +# +@ISA = qw(My::Suite); +use My::Find; +use File::Basename; +use strict; + +sub is_default { not $::opt_embedded_server } + +my $sst_dump= +::mtr_exe_maybe_exists( + "$::bindir/storage/rocksdb$::opt_vs_config/sst_dump", + "$::path_client_bindir/sst_dump"); +return "RocksDB is not compiled, no sst_dump" unless $sst_dump; +$ENV{MARIAROCKS_SST_DUMP}="$sst_dump"; + +# Temporarily disable testing under valgrind, due to MDEV-12439 +return "RocksDB tests disabled under valgrind" if ($::opt_valgrind); + + +bless { }; + diff --git a/storage/rocksdb/mysql-test/rocksdb_stress/t/rocksdb_stress.test b/storage/rocksdb/mysql-test/rocksdb_stress/t/rocksdb_stress.test index 307211a124d..e48b0c47ae3 100644 --- a/storage/rocksdb/mysql-test/rocksdb_stress/t/rocksdb_stress.test +++ b/storage/rocksdb/mysql-test/rocksdb_stress/t/rocksdb_stress.test @@ -30,4 +30,4 @@ ENGINE=RocksDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin; --let $num_requests = 10000 --let $reap_delay = 0 ---source suite/rocksdb_stress/include/rocksdb_stress.inc +--source include/rocksdb_stress.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_stress/t/rocksdb_stress_crash.test b/storage/rocksdb/mysql-test/rocksdb_stress/t/rocksdb_stress_crash.test index 8ef4c73c3b0..3da3dc7b3c3 100644 --- a/storage/rocksdb/mysql-test/rocksdb_stress/t/rocksdb_stress_crash.test +++ b/storage/rocksdb/mysql-test/rocksdb_stress/t/rocksdb_stress_crash.test @@ -31,4 +31,4 @@ ENGINE=RocksDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin; --let $num_requests = 10000 --let $reap_delay = 180 ---source suite/rocksdb_stress/include/rocksdb_stress.inc +--source include/rocksdb_stress.inc From fe1dfe3928ae1e50a79c6134626ce461f472cdda Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Sat, 30 Mar 2019 20:00:13 +0300 Subject: [PATCH 41/47] MDEV-19089, part #2: mark rocksdb.deadlock as "big test" It turns out, moving it to rocksdb_stress test suite is not that easy. --- storage/rocksdb/mysql-test/rocksdb/t/deadlock.test | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/rocksdb/mysql-test/rocksdb/t/deadlock.test b/storage/rocksdb/mysql-test/rocksdb/t/deadlock.test index 3be7fda9952..656be9eb3fc 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/deadlock.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/deadlock.test @@ -3,6 +3,7 @@ --echo # --source include/have_rocksdb.inc +--source include/big_test.inc --echo # Disable for valgrind because this takes too long --source include/not_valgrind.inc From 23eeecd68fd2ff4451286d6e2a52fa5b89b7961c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 1 Apr 2019 10:32:03 +0300 Subject: [PATCH 42/47] MDEV-19111 Unused field INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING.ROTATING_OR_FLUSHING The MDEV-11738/MDEV-11581 fix was supposed to add the column ROTATING_OR_FLUSHING to the INFORMATION_SCHEMA table INNODB_TABLESPACES_ENCRYPTION, but it also added that column to INNODB_TABLESPACES_SCRUBBING in InnoDB (not XtraDB). The extra column was never initialized. We will remove it, because key rotation has nothing to do with the scrubbing of tablespace data. --- storage/innobase/handler/i_s.cc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index ed6133c172f..8ea6fca63a4 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -8506,15 +8506,6 @@ static ST_FIELD_INFO innodb_tablespaces_scrubbing_fields_info[] = STRUCT_FLD(old_name, ""), STRUCT_FLD(open_method, SKIP_OPEN_TABLE)}, -#define TABLESPACES_ENCRYPTION_ROTATING_OR_FLUSHING 9 - {STRUCT_FLD(field_name, "ROTATING_OR_FLUSHING"), - STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS), - STRUCT_FLD(field_type, MYSQL_TYPE_LONG), - STRUCT_FLD(value, 0), - STRUCT_FLD(field_flags, MY_I_S_UNSIGNED), - STRUCT_FLD(old_name, ""), - STRUCT_FLD(open_method, SKIP_OPEN_TABLE)}, - END_OF_ST_FIELD_INFO }; From 833071b857f041796c0f4b4fba05e62877565d14 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Mon, 1 Apr 2019 12:58:51 +0300 Subject: [PATCH 43/47] Disable tests in rocksdb_stress suite (which was enabled a few commits ago) --- storage/rocksdb/mysql-test/rocksdb_stress/t/disabled.def | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 storage/rocksdb/mysql-test/rocksdb_stress/t/disabled.def diff --git a/storage/rocksdb/mysql-test/rocksdb_stress/t/disabled.def b/storage/rocksdb/mysql-test/rocksdb_stress/t/disabled.def new file mode 100644 index 00000000000..42b2f661a8d --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_stress/t/disabled.def @@ -0,0 +1,2 @@ +rocksdb_stress_crash: Client scipt seems to hang on terminal input in MariaDB +rocksdb_stress: Client scipt seems to hang on terminal input in MariaDB From 619d22dde54ffe483ef8a57e49ec802b0e30c6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 1 Apr 2019 13:03:18 +0300 Subject: [PATCH 44/47] Rebuild the InnoDB lexical analyzers with flex 2.6.4 InnoDB includes 3 parsers, which use 3 lexical analyzers that are generated with flex. Flex versions before 2.6 emitted the keyword "register", which is deprecated in C++17. The lexical analyzers were regenerated as follows: for s in storage/innobase storage/xtradb do (cd "$s"/pars; ./make_flex.sh) touch "$s"/fts/*.l make -C "$s"/fts -f Makefile.query done --- storage/innobase/fts/fts0blex.cc | 1106 +++++++++++++++----------- storage/innobase/fts/fts0tlex.cc | 827 ++++++++++++------- storage/innobase/include/fts0blex.h | 465 +++++++++-- storage/innobase/include/fts0tlex.h | 465 +++++++++-- storage/innobase/include/pars0pars.h | 5 +- storage/innobase/pars/lexyy.cc | 506 ++++++------ storage/innobase/pars/make_flex.sh | 9 +- storage/innobase/pars/pars0lex.l | 4 +- storage/innobase/pars/pars0pars.cc | 9 +- storage/xtradb/fts/fts0blex.cc | 1078 +++++++++++++++---------- storage/xtradb/fts/fts0tlex.cc | 799 ++++++++++++------- storage/xtradb/include/fts0blex.h | 465 +++++++++-- storage/xtradb/include/fts0tlex.h | 465 +++++++++-- storage/xtradb/include/pars0pars.h | 5 +- storage/xtradb/pars/lexyy.cc | 484 ++++++----- storage/xtradb/pars/make_flex.sh | 9 +- storage/xtradb/pars/pars0lex.l | 10 +- storage/xtradb/pars/pars0pars.cc | 9 +- 18 files changed, 4494 insertions(+), 2226 deletions(-) diff --git a/storage/innobase/fts/fts0blex.cc b/storage/innobase/fts/fts0blex.cc index 2d71934fa0e..84811050e88 100644 --- a/storage/innobase/fts/fts0blex.cc +++ b/storage/innobase/fts/fts0blex.cc @@ -1,4 +1,3 @@ -#include "univ.i" #line 2 "fts0blex.cc" #line 4 "fts0blex.cc" @@ -9,12 +8,222 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define fts0b_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer fts0b_create_buffer +#endif + +#ifdef yy_delete_buffer +#define fts0b_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer fts0b_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define fts0b_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer fts0b_scan_buffer +#endif + +#ifdef yy_scan_string +#define fts0b_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string fts0b_scan_string +#endif + +#ifdef yy_scan_bytes +#define fts0b_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes fts0b_scan_bytes +#endif + +#ifdef yy_init_buffer +#define fts0b_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer fts0b_init_buffer +#endif + +#ifdef yy_flush_buffer +#define fts0b_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer fts0b_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define fts0b_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state fts0b_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define fts0b_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer fts0b_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define fts0bpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state fts0bpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define fts0bpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state fts0bpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define fts0bensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack fts0bensure_buffer_stack +#endif + +#ifdef yylex +#define fts0blex_ALREADY_DEFINED +#else +#define yylex fts0blex +#endif + +#ifdef yyrestart +#define fts0brestart_ALREADY_DEFINED +#else +#define yyrestart fts0brestart +#endif + +#ifdef yylex_init +#define fts0blex_init_ALREADY_DEFINED +#else +#define yylex_init fts0blex_init +#endif + +#ifdef yylex_init_extra +#define fts0blex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra fts0blex_init_extra +#endif + +#ifdef yylex_destroy +#define fts0blex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy fts0blex_destroy +#endif + +#ifdef yyget_debug +#define fts0bget_debug_ALREADY_DEFINED +#else +#define yyget_debug fts0bget_debug +#endif + +#ifdef yyset_debug +#define fts0bset_debug_ALREADY_DEFINED +#else +#define yyset_debug fts0bset_debug +#endif + +#ifdef yyget_extra +#define fts0bget_extra_ALREADY_DEFINED +#else +#define yyget_extra fts0bget_extra +#endif + +#ifdef yyset_extra +#define fts0bset_extra_ALREADY_DEFINED +#else +#define yyset_extra fts0bset_extra +#endif + +#ifdef yyget_in +#define fts0bget_in_ALREADY_DEFINED +#else +#define yyget_in fts0bget_in +#endif + +#ifdef yyset_in +#define fts0bset_in_ALREADY_DEFINED +#else +#define yyset_in fts0bset_in +#endif + +#ifdef yyget_out +#define fts0bget_out_ALREADY_DEFINED +#else +#define yyget_out fts0bget_out +#endif + +#ifdef yyset_out +#define fts0bset_out_ALREADY_DEFINED +#else +#define yyset_out fts0bset_out +#endif + +#ifdef yyget_leng +#define fts0bget_leng_ALREADY_DEFINED +#else +#define yyget_leng fts0bget_leng +#endif + +#ifdef yyget_text +#define fts0bget_text_ALREADY_DEFINED +#else +#define yyget_text fts0bget_text +#endif + +#ifdef yyget_lineno +#define fts0bget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno fts0bget_lineno +#endif + +#ifdef yyset_lineno +#define fts0bset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno fts0bset_lineno +#endif + +#ifdef yyget_column +#define fts0bget_column_ALREADY_DEFINED +#else +#define yyget_column fts0bget_column +#endif + +#ifdef yyset_column +#define fts0bset_column_ALREADY_DEFINED +#else +#define yyset_column fts0bset_column +#endif + +#ifdef yywrap +#define fts0bwrap_ALREADY_DEFINED +#else +#define yywrap fts0bwrap +#endif + +#ifdef yyalloc +#define fts0balloc_ALREADY_DEFINED +#else +#define yyalloc fts0balloc +#endif + +#ifdef yyrealloc +#define fts0brealloc_ALREADY_DEFINED +#else +#define yyrealloc fts0brealloc +#endif + +#ifdef yyfree +#define fts0bfree_ALREADY_DEFINED +#else +#define yyfree fts0bfree +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -35,7 +244,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -52,7 +261,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -85,40 +294,32 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -142,20 +343,16 @@ typedef void* yyscan_t; * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE fts0brestart(yyin ,yyscanner ) - +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -180,33 +377,33 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - -#define YY_LESS_LINENO(n) - + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = yyg->yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -219,7 +416,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -245,8 +442,8 @@ struct yy_buffer_state */ int yy_at_bol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. @@ -264,7 +461,7 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via fts0brestart()), so that the user can continue scanning by + * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 @@ -281,84 +478,77 @@ struct yy_buffer_state #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] -void fts0brestart (FILE *input_file ,yyscan_t yyscanner ); -void fts0b_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void fts0b_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0b_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0bpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void fts0bpop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -static void fts0bensure_buffer_stack (yyscan_t yyscanner ); -static void fts0b_load_buffer_state (yyscan_t yyscanner ); -static void fts0b_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) -#define YY_FLUSH_BUFFER fts0b_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); - -void *fts0balloc (yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); -void *fts0brealloc (void *,yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); -void fts0bfree (void * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); - -#define yy_new_buffer fts0b_create_buffer +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); +#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - fts0bensure_buffer_stack (yyscanner); \ + yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - fts0b_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ - fts0bensure_buffer_stack (yyscanner); \ + yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - fts0b_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define fts0bwrap(n) 1 +#define fts0bwrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; +typedef flex_uint8_t YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = static_cast(yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; - #define YY_NUM_RULES 7 #define YY_END_OF_BUFFER 8 /* This struct is not used in this scanner, @@ -368,13 +558,13 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[19] = +static const flex_int16_t yy_accept[19] = { 0, 4, 4, 8, 4, 1, 6, 1, 7, 7, 2, 3, 4, 1, 1, 0, 5, 3, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -406,26 +596,26 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[9] = +static const YY_CHAR yy_meta[9] = { 0, 1, 2, 3, 4, 5, 5, 5, 1 } ; -static yyconst flex_int16_t yy_base[22] = +static const flex_int16_t yy_base[22] = { 0, 0, 0, 22, 0, 7, 23, 0, 14, 23, 23, 7, 0, 0, 0, 5, 23, 0, 23, 11, 12, 16 } ; -static yyconst flex_int16_t yy_def[22] = +static const flex_int16_t yy_def[22] = { 0, 18, 1, 18, 19, 19, 18, 20, 21, 18, 18, 19, 19, 5, 20, 21, 18, 11, 0, 18, 18, 18 } ; -static yyconst flex_int16_t yy_nxt[32] = +static const flex_int16_t yy_nxt[32] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 13, 16, 14, 12, 12, 14, 17, 14, 15, 15, 16, 15, @@ -433,7 +623,7 @@ static yyconst flex_int16_t yy_nxt[32] = 18 } ; -static yyconst flex_int16_t yy_chk[32] = +static const flex_int16_t yy_chk[32] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 15, 5, 19, 19, 20, 11, 20, 21, 21, 8, 21, @@ -451,7 +641,7 @@ static yyconst flex_int16_t yy_chk[32] = #line 1 "fts0blex.l" /***************************************************************************** -Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved. 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 @@ -480,8 +670,9 @@ this program; if not, write to the Free Software Foundation, Inc., /* Required for reentrant parser */ #define YY_DECL int fts_blexer(YYSTYPE* val, yyscan_t yyscanner) +#line 674 "fts0blex.cc" #define YY_NO_INPUT 1 -#line 484 "fts0blex.cc" +#line 676 "fts0blex.cc" #define INITIAL 0 @@ -499,72 +690,76 @@ this program; if not, write to the Free Software Foundation, Inc., /* Holds the entire state of the reentrant scanner. */ struct yyguts_t -{ + { - /* User-defined. Not touched by flex. */ - YY_EXTRA_TYPE yyextra_r; + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; - /* The rest are the same as the globals declared in the non-reentrant scanner. */ - FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ - char yy_hold_char; - int yy_n_chars; - int yyleng_r; - char *yy_c_buf_p; - int yy_init; - int yy_start; - int yy_did_buffer_switch_on_eof; - int yy_start_stack_ptr; - int yy_start_stack_depth; - int *yy_start_stack; - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; - int yylineno_r; - int yy_flex_debug_r; + int yylineno_r; + int yy_flex_debug_r; - char *yytext_r; - int yy_more_flag; - int yy_more_len; + char *yytext_r; + int yy_more_flag; + int yy_more_len; -}; /* end struct yyguts_t */ + }; /* end struct yyguts_t */ -static int yy_init_globals (yyscan_t yyscanner ); +static int yy_init_globals ( yyscan_t yyscanner ); -int fts0blex_init (yyscan_t* scanner); +int yylex_init (yyscan_t* scanner); -int fts0blex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int fts0blex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); -int fts0bget_debug (yyscan_t yyscanner ); +int yyget_debug ( yyscan_t yyscanner ); -void fts0bset_debug (int debug_flag ,yyscan_t yyscanner ); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE fts0bget_extra (yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void fts0bset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *fts0bget_in (yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -void fts0bset_in (FILE * in_str ,yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *fts0bget_out (yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -void fts0bset_out (FILE * out_str ,yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int fts0bget_leng (yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -char *fts0bget_text (yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -int fts0bget_lineno (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -void fts0bset_lineno (int line_number ,yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -572,26 +767,29 @@ void fts0bset_lineno (int line_number ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int fts0bwrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int fts0bwrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); +static int yyinput ( yyscan_t yyscanner ); #else -static int input (yyscan_t yyscanner ); +static int input ( yyscan_t yyscanner ); #endif #endif @@ -611,7 +809,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -623,7 +821,7 @@ static int input (yyscan_t yyscanner ); { \ int c = '*'; \ int n; \ - for ( n = 0; n < static_cast(max_size) && \ + for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ @@ -635,8 +833,7 @@ static int input (yyscan_t yyscanner ); else \ { \ errno=0; \ - while ( (result = static_cast(fread(buf, 1, max_size, yyin))) \ - == 0 && ferror(yyin) ) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -677,9 +874,9 @@ static int input (yyscan_t yyscanner ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int fts0blex (yyscan_t yyscanner); +extern int yylex (yyscan_t yyscanner); -#define YY_DECL int fts0blex (yyscan_t yyscanner) +#define YY_DECL int yylex (yyscan_t yyscanner) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng @@ -691,7 +888,7 @@ extern int fts0blex (yyscan_t yyscanner); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -701,15 +898,10 @@ extern int fts0blex (yyscan_t yyscanner); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - -#line 43 "fts0blex.l" - - -#line 712 "fts0blex.cc" + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( !yyg->yy_init ) { @@ -729,15 +921,21 @@ YY_DECL yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - fts0bensure_buffer_stack (yyscanner); + yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - fts0b_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - fts0b_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 43 "fts0blex.l" + + +#line 937 "fts0blex.cc" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -753,7 +951,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -763,9 +961,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 19 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 18 ); @@ -840,7 +1038,7 @@ YY_RULE_SETUP #line 73 "fts0blex.l" ECHO; YY_BREAK -#line 843 "fts0blex.cc" +#line 1042 "fts0blex.cc" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -858,7 +1056,7 @@ case YY_STATE_EOF(INITIAL): /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called - * fts0blex(). If so, then we have to assure + * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a @@ -919,7 +1117,7 @@ case YY_STATE_EOF(INITIAL): { yyg->yy_did_buffer_switch_on_eof = 0; - if ( fts0bwrap(yyscanner ) ) + if ( yywrap( yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -972,7 +1170,8 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of fts0blex */ + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -983,10 +1182,10 @@ case YY_STATE_EOF(INITIAL): */ static int yy_get_next_buffer (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) @@ -1015,7 +1214,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1028,21 +1227,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - int num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1); + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = static_cast(b->yy_buf_size * 2); + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1051,11 +1250,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - fts0brealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1063,8 +1263,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1); + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; } @@ -1073,7 +1273,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -1083,7 +1283,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - fts0brestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); } else @@ -1097,12 +1297,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) fts0brealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } yyg->yy_n_chars += number_to_move; @@ -1116,17 +1319,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* yy_get_previous_state - get the state just before the EOB char was reached */ -static yy_state_type yy_get_previous_state (yyscan_t yyscanner) + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { - register yy_state_type yy_current_state; - register char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1136,9 +1339,9 @@ static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 19 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1149,13 +1352,13 @@ static yy_state_type yy_get_previous_state (yyscan_t yyscanner) * synopsis * next_state = yy_try_NUL_trans( current_state ); */ -static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { - register int yy_is_jam; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - register char *yy_cp = yyg->yy_c_buf_p; + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1165,24 +1368,29 @@ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_ { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 19 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 18); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus - static int yyinput (yyscan_t yyscanner) + static int yyinput (yyscan_t yyscanner) #else - static int input (yyscan_t yyscanner) + static int input (yyscan_t yyscanner) #endif { int c; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; *yyg->yy_c_buf_p = yyg->yy_hold_char; @@ -1198,7 +1406,7 @@ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_ else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -1215,14 +1423,14 @@ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_ */ /* Reset buffer status. */ - fts0brestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( fts0bwrap(yyscanner ) ) - return EOF; + if ( yywrap( yyscanner ) ) + return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -1253,34 +1461,34 @@ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_ * @param yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ -void fts0brestart (FILE * input_file , yyscan_t yyscanner) + void yyrestart (FILE * input_file , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ - fts0bensure_buffer_stack (yyscanner); + yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - fts0b_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - fts0b_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - fts0b_load_buffer_state(yyscanner ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */ -void fts0b_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* TODO. We should be able to replace this entire function body * with - * fts0bpop_buffer_state(); - * fts0bpush_buffer_state(new_buffer); - */ - fts0bensure_buffer_stack (yyscanner); + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -1293,19 +1501,19 @@ void fts0b_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - fts0b_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); /* We don't actually know whether we did this switch during - * EOF (fts0bwrap()) processing, but the only time this flag - * is looked at is after fts0bwrap() is called, so it's safe + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yyg->yy_did_buffer_switch_on_eof = 1; } -static void fts0b_load_buffer_state (yyscan_t yyscanner) +static void yy_load_buffer_state (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; @@ -1318,37 +1526,37 @@ static void fts0b_load_buffer_state (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the allocated buffer state. */ -YY_BUFFER_STATE fts0b_create_buffer (FILE * file, int size , yyscan_t yyscanner) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) fts0balloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in fts0b_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) fts0balloc(b->yy_buf_size + 2 ,yyscanner ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in fts0b_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - fts0b_init_buffer(b,file ,yyscanner); + yy_init_buffer( b, file , yyscanner); return b; } /** Destroy the buffer. - * @param b a buffer created with fts0b_create_buffer() + * @param b a buffer created with yy_create_buffer() * @param yyscanner The scanner object. */ -void fts0b_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; @@ -1357,37 +1565,37 @@ void fts0b_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - fts0bfree((void *) b->yy_ch_buf ,yyscanner ); + yyfree( (void *) b->yy_ch_buf , yyscanner ); - fts0bfree((void *) b ,yyscanner ); + yyfree( (void *) b , yyscanner ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a fts0brestart() or at EOF. + * such as during a yyrestart() or at EOF. */ -static void fts0b_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) { int oerrno = errno; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - fts0b_flush_buffer(b ,yyscanner); + yy_flush_buffer( b , yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then fts0b_init_buffer was _probably_ - * called from fts0brestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + b->yy_is_interactive = 0; + errno = oerrno; } @@ -1395,9 +1603,9 @@ static void fts0b_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yysca * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param yyscanner The scanner object. */ -void fts0b_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; @@ -1416,7 +1624,7 @@ void fts0b_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - fts0b_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } /** Pushes the new state onto the stack. The new state becomes @@ -1425,15 +1633,15 @@ void fts0b_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) * @param new_buffer The new state. * @param yyscanner The scanner object. */ -void fts0bpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; - fts0bensure_buffer_stack(yyscanner); + yyensure_buffer_stack(yyscanner); - /* This block is copied from fts0b_switch_to_buffer. */ + /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -1447,8 +1655,8 @@ void fts0bpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) yyg->yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from fts0b_switch_to_buffer. */ - fts0b_load_buffer_state(yyscanner ); + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } @@ -1456,19 +1664,19 @@ void fts0bpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) * The next element becomes the new top. * @param yyscanner The scanner object. */ -void fts0bpop_buffer_state (yyscan_t yyscanner) +void yypop_buffer_state (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; - fts0b_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { - fts0b_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } @@ -1476,23 +1684,23 @@ void fts0bpop_buffer_state (yyscan_t yyscanner) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void fts0bensure_buffer_stack (yyscan_t yyscanner) +static void yyensure_buffer_stack (yyscan_t yyscanner) { - int num_to_alloc; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. - */ - num_to_alloc = 1; - yyg->yy_buffer_stack = (struct yy_buffer_state**)fts0balloc + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in fts0bensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -1504,15 +1712,15 @@ static void fts0bensure_buffer_stack (yyscan_t yyscanner) if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; - num_to_alloc = static_cast(yyg->yy_buffer_stack_max + grow_size); - yyg->yy_buffer_stack = (struct yy_buffer_state**)fts0brealloc + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc (yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in fts0bensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1526,76 +1734,77 @@ static void fts0bensure_buffer_stack (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE fts0b_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) fts0balloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in fts0b_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = static_cast(b->yy_buf_size); + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - fts0b_switch_to_buffer(b ,yyscanner ); + yy_switch_to_buffer( b , yyscanner ); return b; } -/** Setup the input buffer state to scan a string. The next call to fts0blex() will +/** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * @param yyscanner The scanner object. * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use - * fts0b_scan_bytes() instead. + * yy_scan_bytes() instead. */ -YY_BUFFER_STATE fts0b_scan_string (yyconst char * yystr , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) { - return fts0b_scan_bytes(yystr,static_cast(strlen(yystr)), yyscanner); + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); } -/** Setup the input buffer state to scan the given bytes. The next call to fts0blex() will +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE fts0b_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) fts0balloc(n ,yyscanner ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in fts0b_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = fts0b_scan_buffer(buf,n ,yyscanner); + b = yy_scan_buffer( buf, n , yyscanner); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in fts0b_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -1609,9 +1818,11 @@ YY_BUFFER_STATE fts0b_scan_bytes (yyconst char * yybytes, int _yybytes_len , y #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) { - (void) fprintf( stderr, "%s\n", msg ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1622,8 +1833,8 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = yyg->yy_hold_char; \ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ yyg->yy_hold_char = *yyg->yy_c_buf_p; \ @@ -1637,272 +1848,268 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ -YY_EXTRA_TYPE fts0bget_extra (yyscan_t yyscanner) +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyextra; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; } /** Get the current line number. * @param yyscanner The scanner object. */ -int fts0bget_lineno (yyscan_t yyscanner) +int yyget_lineno (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (! YY_CURRENT_BUFFER) - return 0; - - return yylineno; + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; } /** Get the current column number. * @param yyscanner The scanner object. */ -int fts0bget_column (yyscan_t yyscanner) +int yyget_column (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (! YY_CURRENT_BUFFER) - return 0; - - return yycolumn; + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; } /** Get the input stream. * @param yyscanner The scanner object. */ -FILE *fts0bget_in (yyscan_t yyscanner) +FILE *yyget_in (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyin; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; } /** Get the output stream. * @param yyscanner The scanner object. */ -FILE *fts0bget_out (yyscan_t yyscanner) +FILE *yyget_out (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyout; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; } /** Get the length of the current token. * @param yyscanner The scanner object. */ -int fts0bget_leng (yyscan_t yyscanner) +int yyget_leng (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyleng; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; } /** Get the current token. * @param yyscanner The scanner object. */ -char *fts0bget_text (yyscan_t yyscanner) +char *yyget_text (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yytext; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; } /** Set the user-defined data. This data is never touched by the scanner. * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ -void fts0bset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyextra = user_defined ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; } /** Set the current line number. - * @param line_number + * @param _line_number line number * @param yyscanner The scanner object. */ -void fts0bset_lineno (int line_number , yyscan_t yyscanner) +void yyset_lineno (int _line_number , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* lineno is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "fts0bset_lineno called with no buffer" , yyscanner); - - yylineno = line_number; + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; } /** Set the current column. - * @param line_number + * @param _column_no column number * @param yyscanner The scanner object. */ -void fts0bset_column (int column_no , yyscan_t yyscanner) +void yyset_column (int _column_no , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* column is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "fts0bset_column called with no buffer" , yyscanner); - - yycolumn = column_no; + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * @param yyscanner The scanner object. - * @see fts0b_switch_to_buffer + * @see yy_switch_to_buffer */ -void fts0bset_in (FILE * in_str , yyscan_t yyscanner) +void yyset_in (FILE * _in_str , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; } -void fts0bset_out (FILE * out_str , yyscan_t yyscanner) +void yyset_out (FILE * _out_str , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; } -int fts0bget_debug (yyscan_t yyscanner) +int yyget_debug (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yy_flex_debug; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; } -void fts0bset_debug (int bdebug , yyscan_t yyscanner) +void yyset_debug (int _bdebug , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; } /* Accessor methods for yylval and yylloc */ /* User-visible API */ -/* fts0blex_init is special because it creates the scanner itself, so it is +/* yylex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ - -int fts0blex_init(yyscan_t* ptr_yy_globals) - +int yylex_init(yyscan_t* ptr_yy_globals) { - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } - *ptr_yy_globals = (yyscan_t) fts0balloc ( sizeof( struct yyguts_t ), NULL ); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } - /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - return yy_init_globals ( *ptr_yy_globals ); + return yy_init_globals ( *ptr_yy_globals ); } -/* fts0blex_init_extra has the same functionality as fts0blex_init, but follows the +/* yylex_init_extra has the same functionality as yylex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and * is the reason, too, why this function also must handle its own declaration). - * The user defined value in the first argument will be available to fts0balloc in + * The user defined value in the first argument will be available to yyalloc in * the yyextra field. */ - -int fts0blex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) { - struct yyguts_t dummy_yyguts; + struct yyguts_t dummy_yyguts; - fts0bset_extra (yy_user_defined, &dummy_yyguts); + yyset_extra (yy_user_defined, &dummy_yyguts); - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } - *ptr_yy_globals = (yyscan_t) fts0balloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } - /* By setting to 0xAA, we expose bugs in - yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - fts0bset_extra (yy_user_defined, *ptr_yy_globals); + yyset_extra (yy_user_defined, *ptr_yy_globals); - return yy_init_globals ( *ptr_yy_globals ); + return yy_init_globals ( *ptr_yy_globals ); } static int yy_init_globals (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from fts0blex_destroy(), so don't allocate here. - */ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ - yyg->yy_buffer_stack = 0; - yyg->yy_buffer_stack_top = 0; - yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; - yyg->yy_init = 0; - yyg->yy_start = 0; + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; - yyg->yy_start_stack_ptr = 0; - yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; - /* Defined in main.c */ +/* Defined in main.c */ #ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; + yyin = stdin; + yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif - /* For future reference: Set errno on error, since we are called by - * fts0blex_init() - */ - return 0; + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; } -/* fts0blex_destroy is for both reentrant and non-reentrant scanners. */ -int fts0blex_destroy (yyscan_t yyscanner) +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Pop the buffer stack, destroying each element. */ + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - fts0b_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; - fts0bpop_buffer_state(yyscanner); + yypop_buffer_state(yyscanner); } /* Destroy the stack itself. */ - fts0bfree(yyg->yy_buffer_stack ,yyscanner); + yyfree(yyg->yy_buffer_stack , yyscanner); yyg->yy_buffer_stack = NULL; - /* Destroy the start condition stack. */ - fts0bfree(yyg->yy_start_stack ,yyscanner ); - yyg->yy_start_stack = NULL; + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * fts0blex() is called, initialization will occur. */ - yy_init_globals( yyscanner); + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); - /* Destroy the main struct (reentrant only). */ - fts0bfree ( yyscanner , yyscanner ); - yyscanner = NULL; - return 0; + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; } /* @@ -1910,18 +2117,21 @@ int fts0blex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) { - register int i; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -1929,13 +2139,18 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_A } #endif -void *fts0balloc (yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void *yyalloc (yy_size_t size , yyscan_t yyscanner) { - return (void *) malloc( size ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); } -void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -1943,15 +2158,18 @@ void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } -void fts0bfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void yyfree (void * ptr , yyscan_t yyscanner) { - free( (char *) ptr ); /* see fts0brealloc() for (char *) cast */ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 73 "fts0blex.l" + diff --git a/storage/innobase/fts/fts0tlex.cc b/storage/innobase/fts/fts0tlex.cc index d4d9b4c48d1..73c34a607ca 100644 --- a/storage/innobase/fts/fts0tlex.cc +++ b/storage/innobase/fts/fts0tlex.cc @@ -1,4 +1,3 @@ -#include "univ.i" #line 2 "fts0tlex.cc" #line 4 "fts0tlex.cc" @@ -9,12 +8,222 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define fts0t_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer fts0t_create_buffer +#endif + +#ifdef yy_delete_buffer +#define fts0t_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer fts0t_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define fts0t_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer fts0t_scan_buffer +#endif + +#ifdef yy_scan_string +#define fts0t_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string fts0t_scan_string +#endif + +#ifdef yy_scan_bytes +#define fts0t_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes fts0t_scan_bytes +#endif + +#ifdef yy_init_buffer +#define fts0t_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer fts0t_init_buffer +#endif + +#ifdef yy_flush_buffer +#define fts0t_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer fts0t_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define fts0t_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state fts0t_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define fts0t_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer fts0t_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define fts0tpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state fts0tpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define fts0tpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state fts0tpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define fts0tensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack fts0tensure_buffer_stack +#endif + +#ifdef yylex +#define fts0tlex_ALREADY_DEFINED +#else +#define yylex fts0tlex +#endif + +#ifdef yyrestart +#define fts0trestart_ALREADY_DEFINED +#else +#define yyrestart fts0trestart +#endif + +#ifdef yylex_init +#define fts0tlex_init_ALREADY_DEFINED +#else +#define yylex_init fts0tlex_init +#endif + +#ifdef yylex_init_extra +#define fts0tlex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra fts0tlex_init_extra +#endif + +#ifdef yylex_destroy +#define fts0tlex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy fts0tlex_destroy +#endif + +#ifdef yyget_debug +#define fts0tget_debug_ALREADY_DEFINED +#else +#define yyget_debug fts0tget_debug +#endif + +#ifdef yyset_debug +#define fts0tset_debug_ALREADY_DEFINED +#else +#define yyset_debug fts0tset_debug +#endif + +#ifdef yyget_extra +#define fts0tget_extra_ALREADY_DEFINED +#else +#define yyget_extra fts0tget_extra +#endif + +#ifdef yyset_extra +#define fts0tset_extra_ALREADY_DEFINED +#else +#define yyset_extra fts0tset_extra +#endif + +#ifdef yyget_in +#define fts0tget_in_ALREADY_DEFINED +#else +#define yyget_in fts0tget_in +#endif + +#ifdef yyset_in +#define fts0tset_in_ALREADY_DEFINED +#else +#define yyset_in fts0tset_in +#endif + +#ifdef yyget_out +#define fts0tget_out_ALREADY_DEFINED +#else +#define yyget_out fts0tget_out +#endif + +#ifdef yyset_out +#define fts0tset_out_ALREADY_DEFINED +#else +#define yyset_out fts0tset_out +#endif + +#ifdef yyget_leng +#define fts0tget_leng_ALREADY_DEFINED +#else +#define yyget_leng fts0tget_leng +#endif + +#ifdef yyget_text +#define fts0tget_text_ALREADY_DEFINED +#else +#define yyget_text fts0tget_text +#endif + +#ifdef yyget_lineno +#define fts0tget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno fts0tget_lineno +#endif + +#ifdef yyset_lineno +#define fts0tset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno fts0tset_lineno +#endif + +#ifdef yyget_column +#define fts0tget_column_ALREADY_DEFINED +#else +#define yyget_column fts0tget_column +#endif + +#ifdef yyset_column +#define fts0tset_column_ALREADY_DEFINED +#else +#define yyset_column fts0tset_column +#endif + +#ifdef yywrap +#define fts0twrap_ALREADY_DEFINED +#else +#define yywrap fts0twrap +#endif + +#ifdef yyalloc +#define fts0talloc_ALREADY_DEFINED +#else +#define yyalloc fts0talloc +#endif + +#ifdef yyrealloc +#define fts0trealloc_ALREADY_DEFINED +#else +#define yyrealloc fts0trealloc +#endif + +#ifdef yyfree +#define fts0tfree_ALREADY_DEFINED +#else +#define yyfree fts0tfree +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -35,7 +244,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -52,7 +261,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -85,40 +294,32 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -142,20 +343,16 @@ typedef void* yyscan_t; * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE fts0trestart(yyin ,yyscanner ) - +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -180,12 +377,18 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) - + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -199,14 +402,8 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -219,7 +416,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -264,7 +461,7 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via fts0trestart()), so that the user can continue scanning by + * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 @@ -281,84 +478,77 @@ struct yy_buffer_state #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] -void fts0trestart (FILE *input_file ,yyscan_t yyscanner ); -void fts0t_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void fts0t_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0t_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0tpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void fts0tpop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -static void fts0tensure_buffer_stack (yyscan_t yyscanner ); -static void fts0t_load_buffer_state (yyscan_t yyscanner ); -static void fts0t_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) -#define YY_FLUSH_BUFFER fts0t_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); - -void *fts0talloc (yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); -void *fts0trealloc (void *,yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); -void fts0tfree (void * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); - -#define yy_new_buffer fts0t_create_buffer +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); +#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - fts0tensure_buffer_stack (yyscanner); \ + yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - fts0t_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ - fts0tensure_buffer_stack (yyscanner); \ + yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - fts0t_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define fts0twrap(n) 1 +#define fts0twrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; +typedef flex_uint8_t YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = static_cast(yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; - #define YY_NUM_RULES 7 #define YY_END_OF_BUFFER 8 /* This struct is not used in this scanner, @@ -368,13 +558,13 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[17] = +static const flex_int16_t yy_accept[17] = { 0, 4, 4, 8, 4, 1, 6, 1, 5, 5, 2, 4, 1, 1, 0, 3, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -406,31 +596,31 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[8] = +static const YY_CHAR yy_meta[8] = { 0, 1, 2, 3, 4, 5, 5, 1 } ; -static yyconst flex_int16_t yy_base[20] = +static const flex_int16_t yy_base[20] = { 0, 0, 0, 18, 0, 6, 21, 0, 9, 21, 0, 0, 0, 0, 4, 21, 21, 10, 11, 15 } ; -static yyconst flex_int16_t yy_def[20] = +static const flex_int16_t yy_def[20] = { 0, 16, 1, 16, 17, 17, 16, 18, 19, 16, 17, 17, 5, 18, 19, 16, 0, 16, 16, 16 } ; -static yyconst flex_int16_t yy_nxt[29] = +static const flex_int16_t yy_nxt[29] = { 0, 4, 5, 6, 7, 8, 9, 10, 12, 15, 13, 11, 11, 13, 15, 13, 14, 14, 16, 14, 14, 3, 16, 16, 16, 16, 16, 16, 16 } ; -static yyconst flex_int16_t yy_chk[29] = +static const flex_int16_t yy_chk[29] = { 0, 1, 1, 1, 1, 1, 1, 1, 5, 14, 5, 17, 17, 18, 8, 18, 19, 19, 3, 19, 19, @@ -447,7 +637,7 @@ static yyconst flex_int16_t yy_chk[29] = #line 1 "fts0tlex.l" /***************************************************************************** -Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved. 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 @@ -476,8 +666,9 @@ this program; if not, write to the Free Software Foundation, Inc., /* Required for reentrant parser */ #define YY_DECL int fts_tlexer(YYSTYPE* val, yyscan_t yyscanner) +#line 670 "fts0tlex.cc" #define YY_NO_INPUT 1 -#line 480 "fts0tlex.cc" +#line 672 "fts0tlex.cc" #define INITIAL 0 @@ -527,40 +718,44 @@ struct yyguts_t }; /* end struct yyguts_t */ -static int yy_init_globals (yyscan_t yyscanner ); +static int yy_init_globals ( yyscan_t yyscanner ); -int fts0tlex_init (yyscan_t* scanner); +int yylex_init (yyscan_t* scanner); -int fts0tlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int fts0tlex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); -int fts0tget_debug (yyscan_t yyscanner ); +int yyget_debug ( yyscan_t yyscanner ); -void fts0tset_debug (int debug_flag ,yyscan_t yyscanner ); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE fts0tget_extra (yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void fts0tset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *fts0tget_in (yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -void fts0tset_in (FILE * in_str ,yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *fts0tget_out (yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -void fts0tset_out (FILE * out_str ,yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int fts0tget_leng (yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -char *fts0tget_text (yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -int fts0tget_lineno (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -void fts0tset_lineno (int line_number ,yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -568,26 +763,29 @@ void fts0tset_lineno (int line_number ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int fts0twrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int fts0twrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); +static int yyinput ( yyscan_t yyscanner ); #else -static int input (yyscan_t yyscanner ); +static int input ( yyscan_t yyscanner ); #endif #endif @@ -607,7 +805,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -619,7 +817,7 @@ static int input (yyscan_t yyscanner ); { \ int c = '*'; \ int n; \ - for ( n = 0; n < static_cast(max_size) && \ + for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ @@ -631,8 +829,7 @@ static int input (yyscan_t yyscanner ); else \ { \ errno=0; \ - while ( (result = static_cast(fread(buf, 1, max_size, yyin)))==0 \ - && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -673,9 +870,9 @@ static int input (yyscan_t yyscanner ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int fts0tlex (yyscan_t yyscanner); +extern int yylex (yyscan_t yyscanner); -#define YY_DECL int fts0tlex (yyscan_t yyscanner) +#define YY_DECL int yylex (yyscan_t yyscanner) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng @@ -687,7 +884,7 @@ extern int fts0tlex (yyscan_t yyscanner); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -697,16 +894,11 @@ extern int fts0tlex (yyscan_t yyscanner); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 44 "fts0tlex.l" - - -#line 707 "fts0tlex.cc" - if ( !yyg->yy_init ) { yyg->yy_init = 1; @@ -725,15 +917,21 @@ YY_DECL yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - fts0tensure_buffer_stack (yyscanner); + yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - fts0t_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - fts0t_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 44 "fts0tlex.l" + + +#line 933 "fts0tlex.cc" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -749,7 +947,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -759,9 +957,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 17 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 16 ); @@ -832,7 +1030,7 @@ YY_RULE_SETUP #line 68 "fts0tlex.l" ECHO; YY_BREAK -#line 834 "fts0tlex.cc" +#line 1034 "fts0tlex.cc" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -850,7 +1048,7 @@ case YY_STATE_EOF(INITIAL): /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called - * fts0tlex(). If so, then we have to assure + * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a @@ -911,7 +1109,7 @@ case YY_STATE_EOF(INITIAL): { yyg->yy_did_buffer_switch_on_eof = 0; - if ( fts0twrap(yyscanner ) ) + if ( yywrap( yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -964,7 +1162,8 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of fts0tlex */ + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -976,9 +1175,9 @@ case YY_STATE_EOF(INITIAL): static int yy_get_next_buffer (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) @@ -1007,7 +1206,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1020,21 +1219,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - int num_to_read =static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1); + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = static_cast(b->yy_buf_size * 2); + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1043,11 +1242,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - fts0trealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1055,8 +1255,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1); + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; } @@ -1065,7 +1265,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -1075,7 +1275,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - fts0trestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); } else @@ -1089,12 +1289,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) fts0trealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } yyg->yy_n_chars += number_to_move; @@ -1110,15 +1313,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1128,9 +1331,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 17 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1143,11 +1346,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { - register int yy_is_jam; + int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - register char *yy_cp = yyg->yy_c_buf_p; + char *yy_cp = yyg->yy_c_buf_p; - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1157,14 +1360,19 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 17 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 16); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) @@ -1190,7 +1398,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -1207,14 +1415,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ /* Reset buffer status. */ - fts0trestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( fts0twrap(yyscanner ) ) - return EOF; + if ( yywrap( yyscanner ) ) + return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -1245,34 +1453,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner) * @param yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ - void fts0trestart (FILE * input_file , yyscan_t yyscanner) + void yyrestart (FILE * input_file , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ - fts0tensure_buffer_stack (yyscanner); + yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - fts0t_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - fts0t_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - fts0t_load_buffer_state(yyscanner ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */ - void fts0t_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* TODO. We should be able to replace this entire function body * with - * fts0tpop_buffer_state(); - * fts0tpush_buffer_state(new_buffer); + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - fts0tensure_buffer_stack (yyscanner); + yyensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -1285,17 +1493,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - fts0t_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); /* We don't actually know whether we did this switch during - * EOF (fts0twrap()) processing, but the only time this flag - * is looked at is after fts0twrap() is called, so it's safe + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yyg->yy_did_buffer_switch_on_eof = 1; } -static void fts0t_load_buffer_state (yyscan_t yyscanner) +static void yy_load_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; @@ -1310,35 +1518,35 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the allocated buffer state. */ - YY_BUFFER_STATE fts0t_create_buffer (FILE * file, int size , yyscan_t yyscanner) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) fts0talloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in fts0t_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) fts0talloc(b->yy_buf_size + 2 ,yyscanner ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in fts0t_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - fts0t_init_buffer(b,file ,yyscanner); + yy_init_buffer( b, file , yyscanner); return b; } /** Destroy the buffer. - * @param b a buffer created with fts0t_create_buffer() + * @param b a buffer created with yy_create_buffer() * @param yyscanner The scanner object. */ - void fts0t_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -1349,28 +1557,28 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - fts0tfree((void *) b->yy_ch_buf ,yyscanner ); + yyfree( (void *) b->yy_ch_buf , yyscanner ); - fts0tfree((void *) b ,yyscanner ); + yyfree( (void *) b , yyscanner ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a fts0trestart() or at EOF. + * such as during a yyrestart() or at EOF. */ - static void fts0t_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) { int oerrno = errno; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - fts0t_flush_buffer(b ,yyscanner); + yy_flush_buffer( b , yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then fts0t_init_buffer was _probably_ - * called from fts0trestart() or through yy_get_next_buffer. + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ @@ -1379,7 +1587,7 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) } b->yy_is_interactive = 0; - + errno = oerrno; } @@ -1387,7 +1595,7 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param yyscanner The scanner object. */ - void fts0t_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) @@ -1408,7 +1616,7 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - fts0t_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } /** Pushes the new state onto the stack. The new state becomes @@ -1417,15 +1625,15 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) * @param new_buffer The new state. * @param yyscanner The scanner object. */ -void fts0tpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; - fts0tensure_buffer_stack(yyscanner); + yyensure_buffer_stack(yyscanner); - /* This block is copied from fts0t_switch_to_buffer. */ + /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -1439,8 +1647,8 @@ void fts0tpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) yyg->yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from fts0t_switch_to_buffer. */ - fts0t_load_buffer_state(yyscanner ); + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } @@ -1448,19 +1656,19 @@ void fts0tpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) * The next element becomes the new top. * @param yyscanner The scanner object. */ -void fts0tpop_buffer_state (yyscan_t yyscanner) +void yypop_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; - fts0t_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { - fts0t_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } @@ -1468,9 +1676,9 @@ void fts0tpop_buffer_state (yyscan_t yyscanner) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void fts0tensure_buffer_stack (yyscan_t yyscanner) +static void yyensure_buffer_stack (yyscan_t yyscanner) { - int num_to_alloc; + yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -1479,12 +1687,12 @@ static void fts0tensure_buffer_stack (yyscan_t yyscanner) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; - yyg->yy_buffer_stack = (struct yy_buffer_state**)fts0talloc + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in fts0tensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -1496,15 +1704,15 @@ static void fts0tensure_buffer_stack (yyscan_t yyscanner) if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; - num_to_alloc = static_cast(yyg->yy_buffer_stack_max + grow_size); - yyg->yy_buffer_stack = (struct yy_buffer_state**)fts0trealloc + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc (yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in fts0tensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1518,77 +1726,77 @@ static void fts0tensure_buffer_stack (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE fts0t_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) fts0talloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in fts0t_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = static_cast(b->yy_buf_size); + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - fts0t_switch_to_buffer(b ,yyscanner ); + yy_switch_to_buffer( b , yyscanner ); return b; } -/** Setup the input buffer state to scan a string. The next call to fts0tlex() will +/** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * @param yyscanner The scanner object. * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use - * fts0t_scan_bytes() instead. + * yy_scan_bytes() instead. */ -YY_BUFFER_STATE fts0t_scan_string (yyconst char * yystr , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) { - - return fts0t_scan_bytes(yystr,static_cast(strlen(yystr)) ,yyscanner); + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); } -/** Setup the input buffer state to scan the given bytes. The next call to fts0tlex() will +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE fts0t_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) fts0talloc(n ,yyscanner ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in fts0t_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = fts0t_scan_buffer(buf,n ,yyscanner); + b = yy_scan_buffer( buf, n , yyscanner); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in fts0t_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -1602,9 +1810,11 @@ YY_BUFFER_STATE fts0t_scan_bytes (yyconst char * yybytes, int _yybytes_len , y #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) { - (void) fprintf( stderr, "%s\n", msg ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1630,7 +1840,7 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ -YY_EXTRA_TYPE fts0tget_extra (yyscan_t yyscanner) +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyextra; @@ -1639,33 +1849,33 @@ YY_EXTRA_TYPE fts0tget_extra (yyscan_t yyscanner) /** Get the current line number. * @param yyscanner The scanner object. */ -int fts0tget_lineno (yyscan_t yyscanner) +int yyget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; - + return yylineno; } /** Get the current column number. * @param yyscanner The scanner object. */ -int fts0tget_column (yyscan_t yyscanner) +int yyget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; - + return yycolumn; } /** Get the input stream. * @param yyscanner The scanner object. */ -FILE *fts0tget_in (yyscan_t yyscanner) +FILE *yyget_in (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyin; @@ -1674,7 +1884,7 @@ FILE *fts0tget_in (yyscan_t yyscanner) /** Get the output stream. * @param yyscanner The scanner object. */ -FILE *fts0tget_out (yyscan_t yyscanner) +FILE *yyget_out (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyout; @@ -1683,7 +1893,7 @@ FILE *fts0tget_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -int fts0tget_leng (yyscan_t yyscanner) +int yyget_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -1693,7 +1903,7 @@ int fts0tget_leng (yyscan_t yyscanner) * @param yyscanner The scanner object. */ -char *fts0tget_text (yyscan_t yyscanner) +char *yyget_text (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yytext; @@ -1703,90 +1913,88 @@ char *fts0tget_text (yyscan_t yyscanner) * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ -void fts0tset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyextra = user_defined ; } /** Set the current line number. - * @param line_number + * @param _line_number line number * @param yyscanner The scanner object. */ -void fts0tset_lineno (int line_number , yyscan_t yyscanner) +void yyset_lineno (int _line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "fts0tset_lineno called with no buffer" , yyscanner); - - yylineno = line_number; + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; } /** Set the current column. - * @param line_number + * @param _column_no column number * @param yyscanner The scanner object. */ -void fts0tset_column (int column_no , yyscan_t yyscanner) +void yyset_column (int _column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "fts0tset_column called with no buffer" , yyscanner); - - yycolumn = column_no; + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * @param yyscanner The scanner object. - * @see fts0t_switch_to_buffer + * @see yy_switch_to_buffer */ -void fts0tset_in (FILE * in_str , yyscan_t yyscanner) +void yyset_in (FILE * _in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; + yyin = _in_str ; } -void fts0tset_out (FILE * out_str , yyscan_t yyscanner) +void yyset_out (FILE * _out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; + yyout = _out_str ; } -int fts0tget_debug (yyscan_t yyscanner) +int yyget_debug (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } -void fts0tset_debug (int bdebug , yyscan_t yyscanner) +void yyset_debug (int _bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } /* Accessor methods for yylval and yylloc */ /* User-visible API */ -/* fts0tlex_init is special because it creates the scanner itself, so it is +/* yylex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ - -int fts0tlex_init(yyscan_t* ptr_yy_globals) - +int yylex_init(yyscan_t* ptr_yy_globals) { if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } - *ptr_yy_globals = (yyscan_t) fts0talloc ( sizeof( struct yyguts_t ), NULL ); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; @@ -1799,27 +2007,25 @@ int fts0tlex_init(yyscan_t* ptr_yy_globals) return yy_init_globals ( *ptr_yy_globals ); } -/* fts0tlex_init_extra has the same functionality as fts0tlex_init, but follows the +/* yylex_init_extra has the same functionality as yylex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and * is the reason, too, why this function also must handle its own declaration). - * The user defined value in the first argument will be available to fts0talloc in + * The user defined value in the first argument will be available to yyalloc in * the yyextra field. */ - -int fts0tlex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) { struct yyguts_t dummy_yyguts; - fts0tset_extra (yy_user_defined, &dummy_yyguts); + yyset_extra (yy_user_defined, &dummy_yyguts); if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } - *ptr_yy_globals = (yyscan_t) fts0talloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; @@ -1830,7 +2036,7 @@ int fts0tlex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - fts0tset_extra (yy_user_defined, *ptr_yy_globals); + yyset_extra (yy_user_defined, *ptr_yy_globals); return yy_init_globals ( *ptr_yy_globals ); } @@ -1839,13 +2045,13 @@ static int yy_init_globals (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Initialization is the same as for the non-reentrant scanner. - * This function is called from fts0tlex_destroy(), so don't allocate here. + * This function is called from yylex_destroy(), so don't allocate here. */ - yyg->yy_buffer_stack = 0; + yyg->yy_buffer_stack = NULL; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; + yyg->yy_c_buf_p = NULL; yyg->yy_init = 0; yyg->yy_start = 0; @@ -1858,42 +2064,42 @@ static int yy_init_globals (yyscan_t yyscanner) yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by - * fts0tlex_init() + * yylex_init() */ return 0; } -/* fts0tlex_destroy is for both reentrant and non-reentrant scanners. */ -int fts0tlex_destroy (yyscan_t yyscanner) +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - fts0t_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; - fts0tpop_buffer_state(yyscanner); + yypop_buffer_state(yyscanner); } /* Destroy the stack itself. */ - fts0tfree(yyg->yy_buffer_stack ,yyscanner); + yyfree(yyg->yy_buffer_stack , yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ - fts0tfree(yyg->yy_start_stack ,yyscanner ); + yyfree( yyg->yy_start_stack , yyscanner ); yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time - * fts0tlex() is called, initialization will occur. */ + * yylex() is called, initialization will occur. */ yy_init_globals( yyscanner); /* Destroy the main struct (reentrant only). */ - fts0tfree ( yyscanner , yyscanner ); + yyfree ( yyscanner , yyscanner ); yyscanner = NULL; return 0; } @@ -1903,18 +2109,21 @@ int fts0tlex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) { - register int i; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -1922,13 +2131,18 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_A } #endif -void *fts0talloc (yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void *yyalloc (yy_size_t size , yyscan_t yyscanner) { - return (void *) malloc( size ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); } -void *fts0trealloc (void * ptr, yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -1936,12 +2150,14 @@ void *fts0trealloc (void * ptr, yy_size_t size , yyscan_t yyscanner * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } -void fts0tfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void yyfree (void * ptr , yyscan_t yyscanner) { - free( (char *) ptr ); /* see fts0trealloc() for (char *) cast */ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" @@ -1949,4 +2165,3 @@ void fts0tfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused) #line 68 "fts0tlex.l" - diff --git a/storage/innobase/include/fts0blex.h b/storage/innobase/include/fts0blex.h index d0e4cae0678..10dc314d5d4 100644 --- a/storage/innobase/include/fts0blex.h +++ b/storage/innobase/include/fts0blex.h @@ -12,12 +12,222 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define fts0b_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer fts0b_create_buffer +#endif + +#ifdef yy_delete_buffer +#define fts0b_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer fts0b_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define fts0b_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer fts0b_scan_buffer +#endif + +#ifdef yy_scan_string +#define fts0b_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string fts0b_scan_string +#endif + +#ifdef yy_scan_bytes +#define fts0b_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes fts0b_scan_bytes +#endif + +#ifdef yy_init_buffer +#define fts0b_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer fts0b_init_buffer +#endif + +#ifdef yy_flush_buffer +#define fts0b_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer fts0b_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define fts0b_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state fts0b_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define fts0b_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer fts0b_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define fts0bpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state fts0bpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define fts0bpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state fts0bpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define fts0bensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack fts0bensure_buffer_stack +#endif + +#ifdef yylex +#define fts0blex_ALREADY_DEFINED +#else +#define yylex fts0blex +#endif + +#ifdef yyrestart +#define fts0brestart_ALREADY_DEFINED +#else +#define yyrestart fts0brestart +#endif + +#ifdef yylex_init +#define fts0blex_init_ALREADY_DEFINED +#else +#define yylex_init fts0blex_init +#endif + +#ifdef yylex_init_extra +#define fts0blex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra fts0blex_init_extra +#endif + +#ifdef yylex_destroy +#define fts0blex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy fts0blex_destroy +#endif + +#ifdef yyget_debug +#define fts0bget_debug_ALREADY_DEFINED +#else +#define yyget_debug fts0bget_debug +#endif + +#ifdef yyset_debug +#define fts0bset_debug_ALREADY_DEFINED +#else +#define yyset_debug fts0bset_debug +#endif + +#ifdef yyget_extra +#define fts0bget_extra_ALREADY_DEFINED +#else +#define yyget_extra fts0bget_extra +#endif + +#ifdef yyset_extra +#define fts0bset_extra_ALREADY_DEFINED +#else +#define yyset_extra fts0bset_extra +#endif + +#ifdef yyget_in +#define fts0bget_in_ALREADY_DEFINED +#else +#define yyget_in fts0bget_in +#endif + +#ifdef yyset_in +#define fts0bset_in_ALREADY_DEFINED +#else +#define yyset_in fts0bset_in +#endif + +#ifdef yyget_out +#define fts0bget_out_ALREADY_DEFINED +#else +#define yyget_out fts0bget_out +#endif + +#ifdef yyset_out +#define fts0bset_out_ALREADY_DEFINED +#else +#define yyset_out fts0bset_out +#endif + +#ifdef yyget_leng +#define fts0bget_leng_ALREADY_DEFINED +#else +#define yyget_leng fts0bget_leng +#endif + +#ifdef yyget_text +#define fts0bget_text_ALREADY_DEFINED +#else +#define yyget_text fts0bget_text +#endif + +#ifdef yyget_lineno +#define fts0bget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno fts0bget_lineno +#endif + +#ifdef yyset_lineno +#define fts0bset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno fts0bset_lineno +#endif + +#ifdef yyget_column +#define fts0bget_column_ALREADY_DEFINED +#else +#define yyget_column fts0bget_column +#endif + +#ifdef yyset_column +#define fts0bset_column_ALREADY_DEFINED +#else +#define yyset_column fts0bset_column +#endif + +#ifdef yywrap +#define fts0bwrap_ALREADY_DEFINED +#else +#define yywrap fts0bwrap +#endif + +#ifdef yyalloc +#define fts0balloc_ALREADY_DEFINED +#else +#define yyalloc fts0balloc +#endif + +#ifdef yyrealloc +#define fts0brealloc_ALREADY_DEFINED +#else +#define yyrealloc fts0brealloc +#endif + +#ifdef yyfree +#define fts0bfree_ALREADY_DEFINED +#else +#define yyfree fts0bfree +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -88,29 +298,23 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* An opaque pointer. */ @@ -165,7 +369,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -193,7 +397,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -204,25 +408,25 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ -void fts0brestart (FILE *input_file ,yyscan_t yyscanner ); -void fts0b_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void fts0b_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0b_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0bpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void fts0bpop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -void *fts0balloc (yy_size_t ,yyscan_t yyscanner ); -void *fts0brealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void fts0bfree (void * ,yyscan_t yyscanner ); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); /* Begin user sect3 */ -#define fts0bwrap(n) 1 +#define fts0bwrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define yytext_ptr yytext_r @@ -244,38 +448,42 @@ void fts0bfree (void * ,yyscan_t yyscanner ); #define YY_EXTRA_TYPE void * #endif -int fts0blex_init (yyscan_t* scanner); +int yylex_init (yyscan_t* scanner); -int fts0blex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int fts0blex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); -int fts0bget_debug (yyscan_t yyscanner ); +int yyget_debug ( yyscan_t yyscanner ); -void fts0bset_debug (int debug_flag ,yyscan_t yyscanner ); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE fts0bget_extra (yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void fts0bset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *fts0bget_in (yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -void fts0bset_in (FILE * in_str ,yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *fts0bget_out (yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -void fts0bset_out (FILE * out_str ,yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int fts0bget_leng (yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -char *fts0bget_text (yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -int fts0bget_lineno (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -void fts0bset_lineno (int line_number ,yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -283,18 +491,18 @@ void fts0bset_lineno (int line_number ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int fts0bwrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int fts0bwrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT @@ -322,9 +530,9 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int fts0blex (yyscan_t yyscanner); +extern int yylex (yyscan_t yyscanner); -#define YY_DECL int fts0blex (yyscan_t yyscanner) +#define YY_DECL int yylex (yyscan_t yyscanner) #endif /* !YY_DECL */ /* yy_get_previous_state - get the state just before the EOB char was reached */ @@ -341,9 +549,154 @@ extern int fts0blex (yyscan_t yyscanner); #undef YY_DECL #endif +#ifndef fts0b_create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef fts0b_delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef fts0b_scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef fts0b_scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef fts0b_scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef fts0b_init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef fts0b_flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef fts0b_load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef fts0b_switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef fts0bpush_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef fts0bpop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef fts0bensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef fts0blex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef fts0brestart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef fts0blex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef fts0blex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef fts0blex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef fts0bget_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef fts0bset_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef fts0bget_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef fts0bset_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef fts0bget_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef fts0bset_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef fts0bget_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef fts0bset_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef fts0bget_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef fts0bget_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef fts0bget_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef fts0bset_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef fts0bget_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef fts0bset_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef fts0bwrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef fts0bget_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef fts0bset_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef fts0bget_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef fts0bset_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef fts0balloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef fts0brealloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef fts0bfree_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef fts0btext_ALREADY_DEFINED +#undef yytext +#endif +#ifndef fts0bleng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef fts0bin_ALREADY_DEFINED +#undef yyin +#endif +#ifndef fts0bout_ALREADY_DEFINED +#undef yyout +#endif +#ifndef fts0b_flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef fts0blineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef fts0btables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef fts0btables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef fts0bTABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + #line 73 "fts0blex.l" -#line 348 "../include/fts0blex.h" +#line 701 "../include/fts0blex.h" #undef fts0bIN_HEADER #endif /* fts0bHEADER_H */ diff --git a/storage/innobase/include/fts0tlex.h b/storage/innobase/include/fts0tlex.h index f91533803e8..038cbb8858d 100644 --- a/storage/innobase/include/fts0tlex.h +++ b/storage/innobase/include/fts0tlex.h @@ -12,12 +12,222 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define fts0t_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer fts0t_create_buffer +#endif + +#ifdef yy_delete_buffer +#define fts0t_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer fts0t_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define fts0t_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer fts0t_scan_buffer +#endif + +#ifdef yy_scan_string +#define fts0t_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string fts0t_scan_string +#endif + +#ifdef yy_scan_bytes +#define fts0t_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes fts0t_scan_bytes +#endif + +#ifdef yy_init_buffer +#define fts0t_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer fts0t_init_buffer +#endif + +#ifdef yy_flush_buffer +#define fts0t_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer fts0t_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define fts0t_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state fts0t_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define fts0t_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer fts0t_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define fts0tpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state fts0tpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define fts0tpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state fts0tpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define fts0tensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack fts0tensure_buffer_stack +#endif + +#ifdef yylex +#define fts0tlex_ALREADY_DEFINED +#else +#define yylex fts0tlex +#endif + +#ifdef yyrestart +#define fts0trestart_ALREADY_DEFINED +#else +#define yyrestart fts0trestart +#endif + +#ifdef yylex_init +#define fts0tlex_init_ALREADY_DEFINED +#else +#define yylex_init fts0tlex_init +#endif + +#ifdef yylex_init_extra +#define fts0tlex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra fts0tlex_init_extra +#endif + +#ifdef yylex_destroy +#define fts0tlex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy fts0tlex_destroy +#endif + +#ifdef yyget_debug +#define fts0tget_debug_ALREADY_DEFINED +#else +#define yyget_debug fts0tget_debug +#endif + +#ifdef yyset_debug +#define fts0tset_debug_ALREADY_DEFINED +#else +#define yyset_debug fts0tset_debug +#endif + +#ifdef yyget_extra +#define fts0tget_extra_ALREADY_DEFINED +#else +#define yyget_extra fts0tget_extra +#endif + +#ifdef yyset_extra +#define fts0tset_extra_ALREADY_DEFINED +#else +#define yyset_extra fts0tset_extra +#endif + +#ifdef yyget_in +#define fts0tget_in_ALREADY_DEFINED +#else +#define yyget_in fts0tget_in +#endif + +#ifdef yyset_in +#define fts0tset_in_ALREADY_DEFINED +#else +#define yyset_in fts0tset_in +#endif + +#ifdef yyget_out +#define fts0tget_out_ALREADY_DEFINED +#else +#define yyget_out fts0tget_out +#endif + +#ifdef yyset_out +#define fts0tset_out_ALREADY_DEFINED +#else +#define yyset_out fts0tset_out +#endif + +#ifdef yyget_leng +#define fts0tget_leng_ALREADY_DEFINED +#else +#define yyget_leng fts0tget_leng +#endif + +#ifdef yyget_text +#define fts0tget_text_ALREADY_DEFINED +#else +#define yyget_text fts0tget_text +#endif + +#ifdef yyget_lineno +#define fts0tget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno fts0tget_lineno +#endif + +#ifdef yyset_lineno +#define fts0tset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno fts0tset_lineno +#endif + +#ifdef yyget_column +#define fts0tget_column_ALREADY_DEFINED +#else +#define yyget_column fts0tget_column +#endif + +#ifdef yyset_column +#define fts0tset_column_ALREADY_DEFINED +#else +#define yyset_column fts0tset_column +#endif + +#ifdef yywrap +#define fts0twrap_ALREADY_DEFINED +#else +#define yywrap fts0twrap +#endif + +#ifdef yyalloc +#define fts0talloc_ALREADY_DEFINED +#else +#define yyalloc fts0talloc +#endif + +#ifdef yyrealloc +#define fts0trealloc_ALREADY_DEFINED +#else +#define yyrealloc fts0trealloc +#endif + +#ifdef yyfree +#define fts0tfree_ALREADY_DEFINED +#else +#define yyfree fts0tfree +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -88,29 +298,23 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* An opaque pointer. */ @@ -165,7 +369,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -193,7 +397,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -204,25 +408,25 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ -void fts0trestart (FILE *input_file ,yyscan_t yyscanner ); -void fts0t_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void fts0t_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0t_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0tpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void fts0tpop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -void *fts0talloc (yy_size_t ,yyscan_t yyscanner ); -void *fts0trealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void fts0tfree (void * ,yyscan_t yyscanner ); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); /* Begin user sect3 */ -#define fts0twrap(n) 1 +#define fts0twrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define yytext_ptr yytext_r @@ -244,38 +448,42 @@ void fts0tfree (void * ,yyscan_t yyscanner ); #define YY_EXTRA_TYPE void * #endif -int fts0tlex_init (yyscan_t* scanner); +int yylex_init (yyscan_t* scanner); -int fts0tlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int fts0tlex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); -int fts0tget_debug (yyscan_t yyscanner ); +int yyget_debug ( yyscan_t yyscanner ); -void fts0tset_debug (int debug_flag ,yyscan_t yyscanner ); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE fts0tget_extra (yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void fts0tset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *fts0tget_in (yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -void fts0tset_in (FILE * in_str ,yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *fts0tget_out (yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -void fts0tset_out (FILE * out_str ,yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int fts0tget_leng (yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -char *fts0tget_text (yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -int fts0tget_lineno (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -void fts0tset_lineno (int line_number ,yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -283,18 +491,18 @@ void fts0tset_lineno (int line_number ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int fts0twrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int fts0twrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT @@ -322,9 +530,9 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int fts0tlex (yyscan_t yyscanner); +extern int yylex (yyscan_t yyscanner); -#define YY_DECL int fts0tlex (yyscan_t yyscanner) +#define YY_DECL int yylex (yyscan_t yyscanner) #endif /* !YY_DECL */ /* yy_get_previous_state - get the state just before the EOB char was reached */ @@ -341,9 +549,154 @@ extern int fts0tlex (yyscan_t yyscanner); #undef YY_DECL #endif +#ifndef fts0t_create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef fts0t_delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef fts0t_scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef fts0t_scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef fts0t_scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef fts0t_init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef fts0t_flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef fts0t_load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef fts0t_switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef fts0tpush_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef fts0tpop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef fts0tensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef fts0tlex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef fts0trestart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef fts0tlex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef fts0tlex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef fts0tlex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef fts0tget_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef fts0tset_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef fts0tget_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef fts0tset_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef fts0tget_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef fts0tset_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef fts0tget_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef fts0tset_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef fts0tget_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef fts0tget_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef fts0tget_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef fts0tset_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef fts0tget_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef fts0tset_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef fts0twrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef fts0tget_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef fts0tset_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef fts0tget_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef fts0tset_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef fts0talloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef fts0trealloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef fts0tfree_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef fts0ttext_ALREADY_DEFINED +#undef yytext +#endif +#ifndef fts0tleng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef fts0tin_ALREADY_DEFINED +#undef yyin +#endif +#ifndef fts0tout_ALREADY_DEFINED +#undef yyout +#endif +#ifndef fts0t_flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef fts0tlineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef fts0ttables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef fts0ttables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef fts0tTABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + #line 68 "fts0tlex.l" -#line 348 "../include/fts0tlex.h" +#line 701 "../include/fts0tlex.h" #undef fts0tIN_HEADER #endif /* fts0tHEADER_H */ diff --git a/storage/innobase/include/pars0pars.h b/storage/innobase/include/pars0pars.h index 73585c78a6a..313380a40b4 100644 --- a/storage/innobase/include/pars0pars.h +++ b/storage/innobase/include/pars0pars.h @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 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 @@ -109,11 +110,11 @@ pars_sql( Retrieves characters to the lexical analyzer. @return number of characters copied or 0 on EOF */ UNIV_INTERN -int +size_t pars_get_lex_chars( /*===============*/ char* buf, /*!< in/out: buffer where to copy */ - int max_size); /*!< in: maximum number of characters which fit + size_t max_size); /*!< in: maximum number of characters which fit in the buffer */ /*************************************************************//** Called by yyparse on error. */ diff --git a/storage/innobase/pars/lexyy.cc b/storage/innobase/pars/lexyy.cc index bfa8e2ea950..54fe182ae6b 100644 --- a/storage/innobase/pars/lexyy.cc +++ b/storage/innobase/pars/lexyy.cc @@ -9,8 +9,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -35,7 +35,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -52,7 +52,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -85,60 +85,48 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -168,16 +156,17 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern yy_size_t yyleng; -extern FILE *yyin, *yyout; + + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) - + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -191,7 +180,6 @@ extern FILE *yyin, *yyout; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -206,12 +194,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -262,7 +250,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -273,7 +261,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -281,11 +268,11 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +static int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -294,85 +281,81 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -static YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); +static void yyrestart ( FILE *input_file ); +MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +static YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +static void yy_delete_buffer ( YY_BUFFER_STATE b ); +static void yy_flush_buffer ( YY_BUFFER_STATE b ); +MY_ATTRIBUTE((unused)) static void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +MY_ATTRIBUTE((unused)) static void yypop_buffer_state ( void ); -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +static void *yyalloc ( yy_size_t ); +static void *yyrealloc ( void *, yy_size_t ); +static void yyfree ( void * ); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define yywrap(n) 1 +#define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +static FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; -extern int yylineno; -int yylineno = 1; +static int yylineno = 1; -extern char *yytext; + +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 124 #define YY_END_OF_BUFFER 125 /* This struct is not used in this scanner, @@ -382,7 +365,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[425] = +static const flex_int16_t yy_accept[425] = { 0, 0, 0, 119, 119, 0, 0, 0, 0, 125, 123, 122, 122, 8, 123, 114, 5, 103, 109, 112, 110, @@ -433,7 +416,7 @@ static yyconst flex_int16_t yy_accept[425] = 96, 96, 62, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -465,7 +448,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[57] = +static const YY_CHAR yy_meta[57] = { 0, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 5, 1, 1, 1, 1, 6, 7, 1, 1, 1, @@ -475,7 +458,7 @@ static yyconst flex_int32_t yy_meta[57] = 9, 9, 9, 9, 1, 1 } ; -static yyconst flex_int16_t yy_base[438] = +static const flex_int16_t yy_base[438] = { 0, 0, 0, 293, 287, 284, 281, 272, 256, 254, 1357, 55, 57, 1357, 0, 1357, 1357, 1357, 1357, 1357, 1357, @@ -527,7 +510,7 @@ static yyconst flex_int16_t yy_base[438] = 1306, 1315, 1324, 1333, 1340, 1344, 1347 } ; -static yyconst flex_int16_t yy_def[438] = +static const flex_int16_t yy_def[438] = { 0, 424, 1, 425, 425, 426, 426, 427, 427, 424, 424, 424, 424, 424, 428, 424, 424, 424, 424, 424, 424, @@ -579,7 +562,7 @@ static yyconst flex_int16_t yy_def[438] = 424, 424, 424, 424, 424, 424, 424 } ; -static yyconst flex_int16_t yy_nxt[1414] = +static const flex_int16_t yy_nxt[1414] = { 0, 10, 11, 12, 13, 10, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, @@ -739,7 +722,7 @@ static yyconst flex_int16_t yy_nxt[1414] = 424, 424, 424 } ; -static yyconst flex_int16_t yy_chk[1414] = +static const flex_int16_t yy_chk[1414] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -902,8 +885,8 @@ static yyconst flex_int16_t yy_chk[1414] = static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; -extern int yy_flex_debug; -int yy_flex_debug = 0; + +static int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -912,11 +895,12 @@ int yy_flex_debug = 0; #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *yytext; +static char *yytext; #line 1 "pars0lex.l" /***************************************************************************** -Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2011, 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 @@ -951,7 +935,7 @@ Created 12/14/1997 Heikki Tuuri *******************************************************/ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 -#line 53 "pars0lex.l" +#line 54 "pars0lex.l" #define YYSTYPE que_node_t* #include "univ.i" @@ -966,9 +950,8 @@ Created 12/14/1997 Heikki Tuuri #define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error -/* Note: We cast &result to int* from yysize_t* */ #define YY_INPUT(buf, result, max_size) \ - (result = pars_get_lex_chars(buf, max_size)) + result = pars_get_lex_chars(buf, max_size) /* String buffer for removing quotes */ static ulint stringbuf_len_alloc = 0; /* Allocated length */ @@ -1000,10 +983,9 @@ string_append( stringbuf_len += len; } +#line 986 "lexyy.cc" - - -#line 1006 "lexyy.cc" +#line 988 "lexyy.cc" #define INITIAL 0 #define comment 1 @@ -1022,36 +1004,36 @@ string_append( #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -MY_ATTRIBUTE((unused)) static int yylex_destroy (void ); +MY_ATTRIBUTE((unused)) static int yylex_destroy ( void ); -int yyget_debug (void ); +MY_ATTRIBUTE((unused)) static int yyget_debug ( void ); -void yyset_debug (int debug_flag ); +MY_ATTRIBUTE((unused)) static void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE yyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void yyset_extra (YY_EXTRA_TYPE user_defined ); +MY_ATTRIBUTE((unused)) static void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *yyget_in (void ); +MY_ATTRIBUTE((unused)) static FILE *yyget_in ( void ); -void yyset_in (FILE * in_str ); +MY_ATTRIBUTE((unused)) static void yyset_in ( FILE * _in_str ); -FILE *yyget_out (void ); +MY_ATTRIBUTE((unused)) static FILE *yyget_out ( void ); -void yyset_out (FILE * out_str ); +MY_ATTRIBUTE((unused)) static void yyset_out ( FILE * _out_str ); -yy_size_t yyget_leng (void ); + MY_ATTRIBUTE((unused)) static int yyget_leng ( void ); -char *yyget_text (void ); +MY_ATTRIBUTE((unused)) static char *yyget_text ( void ); -int yyget_lineno (void ); +MY_ATTRIBUTE((unused)) static int yyget_lineno ( void ); -void yyset_lineno (int line_number ); +MY_ATTRIBUTE((unused)) static void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1059,26 +1041,29 @@ void yyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap ( void ); #else -extern int yywrap (void ); +extern int yywrap ( void ); #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif @@ -1098,7 +1083,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1109,7 +1094,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1122,7 +1107,7 @@ static int input (void ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -1177,7 +1162,7 @@ extern int yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -1187,15 +1172,10 @@ extern int yylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 112 "pars0lex.l" - - -#line 1197 "lexyy.cc" - + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + if ( !(yy_init) ) { (yy_init) = 1; @@ -1216,13 +1196,19 @@ YY_DECL if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_load_buffer_state( ); + yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 112 "pars0lex.l" + + +#line 1209 "lexyy.cc" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -1238,7 +1224,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1248,9 +1234,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 425 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 424 ); @@ -2234,7 +2220,7 @@ YY_RULE_SETUP #line 691 "pars0lex.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2237 "lexyy.cc" +#line 2223 "lexyy.cc" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(comment): case YY_STATE_EOF(quoted): @@ -2316,7 +2302,7 @@ case YY_STATE_EOF(id): { (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -2369,6 +2355,7 @@ case YY_STATE_EOF(id): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -2380,9 +2367,9 @@ case YY_STATE_EOF(id): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -2411,7 +2398,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -2424,21 +2411,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1); + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = static_cast(b->yy_buf_size * 2); + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2447,11 +2434,12 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -2459,9 +2447,8 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1); + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; } @@ -2470,7 +2457,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -2480,7 +2467,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart( yyin ); } else @@ -2494,12 +2481,15 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -2513,16 +2503,16 @@ static int yy_get_next_buffer (void) /* yy_get_previous_state - get the state just before the EOB char was reached */ - yy_state_type yy_get_previous_state (void) + static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; - + yy_state_type yy_current_state; + char *yy_cp; + yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2532,9 +2522,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 425 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -2545,12 +2535,12 @@ static int yy_get_next_buffer (void) * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2560,14 +2550,18 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 425 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 424); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -2577,7 +2571,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -2592,7 +2586,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (int)((yy_c_buf_p) - (yytext_ptr)); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2609,14 +2603,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - yyrestart(yyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -2644,29 +2638,29 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ - void yyrestart (FILE * input_file ) + static void yyrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); @@ -2685,7 +2679,7 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -2706,14 +2700,14 @@ static void yy_load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ static YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2722,24 +2716,24 @@ static void yy_load_buffer_state (void) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ - void yy_delete_buffer (YY_BUFFER_STATE b ) + static void yy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -2747,21 +2741,21 @@ static void yy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - yyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; - - yy_flush_buffer(b ); + + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -2776,15 +2770,15 @@ static void yy_load_buffer_state (void) } b->yy_is_interactive = 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ - void yy_flush_buffer (YY_BUFFER_STATE b ) + static void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; @@ -2804,16 +2798,16 @@ static void yy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +MY_ATTRIBUTE((unused)) static void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; @@ -2835,15 +2829,15 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ -void yypop_buffer_state (void) +MY_ATTRIBUTE((unused)) static void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; @@ -2854,7 +2848,7 @@ void yypop_buffer_state (void) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -2864,15 +2858,15 @@ void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { - int num_to_alloc; - + yy_size_t num_to_alloc; + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -2889,10 +2883,9 @@ static void yyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; - num_to_alloc = static_cast( - (yy_buffer_stack_max) + grow_size); + num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) @@ -2910,9 +2903,9 @@ static void yyensure_buffer_stack (void) #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2936,81 +2929,81 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ -int yyget_lineno (void) +MY_ATTRIBUTE((unused)) static int yyget_lineno (void) { - + return yylineno; } /** Get the input stream. - * + * */ -FILE *yyget_in (void) +MY_ATTRIBUTE((unused)) static FILE *yyget_in (void) { return yyin; } /** Get the output stream. - * + * */ -FILE *yyget_out (void) +MY_ATTRIBUTE((unused)) static FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. - * + * */ -yy_size_t yyget_leng (void) +MY_ATTRIBUTE((unused)) static int yyget_leng (void) { return yyleng; } /** Get the current token. - * + * */ -char *yyget_text (void) +MY_ATTRIBUTE((unused)) static char *yyget_text (void) { return yytext; } /** Set the current line number. - * @param line_number - * + * @param _line_number line number + * */ -void yyset_lineno (int line_number ) +MY_ATTRIBUTE((unused)) static void yyset_lineno (int _line_number ) { - - yylineno = line_number; + + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. - * + * @param _in_str A readable stream. + * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +MY_ATTRIBUTE((unused)) static void yyset_in (FILE * _in_str ) { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +MY_ATTRIBUTE((unused)) static void yyset_out (FILE * _out_str ) { - yyout = out_str ; + yyout = _out_str ; } -int yyget_debug (void) +MY_ATTRIBUTE((unused)) static int yyget_debug (void) { return yy_flex_debug; } -void yyset_debug (int bdebug ) +MY_ATTRIBUTE((unused)) static void yyset_debug (int _bdebug ) { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -3019,10 +3012,10 @@ static int yy_init_globals (void) * This function is called from yylex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; @@ -3031,8 +3024,8 @@ static int yy_init_globals (void) yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -3044,10 +3037,10 @@ static int yy_init_globals (void) /* yylex_destroy is for both reentrant and non-reentrant scanners. */ MY_ATTRIBUTE((unused)) static int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } @@ -3068,18 +3061,19 @@ MY_ATTRIBUTE((unused)) static int yylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -3087,13 +3081,14 @@ static int yy_flex_strlen (yyconst char * s ) } #endif -void *yyalloc (yy_size_t size ) +static void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } -void *yyrealloc (void * ptr, yy_size_t size ) +static void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3101,12 +3096,12 @@ void *yyrealloc (void * ptr, yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } -void yyfree (void * ptr ) +static void yyfree (void * ptr ) { - free( (char*) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" @@ -3114,7 +3109,6 @@ void yyfree (void * ptr ) #line 691 "pars0lex.l" - /********************************************************************** Release any resources used by the lexer. */ UNIV_INTERN diff --git a/storage/innobase/pars/make_flex.sh b/storage/innobase/pars/make_flex.sh index c3db8aea298..2ddb1460640 100755 --- a/storage/innobase/pars/make_flex.sh +++ b/storage/innobase/pars/make_flex.sh @@ -1,6 +1,7 @@ #!/bin/bash # # Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 2017, 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 @@ -31,6 +32,7 @@ echo '#include "univ.i"' > $OUTFILE # a warning on Win64. Add the cast. Also define some symbols as static. sed -e ' s/'"$TMPFILE"'/'"$OUTFILE"'/; +s/^void yyset_extra *(YY_EXTRA_TYPE *user_defined *);// s/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/; s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/; s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) static \1/; @@ -38,11 +40,12 @@ s/\(void yy\(push\|pop\)_buffer_state\)/MY_ATTRIBUTE((unused)) static \1/; s/\(YY_BUFFER_STATE yy_create_buffer\)/static \1/; s/\(\(int\|void\) yy[gs]et_\)/MY_ATTRIBUTE((unused)) static \1/; s/\(void \*\?yy\(\(re\)\?alloc\|free\)\)/static \1/; -s/\(extern \)\?\(int yy\(leng\|lineno\|_flex_debug\)\)/static \2/; +s/extern int yy\(leng\|_flex_debug\|lineno\);//; +s/\(int yy\(leng\|lineno\|_flex_debug\)\)/static \1/; s/\(int yylex_destroy\)/MY_ATTRIBUTE((unused)) static \1/; -s/\(extern \)\?\(int yylex \)/UNIV_INTERN \2/; s/^\(\(FILE\|char\) *\* *yyget\)/MY_ATTRIBUTE((unused)) static \1/; -s/^\(extern \)\?\(\(FILE\|char\) *\* *yy\)/static \2/; +s/^extern \(\(FILE\|char\) *\* *yy\).*//; +s/^\(FILE\|char\) *\* *yy/static &/; ' < $TMPFILE >> $OUTFILE rm $TMPFILE diff --git a/storage/innobase/pars/pars0lex.l b/storage/innobase/pars/pars0lex.l index 83c3af4b6c5..60756413c0a 100644 --- a/storage/innobase/pars/pars0lex.l +++ b/storage/innobase/pars/pars0lex.l @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1997, 2011, 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 @@ -64,9 +65,8 @@ Created 12/14/1997 Heikki Tuuri #define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error -/* Note: We cast &result to int* from yysize_t* */ #define YY_INPUT(buf, result, max_size) \ - pars_get_lex_chars(buf, (int*) &result, max_size) + result = pars_get_lex_chars(buf, max_size) /* String buffer for removing quotes */ static ulint stringbuf_len_alloc = 0; /* Allocated length */ diff --git a/storage/innobase/pars/pars0pars.cc b/storage/innobase/pars/pars0pars.cc index ce61d6e1e3b..24bbeb1d36d 100644 --- a/storage/innobase/pars/pars0pars.cc +++ b/storage/innobase/pars/pars0pars.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 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 @@ -2153,16 +2154,14 @@ pars_stored_procedure_call( /*************************************************************//** Retrieves characters to the lexical analyzer. */ UNIV_INTERN -int +size_t pars_get_lex_chars( /*===============*/ char* buf, /*!< in/out: buffer where to copy */ - int max_size) /*!< in: maximum number of characters which fit + size_t max_size) /*!< in: maximum number of characters which fit in the buffer */ { - int len; - - len = static_cast( + size_t len = size_t( pars_sym_tab_global->string_len - pars_sym_tab_global->next_char_pos); if (len == 0) { diff --git a/storage/xtradb/fts/fts0blex.cc b/storage/xtradb/fts/fts0blex.cc index a8f231268ac..84811050e88 100644 --- a/storage/xtradb/fts/fts0blex.cc +++ b/storage/xtradb/fts/fts0blex.cc @@ -1,4 +1,3 @@ -#include "univ.i" #line 2 "fts0blex.cc" #line 4 "fts0blex.cc" @@ -9,12 +8,222 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define fts0b_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer fts0b_create_buffer +#endif + +#ifdef yy_delete_buffer +#define fts0b_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer fts0b_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define fts0b_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer fts0b_scan_buffer +#endif + +#ifdef yy_scan_string +#define fts0b_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string fts0b_scan_string +#endif + +#ifdef yy_scan_bytes +#define fts0b_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes fts0b_scan_bytes +#endif + +#ifdef yy_init_buffer +#define fts0b_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer fts0b_init_buffer +#endif + +#ifdef yy_flush_buffer +#define fts0b_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer fts0b_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define fts0b_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state fts0b_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define fts0b_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer fts0b_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define fts0bpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state fts0bpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define fts0bpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state fts0bpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define fts0bensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack fts0bensure_buffer_stack +#endif + +#ifdef yylex +#define fts0blex_ALREADY_DEFINED +#else +#define yylex fts0blex +#endif + +#ifdef yyrestart +#define fts0brestart_ALREADY_DEFINED +#else +#define yyrestart fts0brestart +#endif + +#ifdef yylex_init +#define fts0blex_init_ALREADY_DEFINED +#else +#define yylex_init fts0blex_init +#endif + +#ifdef yylex_init_extra +#define fts0blex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra fts0blex_init_extra +#endif + +#ifdef yylex_destroy +#define fts0blex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy fts0blex_destroy +#endif + +#ifdef yyget_debug +#define fts0bget_debug_ALREADY_DEFINED +#else +#define yyget_debug fts0bget_debug +#endif + +#ifdef yyset_debug +#define fts0bset_debug_ALREADY_DEFINED +#else +#define yyset_debug fts0bset_debug +#endif + +#ifdef yyget_extra +#define fts0bget_extra_ALREADY_DEFINED +#else +#define yyget_extra fts0bget_extra +#endif + +#ifdef yyset_extra +#define fts0bset_extra_ALREADY_DEFINED +#else +#define yyset_extra fts0bset_extra +#endif + +#ifdef yyget_in +#define fts0bget_in_ALREADY_DEFINED +#else +#define yyget_in fts0bget_in +#endif + +#ifdef yyset_in +#define fts0bset_in_ALREADY_DEFINED +#else +#define yyset_in fts0bset_in +#endif + +#ifdef yyget_out +#define fts0bget_out_ALREADY_DEFINED +#else +#define yyget_out fts0bget_out +#endif + +#ifdef yyset_out +#define fts0bset_out_ALREADY_DEFINED +#else +#define yyset_out fts0bset_out +#endif + +#ifdef yyget_leng +#define fts0bget_leng_ALREADY_DEFINED +#else +#define yyget_leng fts0bget_leng +#endif + +#ifdef yyget_text +#define fts0bget_text_ALREADY_DEFINED +#else +#define yyget_text fts0bget_text +#endif + +#ifdef yyget_lineno +#define fts0bget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno fts0bget_lineno +#endif + +#ifdef yyset_lineno +#define fts0bset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno fts0bset_lineno +#endif + +#ifdef yyget_column +#define fts0bget_column_ALREADY_DEFINED +#else +#define yyget_column fts0bget_column +#endif + +#ifdef yyset_column +#define fts0bset_column_ALREADY_DEFINED +#else +#define yyset_column fts0bset_column +#endif + +#ifdef yywrap +#define fts0bwrap_ALREADY_DEFINED +#else +#define yywrap fts0bwrap +#endif + +#ifdef yyalloc +#define fts0balloc_ALREADY_DEFINED +#else +#define yyalloc fts0balloc +#endif + +#ifdef yyrealloc +#define fts0brealloc_ALREADY_DEFINED +#else +#define yyrealloc fts0brealloc +#endif + +#ifdef yyfree +#define fts0bfree_ALREADY_DEFINED +#else +#define yyfree fts0bfree +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -35,7 +244,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -52,7 +261,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -85,40 +294,32 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -142,20 +343,16 @@ typedef void* yyscan_t; * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE fts0brestart(yyin ,yyscanner ) - +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -180,33 +377,33 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - -#define YY_LESS_LINENO(n) - + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = yyg->yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -219,7 +416,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -245,8 +442,8 @@ struct yy_buffer_state */ int yy_at_bol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. @@ -264,7 +461,7 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via fts0brestart()), so that the user can continue scanning by + * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 @@ -281,84 +478,77 @@ struct yy_buffer_state #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] -void fts0brestart (FILE *input_file ,yyscan_t yyscanner ); -void fts0b_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void fts0b_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0b_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0bpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void fts0bpop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -static void fts0bensure_buffer_stack (yyscan_t yyscanner ); -static void fts0b_load_buffer_state (yyscan_t yyscanner ); -static void fts0b_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) -#define YY_FLUSH_BUFFER fts0b_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); - -void *fts0balloc (yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); -void *fts0brealloc (void *,yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); -void fts0bfree (void * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); - -#define yy_new_buffer fts0b_create_buffer +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); +#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - fts0bensure_buffer_stack (yyscanner); \ + yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - fts0b_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ - fts0bensure_buffer_stack (yyscanner); \ + yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - fts0b_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define fts0bwrap(n) 1 +#define fts0bwrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; +typedef flex_uint8_t YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = static_cast(yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; - #define YY_NUM_RULES 7 #define YY_END_OF_BUFFER 8 /* This struct is not used in this scanner, @@ -368,13 +558,13 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[19] = +static const flex_int16_t yy_accept[19] = { 0, 4, 4, 8, 4, 1, 6, 1, 7, 7, 2, 3, 4, 1, 1, 0, 5, 3, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -406,26 +596,26 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[9] = +static const YY_CHAR yy_meta[9] = { 0, 1, 2, 3, 4, 5, 5, 5, 1 } ; -static yyconst flex_int16_t yy_base[22] = +static const flex_int16_t yy_base[22] = { 0, 0, 0, 22, 0, 7, 23, 0, 14, 23, 23, 7, 0, 0, 0, 5, 23, 0, 23, 11, 12, 16 } ; -static yyconst flex_int16_t yy_def[22] = +static const flex_int16_t yy_def[22] = { 0, 18, 1, 18, 19, 19, 18, 20, 21, 18, 18, 19, 19, 5, 20, 21, 18, 11, 0, 18, 18, 18 } ; -static yyconst flex_int16_t yy_nxt[32] = +static const flex_int16_t yy_nxt[32] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 13, 16, 14, 12, 12, 14, 17, 14, 15, 15, 16, 15, @@ -433,7 +623,7 @@ static yyconst flex_int16_t yy_nxt[32] = 18 } ; -static yyconst flex_int16_t yy_chk[32] = +static const flex_int16_t yy_chk[32] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 15, 5, 19, 19, 20, 11, 20, 21, 21, 8, 21, @@ -451,7 +641,7 @@ static yyconst flex_int16_t yy_chk[32] = #line 1 "fts0blex.l" /***************************************************************************** -Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved. 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 @@ -480,8 +670,9 @@ this program; if not, write to the Free Software Foundation, Inc., /* Required for reentrant parser */ #define YY_DECL int fts_blexer(YYSTYPE* val, yyscan_t yyscanner) +#line 674 "fts0blex.cc" #define YY_NO_INPUT 1 -#line 484 "fts0blex.cc" +#line 676 "fts0blex.cc" #define INITIAL 0 @@ -499,72 +690,76 @@ this program; if not, write to the Free Software Foundation, Inc., /* Holds the entire state of the reentrant scanner. */ struct yyguts_t -{ + { - /* User-defined. Not touched by flex. */ - YY_EXTRA_TYPE yyextra_r; + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; - /* The rest are the same as the globals declared in the non-reentrant scanner. */ - FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ - char yy_hold_char; - int yy_n_chars; - int yyleng_r; - char *yy_c_buf_p; - int yy_init; - int yy_start; - int yy_did_buffer_switch_on_eof; - int yy_start_stack_ptr; - int yy_start_stack_depth; - int *yy_start_stack; - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; - int yylineno_r; - int yy_flex_debug_r; + int yylineno_r; + int yy_flex_debug_r; - char *yytext_r; - int yy_more_flag; - int yy_more_len; + char *yytext_r; + int yy_more_flag; + int yy_more_len; -}; /* end struct yyguts_t */ + }; /* end struct yyguts_t */ -static int yy_init_globals (yyscan_t yyscanner ); +static int yy_init_globals ( yyscan_t yyscanner ); -int fts0blex_init (yyscan_t* scanner); +int yylex_init (yyscan_t* scanner); -int fts0blex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int fts0blex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); -int fts0bget_debug (yyscan_t yyscanner ); +int yyget_debug ( yyscan_t yyscanner ); -void fts0bset_debug (int debug_flag ,yyscan_t yyscanner ); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE fts0bget_extra (yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void fts0bset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *fts0bget_in (yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -void fts0bset_in (FILE * in_str ,yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *fts0bget_out (yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -void fts0bset_out (FILE * out_str ,yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int fts0bget_leng (yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -char *fts0bget_text (yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -int fts0bget_lineno (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -void fts0bset_lineno (int line_number ,yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -572,26 +767,29 @@ void fts0bset_lineno (int line_number ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int fts0bwrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int fts0bwrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); +static int yyinput ( yyscan_t yyscanner ); #else -static int input (yyscan_t yyscanner ); +static int input ( yyscan_t yyscanner ); #endif #endif @@ -611,7 +809,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -623,7 +821,7 @@ static int input (yyscan_t yyscanner ); { \ int c = '*'; \ int n; \ - for ( n = 0; n < static_cast(max_size) && \ + for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ @@ -635,8 +833,7 @@ static int input (yyscan_t yyscanner ); else \ { \ errno=0; \ - while ( (result = static_cast(fread(buf, 1, max_size, yyin))) \ - == 0 && ferror(yyin) ) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -677,9 +874,9 @@ static int input (yyscan_t yyscanner ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int fts0blex (yyscan_t yyscanner); +extern int yylex (yyscan_t yyscanner); -#define YY_DECL int fts0blex (yyscan_t yyscanner) +#define YY_DECL int yylex (yyscan_t yyscanner) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng @@ -691,7 +888,7 @@ extern int fts0blex (yyscan_t yyscanner); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -704,12 +901,7 @@ YY_DECL yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - -#line 43 "fts0blex.l" - - -#line 712 "fts0blex.cc" + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( !yyg->yy_init ) { @@ -729,15 +921,21 @@ YY_DECL yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - fts0bensure_buffer_stack (yyscanner); + yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - fts0b_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - fts0b_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 43 "fts0blex.l" + + +#line 937 "fts0blex.cc" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -753,7 +951,7 @@ YY_DECL yy_match: do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -763,9 +961,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 19 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 18 ); @@ -840,7 +1038,7 @@ YY_RULE_SETUP #line 73 "fts0blex.l" ECHO; YY_BREAK -#line 843 "fts0blex.cc" +#line 1042 "fts0blex.cc" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -858,7 +1056,7 @@ case YY_STATE_EOF(INITIAL): /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called - * fts0blex(). If so, then we have to assure + * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a @@ -919,7 +1117,7 @@ case YY_STATE_EOF(INITIAL): { yyg->yy_did_buffer_switch_on_eof = 0; - if ( fts0bwrap(yyscanner ) ) + if ( yywrap( yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -972,7 +1170,8 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of fts0blex */ + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -983,7 +1182,7 @@ case YY_STATE_EOF(INITIAL): */ static int yy_get_next_buffer (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = yyg->yytext_ptr; int number_to_move, i; @@ -1015,7 +1214,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1028,21 +1227,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - int num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1); + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = static_cast(b->yy_buf_size * 2); + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1051,11 +1250,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - fts0brealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1063,8 +1263,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1); + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; } @@ -1073,7 +1273,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -1083,7 +1283,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - fts0brestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); } else @@ -1097,12 +1297,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) fts0brealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } yyg->yy_n_chars += number_to_move; @@ -1116,11 +1319,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* yy_get_previous_state - get the state just before the EOB char was reached */ -static yy_state_type yy_get_previous_state (yyscan_t yyscanner) + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { yy_state_type yy_current_state; char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; @@ -1136,9 +1339,9 @@ static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 19 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1149,10 +1352,10 @@ static yy_state_type yy_get_previous_state (yyscan_t yyscanner) * synopsis * next_state = yy_try_NUL_trans( current_state ); */ -static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { int yy_is_jam; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ char *yy_cp = yyg->yy_c_buf_p; YY_CHAR yy_c = 1; @@ -1165,24 +1368,29 @@ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_ { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 19 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 18); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus - static int yyinput (yyscan_t yyscanner) + static int yyinput (yyscan_t yyscanner) #else - static int input (yyscan_t yyscanner) + static int input (yyscan_t yyscanner) #endif { int c; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; *yyg->yy_c_buf_p = yyg->yy_hold_char; @@ -1198,7 +1406,7 @@ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_ else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -1215,14 +1423,14 @@ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_ */ /* Reset buffer status. */ - fts0brestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( fts0bwrap(yyscanner ) ) - return EOF; + if ( yywrap( yyscanner ) ) + return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -1253,34 +1461,34 @@ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_ * @param yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ -void fts0brestart (FILE * input_file , yyscan_t yyscanner) + void yyrestart (FILE * input_file , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ - fts0bensure_buffer_stack (yyscanner); + yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - fts0b_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - fts0b_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - fts0b_load_buffer_state(yyscanner ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */ -void fts0b_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* TODO. We should be able to replace this entire function body * with - * fts0bpop_buffer_state(); - * fts0bpush_buffer_state(new_buffer); - */ - fts0bensure_buffer_stack (yyscanner); + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -1293,19 +1501,19 @@ void fts0b_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - fts0b_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); /* We don't actually know whether we did this switch during - * EOF (fts0bwrap()) processing, but the only time this flag - * is looked at is after fts0bwrap() is called, so it's safe + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yyg->yy_did_buffer_switch_on_eof = 1; } -static void fts0b_load_buffer_state (yyscan_t yyscanner) +static void yy_load_buffer_state (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; @@ -1318,37 +1526,37 @@ static void fts0b_load_buffer_state (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the allocated buffer state. */ -YY_BUFFER_STATE fts0b_create_buffer (FILE * file, int size , yyscan_t yyscanner) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) fts0balloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in fts0b_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) fts0balloc(b->yy_buf_size + 2 ,yyscanner ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in fts0b_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - fts0b_init_buffer(b,file ,yyscanner); + yy_init_buffer( b, file , yyscanner); return b; } /** Destroy the buffer. - * @param b a buffer created with fts0b_create_buffer() + * @param b a buffer created with yy_create_buffer() * @param yyscanner The scanner object. */ -void fts0b_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; @@ -1357,37 +1565,37 @@ void fts0b_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - fts0bfree((void *) b->yy_ch_buf ,yyscanner ); + yyfree( (void *) b->yy_ch_buf , yyscanner ); - fts0bfree((void *) b ,yyscanner ); + yyfree( (void *) b , yyscanner ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a fts0brestart() or at EOF. + * such as during a yyrestart() or at EOF. */ -static void fts0b_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) { int oerrno = errno; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - fts0b_flush_buffer(b ,yyscanner); + yy_flush_buffer( b , yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then fts0b_init_buffer was _probably_ - * called from fts0brestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + b->yy_is_interactive = 0; + errno = oerrno; } @@ -1395,9 +1603,9 @@ static void fts0b_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yysca * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param yyscanner The scanner object. */ -void fts0b_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; @@ -1416,7 +1624,7 @@ void fts0b_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - fts0b_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } /** Pushes the new state onto the stack. The new state becomes @@ -1425,15 +1633,15 @@ void fts0b_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) * @param new_buffer The new state. * @param yyscanner The scanner object. */ -void fts0bpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; - fts0bensure_buffer_stack(yyscanner); + yyensure_buffer_stack(yyscanner); - /* This block is copied from fts0b_switch_to_buffer. */ + /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -1447,8 +1655,8 @@ void fts0bpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) yyg->yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from fts0b_switch_to_buffer. */ - fts0b_load_buffer_state(yyscanner ); + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } @@ -1456,19 +1664,19 @@ void fts0bpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) * The next element becomes the new top. * @param yyscanner The scanner object. */ -void fts0bpop_buffer_state (yyscan_t yyscanner) +void yypop_buffer_state (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; - fts0b_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { - fts0b_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } @@ -1476,23 +1684,23 @@ void fts0bpop_buffer_state (yyscan_t yyscanner) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void fts0bensure_buffer_stack (yyscan_t yyscanner) +static void yyensure_buffer_stack (yyscan_t yyscanner) { - int num_to_alloc; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. - */ - num_to_alloc = 1; - yyg->yy_buffer_stack = (struct yy_buffer_state**)fts0balloc + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in fts0bensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -1504,15 +1712,15 @@ static void fts0bensure_buffer_stack (yyscan_t yyscanner) if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; - num_to_alloc = static_cast(yyg->yy_buffer_stack_max + grow_size); - yyg->yy_buffer_stack = (struct yy_buffer_state**)fts0brealloc + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc (yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in fts0bensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1526,76 +1734,77 @@ static void fts0bensure_buffer_stack (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE fts0b_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) fts0balloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in fts0b_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = static_cast(b->yy_buf_size); + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - fts0b_switch_to_buffer(b ,yyscanner ); + yy_switch_to_buffer( b , yyscanner ); return b; } -/** Setup the input buffer state to scan a string. The next call to fts0blex() will +/** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * @param yyscanner The scanner object. * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use - * fts0b_scan_bytes() instead. + * yy_scan_bytes() instead. */ -YY_BUFFER_STATE fts0b_scan_string (yyconst char * yystr , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) { - return fts0b_scan_bytes(yystr,static_cast(strlen(yystr)), yyscanner); + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); } -/** Setup the input buffer state to scan the given bytes. The next call to fts0blex() will +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE fts0b_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) fts0balloc(n ,yyscanner ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in fts0b_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = fts0b_scan_buffer(buf,n ,yyscanner); + b = yy_scan_buffer( buf, n , yyscanner); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in fts0b_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -1609,9 +1818,11 @@ YY_BUFFER_STATE fts0b_scan_bytes (yyconst char * yybytes, int _yybytes_len , y #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) { - (void) fprintf( stderr, "%s\n", msg ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1622,8 +1833,8 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = yyg->yy_hold_char; \ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ yyg->yy_hold_char = *yyg->yy_c_buf_p; \ @@ -1637,272 +1848,268 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ -YY_EXTRA_TYPE fts0bget_extra (yyscan_t yyscanner) +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyextra; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; } /** Get the current line number. * @param yyscanner The scanner object. */ -int fts0bget_lineno (yyscan_t yyscanner) +int yyget_lineno (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (! YY_CURRENT_BUFFER) - return 0; - - return yylineno; + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; } /** Get the current column number. * @param yyscanner The scanner object. */ -int fts0bget_column (yyscan_t yyscanner) +int yyget_column (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (! YY_CURRENT_BUFFER) - return 0; - - return yycolumn; + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; } /** Get the input stream. * @param yyscanner The scanner object. */ -FILE *fts0bget_in (yyscan_t yyscanner) +FILE *yyget_in (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyin; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; } /** Get the output stream. * @param yyscanner The scanner object. */ -FILE *fts0bget_out (yyscan_t yyscanner) +FILE *yyget_out (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyout; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; } /** Get the length of the current token. * @param yyscanner The scanner object. */ -int fts0bget_leng (yyscan_t yyscanner) +int yyget_leng (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyleng; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; } /** Get the current token. * @param yyscanner The scanner object. */ -char *fts0bget_text (yyscan_t yyscanner) +char *yyget_text (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yytext; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; } /** Set the user-defined data. This data is never touched by the scanner. * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ -void fts0bset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyextra = user_defined ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; } /** Set the current line number. - * @param line_number + * @param _line_number line number * @param yyscanner The scanner object. */ -void fts0bset_lineno (int line_number , yyscan_t yyscanner) +void yyset_lineno (int _line_number , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* lineno is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "fts0bset_lineno called with no buffer" , yyscanner); - - yylineno = line_number; + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; } /** Set the current column. - * @param line_number + * @param _column_no column number * @param yyscanner The scanner object. */ -void fts0bset_column (int column_no , yyscan_t yyscanner) +void yyset_column (int _column_no , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* column is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "fts0bset_column called with no buffer" , yyscanner); - - yycolumn = column_no; + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * @param yyscanner The scanner object. - * @see fts0b_switch_to_buffer + * @see yy_switch_to_buffer */ -void fts0bset_in (FILE * in_str , yyscan_t yyscanner) +void yyset_in (FILE * _in_str , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; } -void fts0bset_out (FILE * out_str , yyscan_t yyscanner) +void yyset_out (FILE * _out_str , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; } -int fts0bget_debug (yyscan_t yyscanner) +int yyget_debug (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yy_flex_debug; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; } -void fts0bset_debug (int bdebug , yyscan_t yyscanner) +void yyset_debug (int _bdebug , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; } /* Accessor methods for yylval and yylloc */ /* User-visible API */ -/* fts0blex_init is special because it creates the scanner itself, so it is +/* yylex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ - -int fts0blex_init(yyscan_t* ptr_yy_globals) - +int yylex_init(yyscan_t* ptr_yy_globals) { - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } - *ptr_yy_globals = (yyscan_t) fts0balloc ( sizeof( struct yyguts_t ), NULL ); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } - /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - return yy_init_globals ( *ptr_yy_globals ); + return yy_init_globals ( *ptr_yy_globals ); } -/* fts0blex_init_extra has the same functionality as fts0blex_init, but follows the +/* yylex_init_extra has the same functionality as yylex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and * is the reason, too, why this function also must handle its own declaration). - * The user defined value in the first argument will be available to fts0balloc in + * The user defined value in the first argument will be available to yyalloc in * the yyextra field. */ - -int fts0blex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) { - struct yyguts_t dummy_yyguts; + struct yyguts_t dummy_yyguts; - fts0bset_extra (yy_user_defined, &dummy_yyguts); + yyset_extra (yy_user_defined, &dummy_yyguts); - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } - *ptr_yy_globals = (yyscan_t) fts0balloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } - /* By setting to 0xAA, we expose bugs in - yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - fts0bset_extra (yy_user_defined, *ptr_yy_globals); + yyset_extra (yy_user_defined, *ptr_yy_globals); - return yy_init_globals ( *ptr_yy_globals ); + return yy_init_globals ( *ptr_yy_globals ); } static int yy_init_globals (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from fts0blex_destroy(), so don't allocate here. - */ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ - yyg->yy_buffer_stack = 0; - yyg->yy_buffer_stack_top = 0; - yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; - yyg->yy_init = 0; - yyg->yy_start = 0; + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; - yyg->yy_start_stack_ptr = 0; - yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; - /* Defined in main.c */ +/* Defined in main.c */ #ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; + yyin = stdin; + yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif - /* For future reference: Set errno on error, since we are called by - * fts0blex_init() - */ - return 0; + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; } -/* fts0blex_destroy is for both reentrant and non-reentrant scanners. */ -int fts0blex_destroy (yyscan_t yyscanner) +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Pop the buffer stack, destroying each element. */ + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - fts0b_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; - fts0bpop_buffer_state(yyscanner); + yypop_buffer_state(yyscanner); } /* Destroy the stack itself. */ - fts0bfree(yyg->yy_buffer_stack ,yyscanner); + yyfree(yyg->yy_buffer_stack , yyscanner); yyg->yy_buffer_stack = NULL; - /* Destroy the start condition stack. */ - fts0bfree(yyg->yy_start_stack ,yyscanner ); - yyg->yy_start_stack = NULL; + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * fts0blex() is called, initialization will occur. */ - yy_init_globals( yyscanner); + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); - /* Destroy the main struct (reentrant only). */ - fts0bfree ( yyscanner , yyscanner ); - yyscanner = NULL; - return 0; + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; } /* @@ -1910,8 +2117,11 @@ int fts0blex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; @@ -1919,7 +2129,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yys #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) { int n; for ( n = 0; s[n]; ++n ) @@ -1929,13 +2139,18 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_A } #endif -void *fts0balloc (yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void *yyalloc (yy_size_t size , yyscan_t yyscanner) { - return (void *) malloc( size ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); } -void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -1943,15 +2158,18 @@ void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } -void fts0bfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void yyfree (void * ptr , yyscan_t yyscanner) { - free( (char *) ptr ); /* see fts0brealloc() for (char *) cast */ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 73 "fts0blex.l" + diff --git a/storage/xtradb/fts/fts0tlex.cc b/storage/xtradb/fts/fts0tlex.cc index 28fac9bf704..73c34a607ca 100644 --- a/storage/xtradb/fts/fts0tlex.cc +++ b/storage/xtradb/fts/fts0tlex.cc @@ -1,4 +1,3 @@ -#include "univ.i" #line 2 "fts0tlex.cc" #line 4 "fts0tlex.cc" @@ -9,12 +8,222 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define fts0t_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer fts0t_create_buffer +#endif + +#ifdef yy_delete_buffer +#define fts0t_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer fts0t_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define fts0t_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer fts0t_scan_buffer +#endif + +#ifdef yy_scan_string +#define fts0t_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string fts0t_scan_string +#endif + +#ifdef yy_scan_bytes +#define fts0t_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes fts0t_scan_bytes +#endif + +#ifdef yy_init_buffer +#define fts0t_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer fts0t_init_buffer +#endif + +#ifdef yy_flush_buffer +#define fts0t_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer fts0t_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define fts0t_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state fts0t_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define fts0t_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer fts0t_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define fts0tpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state fts0tpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define fts0tpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state fts0tpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define fts0tensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack fts0tensure_buffer_stack +#endif + +#ifdef yylex +#define fts0tlex_ALREADY_DEFINED +#else +#define yylex fts0tlex +#endif + +#ifdef yyrestart +#define fts0trestart_ALREADY_DEFINED +#else +#define yyrestart fts0trestart +#endif + +#ifdef yylex_init +#define fts0tlex_init_ALREADY_DEFINED +#else +#define yylex_init fts0tlex_init +#endif + +#ifdef yylex_init_extra +#define fts0tlex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra fts0tlex_init_extra +#endif + +#ifdef yylex_destroy +#define fts0tlex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy fts0tlex_destroy +#endif + +#ifdef yyget_debug +#define fts0tget_debug_ALREADY_DEFINED +#else +#define yyget_debug fts0tget_debug +#endif + +#ifdef yyset_debug +#define fts0tset_debug_ALREADY_DEFINED +#else +#define yyset_debug fts0tset_debug +#endif + +#ifdef yyget_extra +#define fts0tget_extra_ALREADY_DEFINED +#else +#define yyget_extra fts0tget_extra +#endif + +#ifdef yyset_extra +#define fts0tset_extra_ALREADY_DEFINED +#else +#define yyset_extra fts0tset_extra +#endif + +#ifdef yyget_in +#define fts0tget_in_ALREADY_DEFINED +#else +#define yyget_in fts0tget_in +#endif + +#ifdef yyset_in +#define fts0tset_in_ALREADY_DEFINED +#else +#define yyset_in fts0tset_in +#endif + +#ifdef yyget_out +#define fts0tget_out_ALREADY_DEFINED +#else +#define yyget_out fts0tget_out +#endif + +#ifdef yyset_out +#define fts0tset_out_ALREADY_DEFINED +#else +#define yyset_out fts0tset_out +#endif + +#ifdef yyget_leng +#define fts0tget_leng_ALREADY_DEFINED +#else +#define yyget_leng fts0tget_leng +#endif + +#ifdef yyget_text +#define fts0tget_text_ALREADY_DEFINED +#else +#define yyget_text fts0tget_text +#endif + +#ifdef yyget_lineno +#define fts0tget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno fts0tget_lineno +#endif + +#ifdef yyset_lineno +#define fts0tset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno fts0tset_lineno +#endif + +#ifdef yyget_column +#define fts0tget_column_ALREADY_DEFINED +#else +#define yyget_column fts0tget_column +#endif + +#ifdef yyset_column +#define fts0tset_column_ALREADY_DEFINED +#else +#define yyset_column fts0tset_column +#endif + +#ifdef yywrap +#define fts0twrap_ALREADY_DEFINED +#else +#define yywrap fts0twrap +#endif + +#ifdef yyalloc +#define fts0talloc_ALREADY_DEFINED +#else +#define yyalloc fts0talloc +#endif + +#ifdef yyrealloc +#define fts0trealloc_ALREADY_DEFINED +#else +#define yyrealloc fts0trealloc +#endif + +#ifdef yyfree +#define fts0tfree_ALREADY_DEFINED +#else +#define yyfree fts0tfree +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -35,7 +244,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -52,7 +261,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -85,40 +294,32 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -142,20 +343,16 @@ typedef void* yyscan_t; * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE fts0trestart(yyin ,yyscanner ) - +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -180,12 +377,18 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) - + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -199,14 +402,8 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -219,7 +416,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -264,7 +461,7 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via fts0trestart()), so that the user can continue scanning by + * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 @@ -281,84 +478,77 @@ struct yy_buffer_state #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] -void fts0trestart (FILE *input_file ,yyscan_t yyscanner ); -void fts0t_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void fts0t_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0t_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0tpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void fts0tpop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -static void fts0tensure_buffer_stack (yyscan_t yyscanner ); -static void fts0t_load_buffer_state (yyscan_t yyscanner ); -static void fts0t_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) -#define YY_FLUSH_BUFFER fts0t_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); - -void *fts0talloc (yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); -void *fts0trealloc (void *,yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); -void fts0tfree (void * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); - -#define yy_new_buffer fts0t_create_buffer +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); +#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - fts0tensure_buffer_stack (yyscanner); \ + yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - fts0t_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ - fts0tensure_buffer_stack (yyscanner); \ + yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - fts0t_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define fts0twrap(n) 1 +#define fts0twrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; +typedef flex_uint8_t YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = static_cast(yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; - #define YY_NUM_RULES 7 #define YY_END_OF_BUFFER 8 /* This struct is not used in this scanner, @@ -368,13 +558,13 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[17] = +static const flex_int16_t yy_accept[17] = { 0, 4, 4, 8, 4, 1, 6, 1, 5, 5, 2, 4, 1, 1, 0, 3, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -406,31 +596,31 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[8] = +static const YY_CHAR yy_meta[8] = { 0, 1, 2, 3, 4, 5, 5, 1 } ; -static yyconst flex_int16_t yy_base[20] = +static const flex_int16_t yy_base[20] = { 0, 0, 0, 18, 0, 6, 21, 0, 9, 21, 0, 0, 0, 0, 4, 21, 21, 10, 11, 15 } ; -static yyconst flex_int16_t yy_def[20] = +static const flex_int16_t yy_def[20] = { 0, 16, 1, 16, 17, 17, 16, 18, 19, 16, 17, 17, 5, 18, 19, 16, 0, 16, 16, 16 } ; -static yyconst flex_int16_t yy_nxt[29] = +static const flex_int16_t yy_nxt[29] = { 0, 4, 5, 6, 7, 8, 9, 10, 12, 15, 13, 11, 11, 13, 15, 13, 14, 14, 16, 14, 14, 3, 16, 16, 16, 16, 16, 16, 16 } ; -static yyconst flex_int16_t yy_chk[29] = +static const flex_int16_t yy_chk[29] = { 0, 1, 1, 1, 1, 1, 1, 1, 5, 14, 5, 17, 17, 18, 8, 18, 19, 19, 3, 19, 19, @@ -447,7 +637,7 @@ static yyconst flex_int16_t yy_chk[29] = #line 1 "fts0tlex.l" /***************************************************************************** -Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved. 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 @@ -476,8 +666,9 @@ this program; if not, write to the Free Software Foundation, Inc., /* Required for reentrant parser */ #define YY_DECL int fts_tlexer(YYSTYPE* val, yyscan_t yyscanner) +#line 670 "fts0tlex.cc" #define YY_NO_INPUT 1 -#line 480 "fts0tlex.cc" +#line 672 "fts0tlex.cc" #define INITIAL 0 @@ -527,40 +718,44 @@ struct yyguts_t }; /* end struct yyguts_t */ -static int yy_init_globals (yyscan_t yyscanner ); +static int yy_init_globals ( yyscan_t yyscanner ); -int fts0tlex_init (yyscan_t* scanner); +int yylex_init (yyscan_t* scanner); -int fts0tlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int fts0tlex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); -int fts0tget_debug (yyscan_t yyscanner ); +int yyget_debug ( yyscan_t yyscanner ); -void fts0tset_debug (int debug_flag ,yyscan_t yyscanner ); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE fts0tget_extra (yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void fts0tset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *fts0tget_in (yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -void fts0tset_in (FILE * in_str ,yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *fts0tget_out (yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -void fts0tset_out (FILE * out_str ,yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int fts0tget_leng (yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -char *fts0tget_text (yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -int fts0tget_lineno (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -void fts0tset_lineno (int line_number ,yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -568,26 +763,29 @@ void fts0tset_lineno (int line_number ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int fts0twrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int fts0twrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); +static int yyinput ( yyscan_t yyscanner ); #else -static int input (yyscan_t yyscanner ); +static int input ( yyscan_t yyscanner ); #endif #endif @@ -607,7 +805,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -619,7 +817,7 @@ static int input (yyscan_t yyscanner ); { \ int c = '*'; \ int n; \ - for ( n = 0; n < static_cast(max_size) && \ + for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ @@ -631,8 +829,7 @@ static int input (yyscan_t yyscanner ); else \ { \ errno=0; \ - while ( (result = static_cast(fread(buf, 1, max_size, yyin)))==0 \ - && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -673,9 +870,9 @@ static int input (yyscan_t yyscanner ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int fts0tlex (yyscan_t yyscanner); +extern int yylex (yyscan_t yyscanner); -#define YY_DECL int fts0tlex (yyscan_t yyscanner) +#define YY_DECL int yylex (yyscan_t yyscanner) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng @@ -687,7 +884,7 @@ extern int fts0tlex (yyscan_t yyscanner); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -702,11 +899,6 @@ YY_DECL int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 44 "fts0tlex.l" - - -#line 707 "fts0tlex.cc" - if ( !yyg->yy_init ) { yyg->yy_init = 1; @@ -725,15 +917,21 @@ YY_DECL yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - fts0tensure_buffer_stack (yyscanner); + yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - fts0t_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - fts0t_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 44 "fts0tlex.l" + + +#line 933 "fts0tlex.cc" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -749,7 +947,7 @@ YY_DECL yy_match: do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -759,9 +957,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 17 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 16 ); @@ -832,7 +1030,7 @@ YY_RULE_SETUP #line 68 "fts0tlex.l" ECHO; YY_BREAK -#line 834 "fts0tlex.cc" +#line 1034 "fts0tlex.cc" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -850,7 +1048,7 @@ case YY_STATE_EOF(INITIAL): /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called - * fts0tlex(). If so, then we have to assure + * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a @@ -911,7 +1109,7 @@ case YY_STATE_EOF(INITIAL): { yyg->yy_did_buffer_switch_on_eof = 0; - if ( fts0twrap(yyscanner ) ) + if ( yywrap( yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -964,7 +1162,8 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of fts0tlex */ + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1007,7 +1206,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1020,21 +1219,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - int num_to_read =static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1); + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = static_cast(b->yy_buf_size * 2); + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1043,11 +1242,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - fts0trealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1055,8 +1255,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1); + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; } @@ -1065,7 +1265,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -1075,7 +1275,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - fts0trestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); } else @@ -1089,12 +1289,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) fts0trealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } yyg->yy_n_chars += number_to_move; @@ -1128,9 +1331,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 17 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1157,14 +1360,19 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 17 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 16); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) @@ -1190,7 +1398,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -1207,14 +1415,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ /* Reset buffer status. */ - fts0trestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( fts0twrap(yyscanner ) ) - return EOF; + if ( yywrap( yyscanner ) ) + return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -1245,34 +1453,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner) * @param yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ - void fts0trestart (FILE * input_file , yyscan_t yyscanner) + void yyrestart (FILE * input_file , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ - fts0tensure_buffer_stack (yyscanner); + yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - fts0t_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - fts0t_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - fts0t_load_buffer_state(yyscanner ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */ - void fts0t_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* TODO. We should be able to replace this entire function body * with - * fts0tpop_buffer_state(); - * fts0tpush_buffer_state(new_buffer); + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - fts0tensure_buffer_stack (yyscanner); + yyensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -1285,17 +1493,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - fts0t_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); /* We don't actually know whether we did this switch during - * EOF (fts0twrap()) processing, but the only time this flag - * is looked at is after fts0twrap() is called, so it's safe + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yyg->yy_did_buffer_switch_on_eof = 1; } -static void fts0t_load_buffer_state (yyscan_t yyscanner) +static void yy_load_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; @@ -1310,35 +1518,35 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the allocated buffer state. */ - YY_BUFFER_STATE fts0t_create_buffer (FILE * file, int size , yyscan_t yyscanner) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) fts0talloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in fts0t_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) fts0talloc(b->yy_buf_size + 2 ,yyscanner ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in fts0t_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - fts0t_init_buffer(b,file ,yyscanner); + yy_init_buffer( b, file , yyscanner); return b; } /** Destroy the buffer. - * @param b a buffer created with fts0t_create_buffer() + * @param b a buffer created with yy_create_buffer() * @param yyscanner The scanner object. */ - void fts0t_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -1349,28 +1557,28 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - fts0tfree((void *) b->yy_ch_buf ,yyscanner ); + yyfree( (void *) b->yy_ch_buf , yyscanner ); - fts0tfree((void *) b ,yyscanner ); + yyfree( (void *) b , yyscanner ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a fts0trestart() or at EOF. + * such as during a yyrestart() or at EOF. */ - static void fts0t_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) { int oerrno = errno; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - fts0t_flush_buffer(b ,yyscanner); + yy_flush_buffer( b , yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then fts0t_init_buffer was _probably_ - * called from fts0trestart() or through yy_get_next_buffer. + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ @@ -1379,7 +1587,7 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) } b->yy_is_interactive = 0; - + errno = oerrno; } @@ -1387,7 +1595,7 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param yyscanner The scanner object. */ - void fts0t_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) @@ -1408,7 +1616,7 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - fts0t_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } /** Pushes the new state onto the stack. The new state becomes @@ -1417,15 +1625,15 @@ static void fts0t_load_buffer_state (yyscan_t yyscanner) * @param new_buffer The new state. * @param yyscanner The scanner object. */ -void fts0tpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; - fts0tensure_buffer_stack(yyscanner); + yyensure_buffer_stack(yyscanner); - /* This block is copied from fts0t_switch_to_buffer. */ + /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -1439,8 +1647,8 @@ void fts0tpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) yyg->yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from fts0t_switch_to_buffer. */ - fts0t_load_buffer_state(yyscanner ); + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } @@ -1448,19 +1656,19 @@ void fts0tpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) * The next element becomes the new top. * @param yyscanner The scanner object. */ -void fts0tpop_buffer_state (yyscan_t yyscanner) +void yypop_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; - fts0t_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { - fts0t_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } @@ -1468,9 +1676,9 @@ void fts0tpop_buffer_state (yyscan_t yyscanner) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void fts0tensure_buffer_stack (yyscan_t yyscanner) +static void yyensure_buffer_stack (yyscan_t yyscanner) { - int num_to_alloc; + yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -1479,12 +1687,12 @@ static void fts0tensure_buffer_stack (yyscan_t yyscanner) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; - yyg->yy_buffer_stack = (struct yy_buffer_state**)fts0talloc + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in fts0tensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -1496,15 +1704,15 @@ static void fts0tensure_buffer_stack (yyscan_t yyscanner) if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; - num_to_alloc = static_cast(yyg->yy_buffer_stack_max + grow_size); - yyg->yy_buffer_stack = (struct yy_buffer_state**)fts0trealloc + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc (yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in fts0tensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1518,77 +1726,77 @@ static void fts0tensure_buffer_stack (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE fts0t_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) fts0talloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in fts0t_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = static_cast(b->yy_buf_size); + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - fts0t_switch_to_buffer(b ,yyscanner ); + yy_switch_to_buffer( b , yyscanner ); return b; } -/** Setup the input buffer state to scan a string. The next call to fts0tlex() will +/** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * @param yyscanner The scanner object. * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use - * fts0t_scan_bytes() instead. + * yy_scan_bytes() instead. */ -YY_BUFFER_STATE fts0t_scan_string (yyconst char * yystr , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) { - - return fts0t_scan_bytes(yystr,static_cast(strlen(yystr)) ,yyscanner); + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); } -/** Setup the input buffer state to scan the given bytes. The next call to fts0tlex() will +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE fts0t_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) fts0talloc(n ,yyscanner ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in fts0t_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = fts0t_scan_buffer(buf,n ,yyscanner); + b = yy_scan_buffer( buf, n , yyscanner); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in fts0t_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -1602,9 +1810,11 @@ YY_BUFFER_STATE fts0t_scan_bytes (yyconst char * yybytes, int _yybytes_len , y #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) { - (void) fprintf( stderr, "%s\n", msg ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1630,7 +1840,7 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ -YY_EXTRA_TYPE fts0tget_extra (yyscan_t yyscanner) +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyextra; @@ -1639,33 +1849,33 @@ YY_EXTRA_TYPE fts0tget_extra (yyscan_t yyscanner) /** Get the current line number. * @param yyscanner The scanner object. */ -int fts0tget_lineno (yyscan_t yyscanner) +int yyget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; - + return yylineno; } /** Get the current column number. * @param yyscanner The scanner object. */ -int fts0tget_column (yyscan_t yyscanner) +int yyget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; - + return yycolumn; } /** Get the input stream. * @param yyscanner The scanner object. */ -FILE *fts0tget_in (yyscan_t yyscanner) +FILE *yyget_in (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyin; @@ -1674,7 +1884,7 @@ FILE *fts0tget_in (yyscan_t yyscanner) /** Get the output stream. * @param yyscanner The scanner object. */ -FILE *fts0tget_out (yyscan_t yyscanner) +FILE *yyget_out (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyout; @@ -1683,7 +1893,7 @@ FILE *fts0tget_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -int fts0tget_leng (yyscan_t yyscanner) +int yyget_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -1693,7 +1903,7 @@ int fts0tget_leng (yyscan_t yyscanner) * @param yyscanner The scanner object. */ -char *fts0tget_text (yyscan_t yyscanner) +char *yyget_text (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yytext; @@ -1703,90 +1913,88 @@ char *fts0tget_text (yyscan_t yyscanner) * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ -void fts0tset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyextra = user_defined ; } /** Set the current line number. - * @param line_number + * @param _line_number line number * @param yyscanner The scanner object. */ -void fts0tset_lineno (int line_number , yyscan_t yyscanner) +void yyset_lineno (int _line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "fts0tset_lineno called with no buffer" , yyscanner); - - yylineno = line_number; + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; } /** Set the current column. - * @param line_number + * @param _column_no column number * @param yyscanner The scanner object. */ -void fts0tset_column (int column_no , yyscan_t yyscanner) +void yyset_column (int _column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "fts0tset_column called with no buffer" , yyscanner); - - yycolumn = column_no; + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * @param yyscanner The scanner object. - * @see fts0t_switch_to_buffer + * @see yy_switch_to_buffer */ -void fts0tset_in (FILE * in_str , yyscan_t yyscanner) +void yyset_in (FILE * _in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; + yyin = _in_str ; } -void fts0tset_out (FILE * out_str , yyscan_t yyscanner) +void yyset_out (FILE * _out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; + yyout = _out_str ; } -int fts0tget_debug (yyscan_t yyscanner) +int yyget_debug (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } -void fts0tset_debug (int bdebug , yyscan_t yyscanner) +void yyset_debug (int _bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } /* Accessor methods for yylval and yylloc */ /* User-visible API */ -/* fts0tlex_init is special because it creates the scanner itself, so it is +/* yylex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ - -int fts0tlex_init(yyscan_t* ptr_yy_globals) - +int yylex_init(yyscan_t* ptr_yy_globals) { if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } - *ptr_yy_globals = (yyscan_t) fts0talloc ( sizeof( struct yyguts_t ), NULL ); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; @@ -1799,27 +2007,25 @@ int fts0tlex_init(yyscan_t* ptr_yy_globals) return yy_init_globals ( *ptr_yy_globals ); } -/* fts0tlex_init_extra has the same functionality as fts0tlex_init, but follows the +/* yylex_init_extra has the same functionality as yylex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and * is the reason, too, why this function also must handle its own declaration). - * The user defined value in the first argument will be available to fts0talloc in + * The user defined value in the first argument will be available to yyalloc in * the yyextra field. */ - -int fts0tlex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) { struct yyguts_t dummy_yyguts; - fts0tset_extra (yy_user_defined, &dummy_yyguts); + yyset_extra (yy_user_defined, &dummy_yyguts); if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } - *ptr_yy_globals = (yyscan_t) fts0talloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; @@ -1830,7 +2036,7 @@ int fts0tlex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - fts0tset_extra (yy_user_defined, *ptr_yy_globals); + yyset_extra (yy_user_defined, *ptr_yy_globals); return yy_init_globals ( *ptr_yy_globals ); } @@ -1839,13 +2045,13 @@ static int yy_init_globals (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Initialization is the same as for the non-reentrant scanner. - * This function is called from fts0tlex_destroy(), so don't allocate here. + * This function is called from yylex_destroy(), so don't allocate here. */ - yyg->yy_buffer_stack = 0; + yyg->yy_buffer_stack = NULL; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; + yyg->yy_c_buf_p = NULL; yyg->yy_init = 0; yyg->yy_start = 0; @@ -1858,42 +2064,42 @@ static int yy_init_globals (yyscan_t yyscanner) yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by - * fts0tlex_init() + * yylex_init() */ return 0; } -/* fts0tlex_destroy is for both reentrant and non-reentrant scanners. */ -int fts0tlex_destroy (yyscan_t yyscanner) +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - fts0t_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; - fts0tpop_buffer_state(yyscanner); + yypop_buffer_state(yyscanner); } /* Destroy the stack itself. */ - fts0tfree(yyg->yy_buffer_stack ,yyscanner); + yyfree(yyg->yy_buffer_stack , yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ - fts0tfree(yyg->yy_start_stack ,yyscanner ); + yyfree( yyg->yy_start_stack , yyscanner ); yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time - * fts0tlex() is called, initialization will occur. */ + * yylex() is called, initialization will occur. */ yy_init_globals( yyscanner); /* Destroy the main struct (reentrant only). */ - fts0tfree ( yyscanner , yyscanner ); + yyfree ( yyscanner , yyscanner ); yyscanner = NULL; return 0; } @@ -1903,8 +2109,11 @@ int fts0tlex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; @@ -1912,7 +2121,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yys #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) { int n; for ( n = 0; s[n]; ++n ) @@ -1922,13 +2131,18 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_A } #endif -void *fts0talloc (yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void *yyalloc (yy_size_t size , yyscan_t yyscanner) { - return (void *) malloc( size ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); } -void *fts0trealloc (void * ptr, yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -1936,12 +2150,14 @@ void *fts0trealloc (void * ptr, yy_size_t size , yyscan_t yyscanner * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } -void fts0tfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) +void yyfree (void * ptr , yyscan_t yyscanner) { - free( (char *) ptr ); /* see fts0trealloc() for (char *) cast */ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" @@ -1949,4 +2165,3 @@ void fts0tfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused) #line 68 "fts0tlex.l" - diff --git a/storage/xtradb/include/fts0blex.h b/storage/xtradb/include/fts0blex.h index d0e4cae0678..10dc314d5d4 100644 --- a/storage/xtradb/include/fts0blex.h +++ b/storage/xtradb/include/fts0blex.h @@ -12,12 +12,222 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define fts0b_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer fts0b_create_buffer +#endif + +#ifdef yy_delete_buffer +#define fts0b_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer fts0b_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define fts0b_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer fts0b_scan_buffer +#endif + +#ifdef yy_scan_string +#define fts0b_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string fts0b_scan_string +#endif + +#ifdef yy_scan_bytes +#define fts0b_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes fts0b_scan_bytes +#endif + +#ifdef yy_init_buffer +#define fts0b_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer fts0b_init_buffer +#endif + +#ifdef yy_flush_buffer +#define fts0b_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer fts0b_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define fts0b_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state fts0b_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define fts0b_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer fts0b_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define fts0bpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state fts0bpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define fts0bpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state fts0bpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define fts0bensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack fts0bensure_buffer_stack +#endif + +#ifdef yylex +#define fts0blex_ALREADY_DEFINED +#else +#define yylex fts0blex +#endif + +#ifdef yyrestart +#define fts0brestart_ALREADY_DEFINED +#else +#define yyrestart fts0brestart +#endif + +#ifdef yylex_init +#define fts0blex_init_ALREADY_DEFINED +#else +#define yylex_init fts0blex_init +#endif + +#ifdef yylex_init_extra +#define fts0blex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra fts0blex_init_extra +#endif + +#ifdef yylex_destroy +#define fts0blex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy fts0blex_destroy +#endif + +#ifdef yyget_debug +#define fts0bget_debug_ALREADY_DEFINED +#else +#define yyget_debug fts0bget_debug +#endif + +#ifdef yyset_debug +#define fts0bset_debug_ALREADY_DEFINED +#else +#define yyset_debug fts0bset_debug +#endif + +#ifdef yyget_extra +#define fts0bget_extra_ALREADY_DEFINED +#else +#define yyget_extra fts0bget_extra +#endif + +#ifdef yyset_extra +#define fts0bset_extra_ALREADY_DEFINED +#else +#define yyset_extra fts0bset_extra +#endif + +#ifdef yyget_in +#define fts0bget_in_ALREADY_DEFINED +#else +#define yyget_in fts0bget_in +#endif + +#ifdef yyset_in +#define fts0bset_in_ALREADY_DEFINED +#else +#define yyset_in fts0bset_in +#endif + +#ifdef yyget_out +#define fts0bget_out_ALREADY_DEFINED +#else +#define yyget_out fts0bget_out +#endif + +#ifdef yyset_out +#define fts0bset_out_ALREADY_DEFINED +#else +#define yyset_out fts0bset_out +#endif + +#ifdef yyget_leng +#define fts0bget_leng_ALREADY_DEFINED +#else +#define yyget_leng fts0bget_leng +#endif + +#ifdef yyget_text +#define fts0bget_text_ALREADY_DEFINED +#else +#define yyget_text fts0bget_text +#endif + +#ifdef yyget_lineno +#define fts0bget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno fts0bget_lineno +#endif + +#ifdef yyset_lineno +#define fts0bset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno fts0bset_lineno +#endif + +#ifdef yyget_column +#define fts0bget_column_ALREADY_DEFINED +#else +#define yyget_column fts0bget_column +#endif + +#ifdef yyset_column +#define fts0bset_column_ALREADY_DEFINED +#else +#define yyset_column fts0bset_column +#endif + +#ifdef yywrap +#define fts0bwrap_ALREADY_DEFINED +#else +#define yywrap fts0bwrap +#endif + +#ifdef yyalloc +#define fts0balloc_ALREADY_DEFINED +#else +#define yyalloc fts0balloc +#endif + +#ifdef yyrealloc +#define fts0brealloc_ALREADY_DEFINED +#else +#define yyrealloc fts0brealloc +#endif + +#ifdef yyfree +#define fts0bfree_ALREADY_DEFINED +#else +#define yyfree fts0bfree +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -88,29 +298,23 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* An opaque pointer. */ @@ -165,7 +369,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -193,7 +397,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -204,25 +408,25 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ -void fts0brestart (FILE *input_file ,yyscan_t yyscanner ); -void fts0b_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void fts0b_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0b_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0bpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void fts0bpop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0b_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -void *fts0balloc (yy_size_t ,yyscan_t yyscanner ); -void *fts0brealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void fts0bfree (void * ,yyscan_t yyscanner ); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); /* Begin user sect3 */ -#define fts0bwrap(n) 1 +#define fts0bwrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define yytext_ptr yytext_r @@ -244,38 +448,42 @@ void fts0bfree (void * ,yyscan_t yyscanner ); #define YY_EXTRA_TYPE void * #endif -int fts0blex_init (yyscan_t* scanner); +int yylex_init (yyscan_t* scanner); -int fts0blex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int fts0blex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); -int fts0bget_debug (yyscan_t yyscanner ); +int yyget_debug ( yyscan_t yyscanner ); -void fts0bset_debug (int debug_flag ,yyscan_t yyscanner ); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE fts0bget_extra (yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void fts0bset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *fts0bget_in (yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -void fts0bset_in (FILE * in_str ,yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *fts0bget_out (yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -void fts0bset_out (FILE * out_str ,yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int fts0bget_leng (yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -char *fts0bget_text (yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -int fts0bget_lineno (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -void fts0bset_lineno (int line_number ,yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -283,18 +491,18 @@ void fts0bset_lineno (int line_number ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int fts0bwrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int fts0bwrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT @@ -322,9 +530,9 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int fts0blex (yyscan_t yyscanner); +extern int yylex (yyscan_t yyscanner); -#define YY_DECL int fts0blex (yyscan_t yyscanner) +#define YY_DECL int yylex (yyscan_t yyscanner) #endif /* !YY_DECL */ /* yy_get_previous_state - get the state just before the EOB char was reached */ @@ -341,9 +549,154 @@ extern int fts0blex (yyscan_t yyscanner); #undef YY_DECL #endif +#ifndef fts0b_create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef fts0b_delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef fts0b_scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef fts0b_scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef fts0b_scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef fts0b_init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef fts0b_flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef fts0b_load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef fts0b_switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef fts0bpush_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef fts0bpop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef fts0bensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef fts0blex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef fts0brestart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef fts0blex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef fts0blex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef fts0blex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef fts0bget_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef fts0bset_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef fts0bget_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef fts0bset_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef fts0bget_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef fts0bset_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef fts0bget_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef fts0bset_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef fts0bget_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef fts0bget_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef fts0bget_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef fts0bset_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef fts0bget_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef fts0bset_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef fts0bwrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef fts0bget_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef fts0bset_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef fts0bget_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef fts0bset_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef fts0balloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef fts0brealloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef fts0bfree_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef fts0btext_ALREADY_DEFINED +#undef yytext +#endif +#ifndef fts0bleng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef fts0bin_ALREADY_DEFINED +#undef yyin +#endif +#ifndef fts0bout_ALREADY_DEFINED +#undef yyout +#endif +#ifndef fts0b_flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef fts0blineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef fts0btables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef fts0btables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef fts0bTABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + #line 73 "fts0blex.l" -#line 348 "../include/fts0blex.h" +#line 701 "../include/fts0blex.h" #undef fts0bIN_HEADER #endif /* fts0bHEADER_H */ diff --git a/storage/xtradb/include/fts0tlex.h b/storage/xtradb/include/fts0tlex.h index f91533803e8..038cbb8858d 100644 --- a/storage/xtradb/include/fts0tlex.h +++ b/storage/xtradb/include/fts0tlex.h @@ -12,12 +12,222 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define fts0t_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer fts0t_create_buffer +#endif + +#ifdef yy_delete_buffer +#define fts0t_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer fts0t_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define fts0t_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer fts0t_scan_buffer +#endif + +#ifdef yy_scan_string +#define fts0t_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string fts0t_scan_string +#endif + +#ifdef yy_scan_bytes +#define fts0t_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes fts0t_scan_bytes +#endif + +#ifdef yy_init_buffer +#define fts0t_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer fts0t_init_buffer +#endif + +#ifdef yy_flush_buffer +#define fts0t_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer fts0t_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define fts0t_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state fts0t_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define fts0t_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer fts0t_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define fts0tpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state fts0tpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define fts0tpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state fts0tpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define fts0tensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack fts0tensure_buffer_stack +#endif + +#ifdef yylex +#define fts0tlex_ALREADY_DEFINED +#else +#define yylex fts0tlex +#endif + +#ifdef yyrestart +#define fts0trestart_ALREADY_DEFINED +#else +#define yyrestart fts0trestart +#endif + +#ifdef yylex_init +#define fts0tlex_init_ALREADY_DEFINED +#else +#define yylex_init fts0tlex_init +#endif + +#ifdef yylex_init_extra +#define fts0tlex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra fts0tlex_init_extra +#endif + +#ifdef yylex_destroy +#define fts0tlex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy fts0tlex_destroy +#endif + +#ifdef yyget_debug +#define fts0tget_debug_ALREADY_DEFINED +#else +#define yyget_debug fts0tget_debug +#endif + +#ifdef yyset_debug +#define fts0tset_debug_ALREADY_DEFINED +#else +#define yyset_debug fts0tset_debug +#endif + +#ifdef yyget_extra +#define fts0tget_extra_ALREADY_DEFINED +#else +#define yyget_extra fts0tget_extra +#endif + +#ifdef yyset_extra +#define fts0tset_extra_ALREADY_DEFINED +#else +#define yyset_extra fts0tset_extra +#endif + +#ifdef yyget_in +#define fts0tget_in_ALREADY_DEFINED +#else +#define yyget_in fts0tget_in +#endif + +#ifdef yyset_in +#define fts0tset_in_ALREADY_DEFINED +#else +#define yyset_in fts0tset_in +#endif + +#ifdef yyget_out +#define fts0tget_out_ALREADY_DEFINED +#else +#define yyget_out fts0tget_out +#endif + +#ifdef yyset_out +#define fts0tset_out_ALREADY_DEFINED +#else +#define yyset_out fts0tset_out +#endif + +#ifdef yyget_leng +#define fts0tget_leng_ALREADY_DEFINED +#else +#define yyget_leng fts0tget_leng +#endif + +#ifdef yyget_text +#define fts0tget_text_ALREADY_DEFINED +#else +#define yyget_text fts0tget_text +#endif + +#ifdef yyget_lineno +#define fts0tget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno fts0tget_lineno +#endif + +#ifdef yyset_lineno +#define fts0tset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno fts0tset_lineno +#endif + +#ifdef yyget_column +#define fts0tget_column_ALREADY_DEFINED +#else +#define yyget_column fts0tget_column +#endif + +#ifdef yyset_column +#define fts0tset_column_ALREADY_DEFINED +#else +#define yyset_column fts0tset_column +#endif + +#ifdef yywrap +#define fts0twrap_ALREADY_DEFINED +#else +#define yywrap fts0twrap +#endif + +#ifdef yyalloc +#define fts0talloc_ALREADY_DEFINED +#else +#define yyalloc fts0talloc +#endif + +#ifdef yyrealloc +#define fts0trealloc_ALREADY_DEFINED +#else +#define yyrealloc fts0trealloc +#endif + +#ifdef yyfree +#define fts0tfree_ALREADY_DEFINED +#else +#define yyfree fts0tfree +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -88,29 +298,23 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* An opaque pointer. */ @@ -165,7 +369,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -193,7 +397,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -204,25 +408,25 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ -void fts0trestart (FILE *input_file ,yyscan_t yyscanner ); -void fts0t_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void fts0t_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0t_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void fts0tpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void fts0tpop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE fts0t_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -void *fts0talloc (yy_size_t ,yyscan_t yyscanner ); -void *fts0trealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void fts0tfree (void * ,yyscan_t yyscanner ); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); /* Begin user sect3 */ -#define fts0twrap(n) 1 +#define fts0twrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define yytext_ptr yytext_r @@ -244,38 +448,42 @@ void fts0tfree (void * ,yyscan_t yyscanner ); #define YY_EXTRA_TYPE void * #endif -int fts0tlex_init (yyscan_t* scanner); +int yylex_init (yyscan_t* scanner); -int fts0tlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int fts0tlex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); -int fts0tget_debug (yyscan_t yyscanner ); +int yyget_debug ( yyscan_t yyscanner ); -void fts0tset_debug (int debug_flag ,yyscan_t yyscanner ); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE fts0tget_extra (yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void fts0tset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *fts0tget_in (yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -void fts0tset_in (FILE * in_str ,yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *fts0tget_out (yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -void fts0tset_out (FILE * out_str ,yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int fts0tget_leng (yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -char *fts0tget_text (yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -int fts0tget_lineno (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -void fts0tset_lineno (int line_number ,yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -283,18 +491,18 @@ void fts0tset_lineno (int line_number ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int fts0twrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int fts0twrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT @@ -322,9 +530,9 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int fts0tlex (yyscan_t yyscanner); +extern int yylex (yyscan_t yyscanner); -#define YY_DECL int fts0tlex (yyscan_t yyscanner) +#define YY_DECL int yylex (yyscan_t yyscanner) #endif /* !YY_DECL */ /* yy_get_previous_state - get the state just before the EOB char was reached */ @@ -341,9 +549,154 @@ extern int fts0tlex (yyscan_t yyscanner); #undef YY_DECL #endif +#ifndef fts0t_create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef fts0t_delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef fts0t_scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef fts0t_scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef fts0t_scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef fts0t_init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef fts0t_flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef fts0t_load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef fts0t_switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef fts0tpush_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef fts0tpop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef fts0tensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef fts0tlex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef fts0trestart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef fts0tlex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef fts0tlex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef fts0tlex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef fts0tget_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef fts0tset_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef fts0tget_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef fts0tset_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef fts0tget_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef fts0tset_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef fts0tget_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef fts0tset_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef fts0tget_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef fts0tget_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef fts0tget_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef fts0tset_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef fts0tget_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef fts0tset_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef fts0twrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef fts0tget_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef fts0tset_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef fts0tget_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef fts0tset_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef fts0talloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef fts0trealloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef fts0tfree_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef fts0ttext_ALREADY_DEFINED +#undef yytext +#endif +#ifndef fts0tleng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef fts0tin_ALREADY_DEFINED +#undef yyin +#endif +#ifndef fts0tout_ALREADY_DEFINED +#undef yyout +#endif +#ifndef fts0t_flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef fts0tlineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef fts0ttables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef fts0ttables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef fts0tTABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + #line 68 "fts0tlex.l" -#line 348 "../include/fts0tlex.h" +#line 701 "../include/fts0tlex.h" #undef fts0tIN_HEADER #endif /* fts0tHEADER_H */ diff --git a/storage/xtradb/include/pars0pars.h b/storage/xtradb/include/pars0pars.h index 73585c78a6a..313380a40b4 100644 --- a/storage/xtradb/include/pars0pars.h +++ b/storage/xtradb/include/pars0pars.h @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 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 @@ -109,11 +110,11 @@ pars_sql( Retrieves characters to the lexical analyzer. @return number of characters copied or 0 on EOF */ UNIV_INTERN -int +size_t pars_get_lex_chars( /*===============*/ char* buf, /*!< in/out: buffer where to copy */ - int max_size); /*!< in: maximum number of characters which fit + size_t max_size); /*!< in: maximum number of characters which fit in the buffer */ /*************************************************************//** Called by yyparse on error. */ diff --git a/storage/xtradb/pars/lexyy.cc b/storage/xtradb/pars/lexyy.cc index bc6544b099d..54fe182ae6b 100644 --- a/storage/xtradb/pars/lexyy.cc +++ b/storage/xtradb/pars/lexyy.cc @@ -9,8 +9,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -35,7 +35,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -52,7 +52,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -85,60 +85,48 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -168,16 +156,17 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern yy_size_t yyleng; -extern FILE *yyin, *yyout; + + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) - + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -191,7 +180,6 @@ extern FILE *yyin, *yyout; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -206,12 +194,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -262,7 +250,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -273,7 +261,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -281,11 +268,11 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +static int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -294,85 +281,81 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -static YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); +static void yyrestart ( FILE *input_file ); +MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +static YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +static void yy_delete_buffer ( YY_BUFFER_STATE b ); +static void yy_flush_buffer ( YY_BUFFER_STATE b ); +MY_ATTRIBUTE((unused)) static void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +MY_ATTRIBUTE((unused)) static void yypop_buffer_state ( void ); -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +static void *yyalloc ( yy_size_t ); +static void *yyrealloc ( void *, yy_size_t ); +static void yyfree ( void * ); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define yywrap(n) 1 +#define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +static FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; -extern int yylineno; -int yylineno = 1; +static int yylineno = 1; -extern char *yytext; + +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 124 #define YY_END_OF_BUFFER 125 /* This struct is not used in this scanner, @@ -382,7 +365,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[425] = +static const flex_int16_t yy_accept[425] = { 0, 0, 0, 119, 119, 0, 0, 0, 0, 125, 123, 122, 122, 8, 123, 114, 5, 103, 109, 112, 110, @@ -433,7 +416,7 @@ static yyconst flex_int16_t yy_accept[425] = 96, 96, 62, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -465,7 +448,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[57] = +static const YY_CHAR yy_meta[57] = { 0, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 5, 1, 1, 1, 1, 6, 7, 1, 1, 1, @@ -475,7 +458,7 @@ static yyconst flex_int32_t yy_meta[57] = 9, 9, 9, 9, 1, 1 } ; -static yyconst flex_int16_t yy_base[438] = +static const flex_int16_t yy_base[438] = { 0, 0, 0, 293, 287, 284, 281, 272, 256, 254, 1357, 55, 57, 1357, 0, 1357, 1357, 1357, 1357, 1357, 1357, @@ -527,7 +510,7 @@ static yyconst flex_int16_t yy_base[438] = 1306, 1315, 1324, 1333, 1340, 1344, 1347 } ; -static yyconst flex_int16_t yy_def[438] = +static const flex_int16_t yy_def[438] = { 0, 424, 1, 425, 425, 426, 426, 427, 427, 424, 424, 424, 424, 424, 428, 424, 424, 424, 424, 424, 424, @@ -579,7 +562,7 @@ static yyconst flex_int16_t yy_def[438] = 424, 424, 424, 424, 424, 424, 424 } ; -static yyconst flex_int16_t yy_nxt[1414] = +static const flex_int16_t yy_nxt[1414] = { 0, 10, 11, 12, 13, 10, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, @@ -739,7 +722,7 @@ static yyconst flex_int16_t yy_nxt[1414] = 424, 424, 424 } ; -static yyconst flex_int16_t yy_chk[1414] = +static const flex_int16_t yy_chk[1414] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -902,8 +885,8 @@ static yyconst flex_int16_t yy_chk[1414] = static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; -extern int yy_flex_debug; -int yy_flex_debug = 0; + +static int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -912,11 +895,12 @@ int yy_flex_debug = 0; #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *yytext; +static char *yytext; #line 1 "pars0lex.l" /***************************************************************************** -Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2011, 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 @@ -951,7 +935,7 @@ Created 12/14/1997 Heikki Tuuri *******************************************************/ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 -#line 53 "pars0lex.l" +#line 54 "pars0lex.l" #define YYSTYPE que_node_t* #include "univ.i" @@ -966,9 +950,8 @@ Created 12/14/1997 Heikki Tuuri #define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error -/* Note: We cast &result to int* from yysize_t* */ #define YY_INPUT(buf, result, max_size) \ - (result = pars_get_lex_chars(buf, max_size)) + result = pars_get_lex_chars(buf, max_size) /* String buffer for removing quotes */ static ulint stringbuf_len_alloc = 0; /* Allocated length */ @@ -1000,10 +983,9 @@ string_append( stringbuf_len += len; } +#line 986 "lexyy.cc" - - -#line 1006 "lexyy.cc" +#line 988 "lexyy.cc" #define INITIAL 0 #define comment 1 @@ -1022,36 +1004,36 @@ string_append( #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -MY_ATTRIBUTE((unused)) static int yylex_destroy (void ); +MY_ATTRIBUTE((unused)) static int yylex_destroy ( void ); -int yyget_debug (void ); +MY_ATTRIBUTE((unused)) static int yyget_debug ( void ); -void yyset_debug (int debug_flag ); +MY_ATTRIBUTE((unused)) static void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE yyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void yyset_extra (YY_EXTRA_TYPE user_defined ); +MY_ATTRIBUTE((unused)) static void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *yyget_in (void ); +MY_ATTRIBUTE((unused)) static FILE *yyget_in ( void ); -void yyset_in (FILE * in_str ); +MY_ATTRIBUTE((unused)) static void yyset_in ( FILE * _in_str ); -FILE *yyget_out (void ); +MY_ATTRIBUTE((unused)) static FILE *yyget_out ( void ); -void yyset_out (FILE * out_str ); +MY_ATTRIBUTE((unused)) static void yyset_out ( FILE * _out_str ); -yy_size_t yyget_leng (void ); + MY_ATTRIBUTE((unused)) static int yyget_leng ( void ); -char *yyget_text (void ); +MY_ATTRIBUTE((unused)) static char *yyget_text ( void ); -int yyget_lineno (void ); +MY_ATTRIBUTE((unused)) static int yyget_lineno ( void ); -void yyset_lineno (int line_number ); +MY_ATTRIBUTE((unused)) static void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1059,26 +1041,29 @@ void yyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap ( void ); #else -extern int yywrap (void ); +extern int yywrap ( void ); #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif @@ -1098,7 +1083,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1109,7 +1094,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1122,7 +1107,7 @@ static int input (void ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -1177,7 +1162,7 @@ extern int yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -1190,12 +1175,7 @@ YY_DECL yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; - -#line 112 "pars0lex.l" - - -#line 1197 "lexyy.cc" - + if ( !(yy_init) ) { (yy_init) = 1; @@ -1216,13 +1196,19 @@ YY_DECL if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_load_buffer_state( ); + yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 112 "pars0lex.l" + + +#line 1209 "lexyy.cc" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -1238,7 +1224,7 @@ YY_DECL yy_match: do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1248,9 +1234,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 425 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 424 ); @@ -2234,7 +2220,7 @@ YY_RULE_SETUP #line 691 "pars0lex.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2237 "lexyy.cc" +#line 2223 "lexyy.cc" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(comment): case YY_STATE_EOF(quoted): @@ -2316,7 +2302,7 @@ case YY_STATE_EOF(id): { (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -2369,6 +2355,7 @@ case YY_STATE_EOF(id): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -2411,7 +2398,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -2424,21 +2411,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1); + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = static_cast(b->yy_buf_size * 2); + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2447,11 +2434,12 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -2459,9 +2447,8 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1); + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; } @@ -2470,7 +2457,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -2480,7 +2467,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart( yyin ); } else @@ -2494,12 +2481,15 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -2513,11 +2503,11 @@ static int yy_get_next_buffer (void) /* yy_get_previous_state - get the state just before the EOB char was reached */ - yy_state_type yy_get_previous_state (void) + static yy_state_type yy_get_previous_state (void) { yy_state_type yy_current_state; char *yy_cp; - + yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) @@ -2532,9 +2522,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 425 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -2545,7 +2535,7 @@ static int yy_get_next_buffer (void) * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { int yy_is_jam; char *yy_cp = (yy_c_buf_p); @@ -2560,14 +2550,18 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 425 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 424); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -2577,7 +2571,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -2592,7 +2586,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (int)((yy_c_buf_p) - (yytext_ptr)); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2609,14 +2603,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - yyrestart(yyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -2644,29 +2638,29 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ - void yyrestart (FILE * input_file ) + static void yyrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); @@ -2685,7 +2679,7 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -2706,14 +2700,14 @@ static void yy_load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ static YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2722,24 +2716,24 @@ static void yy_load_buffer_state (void) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ - void yy_delete_buffer (YY_BUFFER_STATE b ) + static void yy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -2747,21 +2741,21 @@ static void yy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - yyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; - - yy_flush_buffer(b ); + + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -2776,15 +2770,15 @@ static void yy_load_buffer_state (void) } b->yy_is_interactive = 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ - void yy_flush_buffer (YY_BUFFER_STATE b ) + static void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; @@ -2804,16 +2798,16 @@ static void yy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +MY_ATTRIBUTE((unused)) static void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; @@ -2835,15 +2829,15 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ -void yypop_buffer_state (void) +MY_ATTRIBUTE((unused)) static void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; @@ -2854,7 +2848,7 @@ void yypop_buffer_state (void) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -2864,15 +2858,15 @@ void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { - int num_to_alloc; - + yy_size_t num_to_alloc; + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -2889,10 +2883,9 @@ static void yyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; - num_to_alloc = static_cast( - (yy_buffer_stack_max) + grow_size); + num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) @@ -2910,9 +2903,9 @@ static void yyensure_buffer_stack (void) #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2936,81 +2929,81 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ -int yyget_lineno (void) +MY_ATTRIBUTE((unused)) static int yyget_lineno (void) { - + return yylineno; } /** Get the input stream. - * + * */ -FILE *yyget_in (void) +MY_ATTRIBUTE((unused)) static FILE *yyget_in (void) { return yyin; } /** Get the output stream. - * + * */ -FILE *yyget_out (void) +MY_ATTRIBUTE((unused)) static FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. - * + * */ -yy_size_t yyget_leng (void) +MY_ATTRIBUTE((unused)) static int yyget_leng (void) { return yyleng; } /** Get the current token. - * + * */ -char *yyget_text (void) +MY_ATTRIBUTE((unused)) static char *yyget_text (void) { return yytext; } /** Set the current line number. - * @param line_number - * + * @param _line_number line number + * */ -void yyset_lineno (int line_number ) +MY_ATTRIBUTE((unused)) static void yyset_lineno (int _line_number ) { - - yylineno = line_number; + + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. - * + * @param _in_str A readable stream. + * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +MY_ATTRIBUTE((unused)) static void yyset_in (FILE * _in_str ) { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +MY_ATTRIBUTE((unused)) static void yyset_out (FILE * _out_str ) { - yyout = out_str ; + yyout = _out_str ; } -int yyget_debug (void) +MY_ATTRIBUTE((unused)) static int yyget_debug (void) { return yy_flex_debug; } -void yyset_debug (int bdebug ) +MY_ATTRIBUTE((unused)) static void yyset_debug (int _bdebug ) { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -3019,10 +3012,10 @@ static int yy_init_globals (void) * This function is called from yylex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; @@ -3031,8 +3024,8 @@ static int yy_init_globals (void) yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -3044,10 +3037,10 @@ static int yy_init_globals (void) /* yylex_destroy is for both reentrant and non-reentrant scanners. */ MY_ATTRIBUTE((unused)) static int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } @@ -3068,8 +3061,9 @@ MY_ATTRIBUTE((unused)) static int yylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; @@ -3077,7 +3071,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) @@ -3087,13 +3081,14 @@ static int yy_flex_strlen (yyconst char * s ) } #endif -void *yyalloc (yy_size_t size ) +static void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } -void *yyrealloc (void * ptr, yy_size_t size ) +static void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3101,12 +3096,12 @@ void *yyrealloc (void * ptr, yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } -void yyfree (void * ptr ) +static void yyfree (void * ptr ) { - free( (char*) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" @@ -3114,7 +3109,6 @@ void yyfree (void * ptr ) #line 691 "pars0lex.l" - /********************************************************************** Release any resources used by the lexer. */ UNIV_INTERN @@ -3122,10 +3116,8 @@ void pars_lexer_close(void) /*==================*/ { - if (yy_buffer_stack) - yylex_destroy(); - if (stringbuf) - free(stringbuf); + yylex_destroy(); + free(stringbuf); stringbuf = NULL; stringbuf_len_alloc = stringbuf_len = 0; } diff --git a/storage/xtradb/pars/make_flex.sh b/storage/xtradb/pars/make_flex.sh index c3db8aea298..2ddb1460640 100755 --- a/storage/xtradb/pars/make_flex.sh +++ b/storage/xtradb/pars/make_flex.sh @@ -1,6 +1,7 @@ #!/bin/bash # # Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 2017, 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 @@ -31,6 +32,7 @@ echo '#include "univ.i"' > $OUTFILE # a warning on Win64. Add the cast. Also define some symbols as static. sed -e ' s/'"$TMPFILE"'/'"$OUTFILE"'/; +s/^void yyset_extra *(YY_EXTRA_TYPE *user_defined *);// s/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/; s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/; s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) static \1/; @@ -38,11 +40,12 @@ s/\(void yy\(push\|pop\)_buffer_state\)/MY_ATTRIBUTE((unused)) static \1/; s/\(YY_BUFFER_STATE yy_create_buffer\)/static \1/; s/\(\(int\|void\) yy[gs]et_\)/MY_ATTRIBUTE((unused)) static \1/; s/\(void \*\?yy\(\(re\)\?alloc\|free\)\)/static \1/; -s/\(extern \)\?\(int yy\(leng\|lineno\|_flex_debug\)\)/static \2/; +s/extern int yy\(leng\|_flex_debug\|lineno\);//; +s/\(int yy\(leng\|lineno\|_flex_debug\)\)/static \1/; s/\(int yylex_destroy\)/MY_ATTRIBUTE((unused)) static \1/; -s/\(extern \)\?\(int yylex \)/UNIV_INTERN \2/; s/^\(\(FILE\|char\) *\* *yyget\)/MY_ATTRIBUTE((unused)) static \1/; -s/^\(extern \)\?\(\(FILE\|char\) *\* *yy\)/static \2/; +s/^extern \(\(FILE\|char\) *\* *yy\).*//; +s/^\(FILE\|char\) *\* *yy/static &/; ' < $TMPFILE >> $OUTFILE rm $TMPFILE diff --git a/storage/xtradb/pars/pars0lex.l b/storage/xtradb/pars/pars0lex.l index f800410fa3f..60756413c0a 100644 --- a/storage/xtradb/pars/pars0lex.l +++ b/storage/xtradb/pars/pars0lex.l @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1997, 2011, 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 @@ -64,9 +65,8 @@ Created 12/14/1997 Heikki Tuuri #define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error -/* Note: We cast &result to int* from yysize_t* */ #define YY_INPUT(buf, result, max_size) \ - pars_get_lex_chars(buf, (int*) &result, max_size) + result = pars_get_lex_chars(buf, max_size) /* String buffer for removing quotes */ static ulint stringbuf_len_alloc = 0; /* Allocated length */ @@ -697,10 +697,8 @@ void pars_lexer_close(void) /*==================*/ { - if (yy_buffer_stack) - yylex_destroy(); - if (stringbuf) - free(stringbuf); + yylex_destroy(); + free(stringbuf); stringbuf = NULL; stringbuf_len_alloc = stringbuf_len = 0; } diff --git a/storage/xtradb/pars/pars0pars.cc b/storage/xtradb/pars/pars0pars.cc index ce61d6e1e3b..24bbeb1d36d 100644 --- a/storage/xtradb/pars/pars0pars.cc +++ b/storage/xtradb/pars/pars0pars.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 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 @@ -2153,16 +2154,14 @@ pars_stored_procedure_call( /*************************************************************//** Retrieves characters to the lexical analyzer. */ UNIV_INTERN -int +size_t pars_get_lex_chars( /*===============*/ char* buf, /*!< in/out: buffer where to copy */ - int max_size) /*!< in: maximum number of characters which fit + size_t max_size) /*!< in: maximum number of characters which fit in the buffer */ { - int len; - - len = static_cast( + size_t len = size_t( pars_sym_tab_global->string_len - pars_sym_tab_global->next_char_pos); if (len == 0) { From f055da9b84bc9481917003a1ed0a702072c0f452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 1 Apr 2019 14:24:15 +0300 Subject: [PATCH 45/47] MDEV-19085 Assertion failures due to virtual columns after upgrading from 10.1 MariaDB before MDEV-5800 in version 10.2.2 did not support indexed virtual columns. Non-persistent virtual columns were hidden from storage engines. Only starting with MDEV-5800, InnoDB would create internal metadata on virtual columns. Similar to what was done in MDEV-18084, MDEV-18090, MDEV-18960, we adjust one more code path for the old tables. innobase_build_col_map(): Allocate space for virtual columns in col_map[] but leave the entries at ULINT_UNDEFINED, noting that the virtual columns were missing before the table was being rebuilt. --- storage/innobase/handler/handler0alter.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 7bae1a0a87f..9ea5b3d20f7 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -3022,10 +3022,17 @@ innobase_build_col_map( & Alter_inplace_info::ADD_COLUMN)); DBUG_ASSERT(!add_cols || dtuple_get_n_fields(add_cols) == dict_table_get_n_cols(new_table)); + DBUG_ASSERT(table->s->stored_fields > 0); + + size_t old_n_v_cols = old_n_v_cols = table->s->fields + - table->s->stored_fields; + DBUG_ASSERT(old_n_v_cols == old_table->n_v_cols + || table->s->frm_version < FRM_VER_EXPRESSSIONS); + DBUG_ASSERT(!old_n_v_cols || table->s->virtual_fields); ulint* col_map = static_cast( mem_heap_alloc( - heap, (old_table->n_cols + old_table->n_v_cols) + heap, (size_t(old_table->n_cols) + old_n_v_cols) * sizeof *col_map)); List_iterator_fast cf_it( @@ -3039,10 +3046,12 @@ innobase_build_col_map( col_map[old_i] = ULINT_UNDEFINED; } - for (uint old_i = 0; old_i < old_table->n_v_cols; old_i++) { + for (uint old_i = 0; old_i < old_n_v_cols; old_i++) { col_map[old_i + old_table->n_cols] = ULINT_UNDEFINED; } + const bool omits_virtual = ha_innobase::omits_virtual_cols(*table->s); + while (const Create_field* new_field = cf_it++) { bool is_v = !new_field->stored_in_db(); ulint num_old_v = 0; @@ -3051,8 +3060,11 @@ innobase_build_col_map( const Field* field = table->field[old_i]; if (!field->stored_in_db()) { if (is_v && new_field->field == field) { - col_map[old_table->n_cols + num_v] - = num_old_v; + if (!omits_virtual) { + col_map[old_table->n_cols + + num_v] + = num_old_v; + } num_old_v++; goto found_col; } @@ -3081,7 +3093,7 @@ found_col: DBUG_ASSERT(i == altered_table->s->fields - num_v); - i = table->s->fields - old_table->n_v_cols; + i = table->s->fields - old_n_v_cols; /* Add the InnoDB hidden FTS_DOC_ID column, if any. */ if (i + DATA_N_SYS_COLS < old_table->n_cols) { From d59ad6972bc70c32ad756db0a8f8f64df3c7f80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 1 Apr 2019 18:13:11 +0300 Subject: [PATCH 46/47] MDEV-19085: Fix a typo that was caught by GCC 5.4 --- storage/innobase/handler/handler0alter.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 9ea5b3d20f7..d3d250e1026 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -3024,8 +3024,7 @@ innobase_build_col_map( == dict_table_get_n_cols(new_table)); DBUG_ASSERT(table->s->stored_fields > 0); - size_t old_n_v_cols = old_n_v_cols = table->s->fields - - table->s->stored_fields; + const size_t old_n_v_cols = table->s->fields - table->s->stored_fields; DBUG_ASSERT(old_n_v_cols == old_table->n_v_cols || table->s->frm_version < FRM_VER_EXPRESSSIONS); DBUG_ASSERT(!old_n_v_cols || table->s->virtual_fields); From b88f3786484e22759c8402494b8b9cc1e7a1cc46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 2 Apr 2019 08:48:54 +0300 Subject: [PATCH 47/47] Omit the definition of unused function yyset_extra() This is follow-up for commit 619d22dde54ffe483ef8a57e49ec802b0e30c6bf to fix the cmake -DWITH_EMBEDDED_SERVER build. --- storage/innobase/pars/lexyy.cc | 2 +- storage/innobase/pars/make_flex.sh | 4 ++-- storage/xtradb/pars/lexyy.cc | 2 +- storage/xtradb/pars/make_flex.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/storage/innobase/pars/lexyy.cc b/storage/innobase/pars/lexyy.cc index 54fe182ae6b..33de48e7b2f 100644 --- a/storage/innobase/pars/lexyy.cc +++ b/storage/innobase/pars/lexyy.cc @@ -1017,7 +1017,7 @@ MY_ATTRIBUTE((unused)) static void yyset_debug ( int debug_flag ); YY_EXTRA_TYPE yyget_extra ( void ); -MY_ATTRIBUTE((unused)) static void yyset_extra ( YY_EXTRA_TYPE user_defined ); + MY_ATTRIBUTE((unused)) static FILE *yyget_in ( void ); diff --git a/storage/innobase/pars/make_flex.sh b/storage/innobase/pars/make_flex.sh index 2ddb1460640..54aebb259d9 100755 --- a/storage/innobase/pars/make_flex.sh +++ b/storage/innobase/pars/make_flex.sh @@ -1,7 +1,7 @@ #!/bin/bash # # 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 @@ -32,7 +32,7 @@ echo '#include "univ.i"' > $OUTFILE # a warning on Win64. Add the cast. Also define some symbols as static. sed -e ' s/'"$TMPFILE"'/'"$OUTFILE"'/; -s/^void yyset_extra *(YY_EXTRA_TYPE *user_defined *);// +s/^void *yyset_extra *( *YY_EXTRA_TYPE *user_defined *) *;// s/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/; s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/; s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) static \1/; diff --git a/storage/xtradb/pars/lexyy.cc b/storage/xtradb/pars/lexyy.cc index 54fe182ae6b..33de48e7b2f 100644 --- a/storage/xtradb/pars/lexyy.cc +++ b/storage/xtradb/pars/lexyy.cc @@ -1017,7 +1017,7 @@ MY_ATTRIBUTE((unused)) static void yyset_debug ( int debug_flag ); YY_EXTRA_TYPE yyget_extra ( void ); -MY_ATTRIBUTE((unused)) static void yyset_extra ( YY_EXTRA_TYPE user_defined ); + MY_ATTRIBUTE((unused)) static FILE *yyget_in ( void ); diff --git a/storage/xtradb/pars/make_flex.sh b/storage/xtradb/pars/make_flex.sh index 2ddb1460640..54aebb259d9 100755 --- a/storage/xtradb/pars/make_flex.sh +++ b/storage/xtradb/pars/make_flex.sh @@ -1,7 +1,7 @@ #!/bin/bash # # 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 @@ -32,7 +32,7 @@ echo '#include "univ.i"' > $OUTFILE # a warning on Win64. Add the cast. Also define some symbols as static. sed -e ' s/'"$TMPFILE"'/'"$OUTFILE"'/; -s/^void yyset_extra *(YY_EXTRA_TYPE *user_defined *);// +s/^void *yyset_extra *( *YY_EXTRA_TYPE *user_defined *) *;// s/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/; s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/; s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) static \1/;