diff --git a/mysql-test/r/check_constraint.result b/mysql-test/r/check_constraint.result index 7447550ed0937..fcda0a84fcbaa 100644 --- a/mysql-test/r/check_constraint.result +++ b/mysql-test/r/check_constraint.result @@ -140,6 +140,8 @@ create table t1 (a int, b int, check(a>0)); alter table t1 drop column a; ERROR 42S22: Unknown column 'a' in 'CHECK' drop table t1; +create or replace table t1( c1 int auto_increment primary key, check( c1 > 0 or c1 is null ) ); +ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the CHECK clause of `c1` create table t1 (a int check (@b in (select user from mysql.user))); ERROR HY000: Function or expression 'select ...' cannot be used in the CHECK clause of `a` create table t1 (a int check (a > @b)); diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result index 207a2ca354947..bf662130d5a6d 100644 --- a/mysql-test/r/cte_recursive.result +++ b/mysql-test/r/cte_recursive.result @@ -2560,3 +2560,213 @@ m m1 m2 drop table value_nodes, module_nodes, module_arguments, module_results; +# +# mdev-12519: recursive references in subqueries +# +create table t1 (lp char(4) not null, rp char(4) not null); +insert into t1 values +('p1','p2'), ('p2','p3'), ('p3','p4'), ('p4','p5'), +('p2','p7'), ('p7','p8'), ('p8','p3'), ('p8','p4'); +set standard_compliant_cte=0; +with recursive +reachables(p) as +( +select lp from t1 where lp = 'p1' + union +select t1.rp from reachables, t1 +where t1.lp = reachables.p +) +select * from reachables; +p +p1 +p2 +p3 +p7 +p4 +p8 +p5 +with recursive +reachables(p) as +( +select lp from t1 where lp = 'p1' + union +select t1.rp from reachables, t1 +where 'p3' not in (select * from reachables) and +t1.lp = reachables.p +) +select * from reachables; +p +p1 +p2 +p3 +p7 +with recursive +reachables(p) as +( +select lp from t1 where lp = 'p1' + union +select t1.rp from reachables, t1 +where 'p3' not in (select p from reachables where p <= 'p5' + union +select p from reachables where p > 'p5') and +t1.lp = reachables.p +) +select * from reachables; +p +p1 +p2 +p3 +p7 +prepare stmt from " +with recursive +reachables(p) as +( + select lp from t1 where lp = 'p1' + union + select t1.rp from reachables, t1 + where 'p3' not in (select p from reachables where p <= 'p5' + union + select p from reachables where p > 'p5') and + t1.lp = reachables.p +) +select * from reachables; +"; +execute stmt; +p +p1 +p2 +p3 +p7 +execute stmt; +p +p1 +p2 +p3 +p7 +deallocate prepare stmt; +drop table t1; +create table objects(v char(4) not null); +insert into objects values +('v1'), ('v2'), ('v3'), ('v4'), ('v5'), +('v6'), ('v7'), ('v8'), ('v9'), ('v10'); +create table modules(m char(4) not null); +insert into modules values +('m1'), ('m2'), ('m3'), ('m4'); +create table module_arguments(m char(4) not null, v char(4) not null); +insert into module_arguments values +('m1','v3'), ('m1','v9'), +('m2','v4'), ('m2','v7'), +('m3','v6'), ('m4','v2'); +create table module_results(m char(4) not null, v char(4) not null); +insert into module_results values +('m1','v4'), +('m2','v1'), ('m2','v6'), +('m3','v10'), ('m4','v7'); +set standard_compliant_cte=0; +with recursive +reached_objects as +( +select v, 'init' as m from objects where v in ('v3','v7','v9') +union +select module_results.v, module_results.m from module_results, applied_modules +where module_results.m = applied_modules.m +), +applied_modules as +( +select * from modules where 1=0 +union +select modules.m +from +modules +where +not exists (select * from module_arguments +where module_arguments.m = modules.m and +module_arguments.v not in +(select v from reached_objects)) +) +select * from reached_objects; +v m +v3 init +v7 init +v9 init +v4 m1 +v1 m2 +v6 m2 +v10 m3 +with recursive +reached_objects as +( +select v, 'init' as m from objects where v in ('v3','v7','v9') +union +select module_results.v, module_results.m from module_results, applied_modules +where module_results.m = applied_modules.m +), +applied_modules as +( +select * from modules where 1=0 +union +select modules.m +from +modules +where +'v6' not in (select v from reached_objects) and +not exists (select * from module_arguments +where module_arguments.m = modules.m and +module_arguments.v not in +(select v from reached_objects)) +) +select * from reached_objects; +v m +v3 init +v7 init +v9 init +v4 m1 +v1 m2 +v6 m2 +prepare stmt from " +with recursive +reached_objects as +( + select v, 'init' as m from objects where v in ('v3','v7','v9') + union + select module_results.v, module_results.m from module_results, applied_modules + where module_results.m = applied_modules.m +), +applied_modules as +( + select * from modules where 1=0 + union + select modules.m + from + modules + where + 'v6' not in (select v from reached_objects) and + not exists (select * from module_arguments + where module_arguments.m = modules.m and + module_arguments.v not in + (select v from reached_objects)) +) +select * from reached_objects; +"; +execute stmt; +v m +v3 init +v7 init +v9 init +v4 m1 +v1 m2 +v6 m2 +execute stmt; +v m +v3 init +v7 init +v9 init +v4 m1 +v1 m2 +v6 m2 +deallocate prepare stmt; +drop table objects, modules, module_arguments, module_results; +set standard_compliant_cte=default; +select @@standard_compliant_cte; +@@standard_compliant_cte +1 diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result index 548c533c12eca..253cb41214637 100644 --- a/mysql-test/r/default.result +++ b/mysql-test/r/default.result @@ -1932,6 +1932,21 @@ SELECT * FROM t1; a b c 2003-02-01 2003-05-01 12:05:55 128885 DROP TABLE t1; +CREATE OR REPLACE TABLE t1 ( col INT DEFAULT ( 1 LIKE ( NOW() BETWEEN '2000-01-01' AND '2012-12-12' ) ) ); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `col` int(11) DEFAULT (1 like (current_timestamp() between '2000-01-01' and '2012-12-12')) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SET timestamp = UNIX_TIMESTAMP( '2004-04-04' ); +INSERT INTO t1 VALUES( DEFAULT ); +SET timestamp = DEFAULT; +INSERT INTO t1 VALUES( DEFAULT ); +SELECT * FROM t1; +col +1 +0 +DROP TABLE t1; # # Hybrid type functions # diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result index 34310be1e2a40..e8a7af4de1f60 100644 --- a/mysql-test/r/derived_cond_pushdown.result +++ b/mysql-test/r/derived_cond_pushdown.result @@ -7134,7 +7134,7 @@ EXPLAIN { "query_block": { "select_id": 1, - "const_condition": "0 or (2,(subquery#3))", + "const_condition": "2 < 2 or (2,(subquery#3))", "table": { "table_name": "t1", "access_type": "system", @@ -7218,7 +7218,7 @@ EXPLAIN { "query_block": { "select_id": 1, - "const_condition": "0 or (2,(subquery#3))", + "const_condition": "2 < 2 or (2,(subquery#3))", "table": { "table_name": "t1", "access_type": "system", @@ -7684,7 +7684,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "v1.b = 2", + "attached_condition": "v1.b = count(t2.c)", "materialized": { "query_block": { "select_id": 3, @@ -7741,7 +7741,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "v1.f = 2", + "attached_condition": "v1.f = count(t.pk)", "materialized": { "query_block": { "select_id": 3, @@ -7761,7 +7761,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "v2.pk > 2" + "attached_condition": "v2.pk > count(t.pk)" }, "buffer_type": "flat", "buffer_size": "256Kb", @@ -7820,7 +7820,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "sq.i = 3", + "attached_condition": "sq.i = min(t2.j)", "materialized": { "query_block": { "select_id": 2, @@ -7877,7 +7877,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "sq.i = 2.7100000381469727", + "attached_condition": "sq.i = min(t2.j)", "materialized": { "query_block": { "select_id": 2, @@ -7929,7 +7929,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "sq.i = 3.21", + "attached_condition": "sq.i = min(t2.j)", "materialized": { "query_block": { "select_id": 2, @@ -7981,7 +7981,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "sq.i = 'aa'", + "attached_condition": "sq.i = min(t2.j)", "materialized": { "query_block": { "select_id": 2, @@ -8035,7 +8035,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "sq.i = 2007-05-28 00:00:00", + "attached_condition": "sq.i = min(t2.j)", "materialized": { "query_block": { "select_id": 2, @@ -8087,7 +8087,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "sq.i = 2007-05-28", + "attached_condition": "sq.i = min(t2.j)", "materialized": { "query_block": { "select_id": 2, @@ -8139,7 +8139,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "sq.i = 10:00:02", + "attached_condition": "sq.i = min(t2.j)", "materialized": { "query_block": { "select_id": 2, @@ -8230,7 +8230,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "v1.c = NULL", + "attached_condition": "v1.c = min(t2.c)", "materialized": { "query_block": { "select_id": 3, @@ -8333,7 +8333,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "((1,(subquery#2))) or v1.c = 'foo'", + "attached_condition": "(1,(subquery#2)) or v1.c = 'foo'", "materialized": { "query_block": { "select_id": 3, diff --git a/mysql-test/r/explain_json.result b/mysql-test/r/explain_json.result index ab9fd528ad250..f6af5a4dd9386 100644 --- a/mysql-test/r/explain_json.result +++ b/mysql-test/r/explain_json.result @@ -813,7 +813,7 @@ EXPLAIN "ref": ["func"], "rows": 2, "filtered": 100, - "attached_condition": "trigcond((outer_t1.a) = t1.a or t1.a is null)", + "attached_condition": "trigcond(outer_t1.a = t1.a or t1.a is null)", "using_index": true } }, @@ -827,7 +827,7 @@ EXPLAIN "buffer_type": "flat", "buffer_size": "256Kb", "join_type": "BNL", - "attached_condition": "t2.b <> outer_t1.a and trigcond((outer_t1.a) = t1.a or t1.a is null)" + "attached_condition": "t2.b <> outer_t1.a and trigcond(outer_t1.a = t1.a or t1.a is null)" } } } @@ -1108,7 +1108,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "(case when convert(t1.a using utf8) = (_utf8'a' collate utf8_bin) then NULL else t1.a end)" + "attached_condition": "(case when convert(t1.a using utf8) = _utf8'a' collate utf8_bin then NULL else t1.a end)" } } } diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 28f5cf635d094..3c57ab980c3af 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -2371,7 +2371,7 @@ EXPLAIN "used_key_parts": ["a", "b"], "rows": 7, "filtered": 100, - "attached_condition": "(t1.a,t1.b) in (((2,3)),((3,3)),((8,8)),((7,7)))" + "attached_condition": "(t1.a,t1.b) in ((2,3),(3,3),(8,8),(7,7))" } } } @@ -2431,7 +2431,7 @@ EXPLAIN "used_key_parts": ["a"], "rows": 5, "filtered": 100, - "attached_condition": "(t1.a,t1.b + t1.a) in (((4,9)),((8,8)),((7,7)))" + "attached_condition": "(t1.a,t1.b + t1.a) in ((4,9),(8,8),(7,7))" } } } @@ -2498,7 +2498,7 @@ EXPLAIN "rows": 3, "filtered": 100, "index_condition": "t2.d is not null", - "attached_condition": "(t2.d,t2.e) in (((3,3)),((7,7)),((2,2)))" + "attached_condition": "(t2.d,t2.e) in ((3,3),(7,7),(2,2))" }, "table": { "table_name": "t1", @@ -2581,7 +2581,7 @@ EXPLAIN "ref": ["test.t1.a"], "rows": 12, "filtered": 100, - "attached_condition": "(t1.a,t2.e) in (((3,3)),((7,7)),((8,8))) and length(t2.f) = 1" + "attached_condition": "(t1.a,t2.e) in ((3,3),(7,7),(8,8)) and length(t2.f) = 1" } } } @@ -2666,7 +2666,7 @@ EXPLAIN "used_key_parts": ["e"], "rows": 6, "filtered": 100, - "attached_condition": "(t2.d,t2.e) in (((4,4)),((7,7)),((8,8))) and length(t2.f) = 1 and t2.d is not null" + "attached_condition": "(t2.d,t2.e) in ((4,4),(7,7),(8,8)) and length(t2.f) = 1 and t2.d is not null" }, "table": { "table_name": "t1", @@ -2716,7 +2716,7 @@ EXPLAIN "rows": 5, "filtered": 100, "index_condition": "t2.d is not null", - "attached_condition": "(t2.d,t2.e) in (((4,4)),((7,7)),((8,8))) and length(t2.f) = 1" + "attached_condition": "(t2.d,t2.e) in ((4,4),(7,7),(8,8)) and length(t2.f) = 1" }, "table": { "table_name": "t1", @@ -2830,7 +2830,7 @@ EXPLAIN "ref": ["test.t1.a"], "rows": 3, "filtered": 100, - "attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),((7,7)),((8,8))) and length(t2.f) = 1" + "attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),(7,7),(8,8)) and length(t2.f) = 1" } } } @@ -2870,7 +2870,7 @@ EXPLAIN "rows": 13, "filtered": 100, "index_condition": "t1.a is not null", - "attached_condition": "(t1.a,2) in (((2,2)),((7,7)),((8,8))) and length(t1.c) = 1" + "attached_condition": "(t1.a,2) in ((2,2),(7,7),(8,8)) and length(t1.c) = 1" }, "table": { "table_name": "t2", @@ -2958,7 +2958,7 @@ EXPLAIN "rows": 13, "filtered": 100, "index_condition": "t1.a is not null", - "attached_condition": "(t1.a,1 + 1) in (((2,2)),((7,7)),((8,8))) and length(t1.c) = 1" + "attached_condition": "(t1.a,1 + 1) in ((2,2),(7,7),(8,8)) and length(t1.c) = 1" }, "table": { "table_name": "t2", diff --git a/mysql-test/r/range_mrr_icp.result b/mysql-test/r/range_mrr_icp.result index f2860aaab7678..445f0877586a2 100644 --- a/mysql-test/r/range_mrr_icp.result +++ b/mysql-test/r/range_mrr_icp.result @@ -2373,7 +2373,7 @@ EXPLAIN "used_key_parts": ["a", "b"], "rows": 7, "filtered": 100, - "attached_condition": "(t1.a,t1.b) in (((2,3)),((3,3)),((8,8)),((7,7)))", + "attached_condition": "(t1.a,t1.b) in ((2,3),(3,3),(8,8),(7,7))", "mrr_type": "Rowid-ordered scan" } } @@ -2434,7 +2434,7 @@ EXPLAIN "used_key_parts": ["a"], "rows": 5, "filtered": 100, - "attached_condition": "(t1.a,t1.b + t1.a) in (((4,9)),((8,8)),((7,7)))", + "attached_condition": "(t1.a,t1.b + t1.a) in ((4,9),(8,8),(7,7))", "mrr_type": "Rowid-ordered scan" } } @@ -2503,7 +2503,7 @@ EXPLAIN "rows": 3, "filtered": 100, "index_condition": "t2.d is not null", - "attached_condition": "(t2.d,t2.e) in (((3,3)),((7,7)),((2,2)))", + "attached_condition": "(t2.d,t2.e) in ((3,3),(7,7),(2,2))", "mrr_type": "Rowid-ordered scan" }, "table": { @@ -2588,7 +2588,7 @@ EXPLAIN "ref": ["test.t1.a"], "rows": 12, "filtered": 100, - "attached_condition": "(t1.a,t2.e) in (((3,3)),((7,7)),((8,8))) and length(t2.f) = 1" + "attached_condition": "(t1.a,t2.e) in ((3,3),(7,7),(8,8)) and length(t2.f) = 1" } } } @@ -2673,7 +2673,7 @@ EXPLAIN "used_key_parts": ["e"], "rows": 6, "filtered": 100, - "attached_condition": "(t2.d,t2.e) in (((4,4)),((7,7)),((8,8))) and length(t2.f) = 1 and t2.d is not null", + "attached_condition": "(t2.d,t2.e) in ((4,4),(7,7),(8,8)) and length(t2.f) = 1 and t2.d is not null", "mrr_type": "Rowid-ordered scan" }, "table": { @@ -2724,7 +2724,7 @@ EXPLAIN "rows": 5, "filtered": 100, "index_condition": "t2.d is not null", - "attached_condition": "(t2.d,t2.e) in (((4,4)),((7,7)),((8,8))) and length(t2.f) = 1", + "attached_condition": "(t2.d,t2.e) in ((4,4),(7,7),(8,8)) and length(t2.f) = 1", "mrr_type": "Rowid-ordered scan" }, "table": { @@ -2840,7 +2840,7 @@ EXPLAIN "ref": ["test.t1.a"], "rows": 3, "filtered": 100, - "attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),((7,7)),((8,8))) and length(t2.f) = 1" + "attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),(7,7),(8,8)) and length(t2.f) = 1" } } } @@ -2880,7 +2880,7 @@ EXPLAIN "rows": 13, "filtered": 100, "index_condition": "t1.a is not null", - "attached_condition": "(t1.a,2) in (((2,2)),((7,7)),((8,8))) and length(t1.c) = 1", + "attached_condition": "(t1.a,2) in ((2,2),(7,7),(8,8)) and length(t1.c) = 1", "mrr_type": "Rowid-ordered scan" }, "table": { @@ -2969,7 +2969,7 @@ EXPLAIN "rows": 13, "filtered": 100, "index_condition": "t1.a is not null", - "attached_condition": "(t1.a,1 + 1) in (((2,2)),((7,7)),((8,8))) and length(t1.c) = 1", + "attached_condition": "(t1.a,1 + 1) in ((2,2),(7,7),(8,8)) and length(t1.c) = 1", "mrr_type": "Rowid-ordered scan" }, "table": { diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index ee7dcb76a183c..3f125598f9b9b 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -989,7 +989,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE('2015-0 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 00:00:00 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '00:00:00' # TIME cast + DATE literal SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09-11'; a @@ -999,7 +999,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 00:00:00 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '00:00:00' # TIME literal + DATE cast SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE('2015-09-11'); a @@ -1029,7 +1029,7 @@ SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE('2015-09-11') id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '00:00:00' and coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '00:00:00' and coalesce(`test`.`t1`.`a`) = '2015-09-11 00:00:00' # TIME-alike string literal + DATE literal SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE'2015-09-11'; a @@ -1049,7 +1049,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE('2015-09-11'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 0 and coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 0 and coalesce(`test`.`t1`.`a`) = '2015-09-11 00:00:00' # TIME-alike integer literal + DATE literal SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE'2015-09-11'; a @@ -1069,7 +1069,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME('00:0 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '2015-09-11 00:00:00' # DATE cast + TIME literal SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00:00'; a @@ -1079,7 +1079,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '2015-09-11 00:00:00' # DATE cast + TIME-alike string literal SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00'; a @@ -1089,7 +1089,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00' id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 and coalesce(`test`.`t1`.`a`) = '00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '2015-09-11 00:00:00' and coalesce(`test`.`t1`.`a`) = '00:00:00' # DATE cast + TIME-alike integer literal SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0; a @@ -1099,7 +1099,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00 and coalesce(`test`.`t1`.`a`) = 0 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '2015-09-11 00:00:00' and coalesce(`test`.`t1`.`a`) = 0 # DATE literal + TIME cast SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME('00:00:00'); a diff --git a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc index f132c2f2f63f9..ac70701e2cc6f 100644 --- a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc +++ b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc @@ -198,7 +198,7 @@ drop table t1; create table t1 (a int, b int generated always as(-b) virtual, c int generated always as (b + 1) virtual); --error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD create table t1 (a int, b int generated always as(-c) virtual, c int generated always as (b + 1) virtual); ---error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) stored, col_int_key int); --echo # Bug#20339347: FAIL TO USE CREATE ....SELECT STATEMENT TO CREATE A NEW TABLE diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result index c4a5499961497..e93d3bf025aff 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result @@ -259,7 +259,7 @@ ERROR 01000: Expression for field `b` is refering to uninitialized field `b` create table t1 (a int, b int generated always as(-c) virtual, c int generated always as (b + 1) virtual); ERROR 01000: Expression for field `b` is refering to uninitialized field `c` create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) stored, col_int_key int); -ERROR 01000: Expression for field `col_int_nokey` is refering to uninitialized field `pk` +ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the GENERATED ALWAYS AS clause of `pk` # Bug#20339347: FAIL TO USE CREATE ....SELECT STATEMENT TO CREATE A NEW TABLE create table t1 (a int, b int generated always as(-a) virtual, c int generated always as (b + 1) stored); insert into t1(a) values(1),(2); diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result index 0f66b3ad77962..563883adce017 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result @@ -259,7 +259,7 @@ ERROR 01000: Expression for field `b` is refering to uninitialized field `b` create table t1 (a int, b int generated always as(-c) virtual, c int generated always as (b + 1) virtual); ERROR 01000: Expression for field `b` is refering to uninitialized field `c` create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) stored, col_int_key int); -ERROR 01000: Expression for field `col_int_nokey` is refering to uninitialized field `pk` +ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the GENERATED ALWAYS AS clause of `pk` # Bug#20339347: FAIL TO USE CREATE ....SELECT STATEMENT TO CREATE A NEW TABLE create table t1 (a int, b int generated always as(-a) virtual, c int generated always as (b + 1) stored); insert into t1(a) values(1),(2); diff --git a/mysql-test/suite/innodb/r/autoinc_persist.result b/mysql-test/suite/innodb/r/autoinc_persist.result index e61262076ed28..083db5f7c3d21 100644 --- a/mysql-test/suite/innodb/r/autoinc_persist.result +++ b/mysql-test/suite/innodb/r/autoinc_persist.result @@ -953,8 +953,24 @@ INSERT INTO t32 VALUES(0), (0); SELECT MAX(a) AS `Expect 6` FROM t32; Expect 6 6 +FLUSH TABLES t33 FOR EXPORT; +backup: t33 +UNLOCK TABLES; +DROP TABLE t33; +CREATE TABLE t33 ( +a BIGINT NOT NULL PRIMARY KEY, +b BIGINT NOT NULL AUTO_INCREMENT, +KEY(b)) ENGINE = InnoDB; +ALTER TABLE t33 DISCARD TABLESPACE; +restore: t33 .ibd and .cfg files +ALTER TABLE t33 IMPORT TABLESPACE; INSERT INTO t33 VALUES(3, NULL); SELECT MAX(b) AS `Expect 4` FROM t33; Expect 4 4 +SELECT * FROM t33; +a b +10 1 +2 2 +3 4 DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t30, t32, t33; diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result index 27909b57df884..4d748d6ebed7b 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result @@ -796,7 +796,7 @@ t1 CREATE TABLE `t1` ( DROP TABLE test_wl5522.t1; CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; INSERT IGNORE INTO test_wl5522.t1 VALUES -(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200)); +(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 2731)); Warnings: Warning 1265 Data truncated for column 'c2' at row 1 INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; diff --git a/mysql-test/suite/innodb/r/innodb-wl5522.result b/mysql-test/suite/innodb/r/innodb-wl5522.result index e5782755dd8ff..4ef92cdfed94e 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522.result @@ -109,7 +109,7 @@ ALTER TABLE t2 DISCARD TABLESPACE; # List after t2 DISCARD t2.frm ALTER TABLE t2 IMPORT TABLESPACE; -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x4 and the meta-data file has 0x1) +ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1) ALTER TABLE t2 IMPORT TABLESPACE; ERROR HY000: Schema mismatch (Expected FSP_SPACE_FLAGS=0x*, .ibd file contains 0x*.) DROP TABLE t2; @@ -589,7 +589,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x0) +ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x0) unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; @@ -601,7 +601,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x0) +ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x0) unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; @@ -775,7 +775,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x1) +ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x0 and the meta-data file has 0x1) unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; @@ -787,7 +787,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x1) +ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1) unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; @@ -964,7 +964,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x21) +ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x21) unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; @@ -976,7 +976,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x21) +ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x0 and the meta-data file has 0x21) unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index 8bbe562e0f6a5..4c815c7c212dc 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -1547,7 +1547,7 @@ insert into t1 values('aaa'); set statement sql_mode = 'NO_ENGINE_SUBSTITUTION' for alter table t1 add index(a(1024)); Warnings: -Warning 1071 Specified key was too long; max key length is 767 bytes +Note 1071 Specified key was too long; max key length is 767 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/innodb/t/autoinc_persist.test b/mysql-test/suite/innodb/t/autoinc_persist.test index 904ed51f718e9..fd85b45fbfacb 100644 --- a/mysql-test/suite/innodb/t/autoinc_persist.test +++ b/mysql-test/suite/innodb/t/autoinc_persist.test @@ -520,7 +520,28 @@ SELECT MAX(a) AS `Expect 2` FROM t32; INSERT INTO t32 VALUES(0), (0); SELECT MAX(a) AS `Expect 6` FROM t32; +FLUSH TABLES t33 FOR EXPORT; +let MYSQLD_DATADIR=`select @@datadir`; +perl; +do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; +ib_backup_tablespaces("test", "t33"); +EOF +UNLOCK TABLES; +DROP TABLE t33; +CREATE TABLE t33 ( +a BIGINT NOT NULL PRIMARY KEY, +b BIGINT NOT NULL AUTO_INCREMENT, +KEY(b)) ENGINE = InnoDB; +ALTER TABLE t33 DISCARD TABLESPACE; +perl; +do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; +ib_discard_tablespaces("test", "t33"); +ib_restore_tablespaces("test", "t33"); +EOF +ALTER TABLE t33 IMPORT TABLESPACE; + INSERT INTO t33 VALUES(3, NULL); SELECT MAX(b) AS `Expect 4` FROM t33; +SELECT * FROM t33; DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t30, t32, t33; diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test index 68c5d3000cb45..6b6506e848196 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test @@ -1164,7 +1164,7 @@ DROP TABLE test_wl5522.t1; CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; INSERT IGNORE INTO test_wl5522.t1 VALUES - (100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200)); + (100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 2731)); INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; diff --git a/mysql-test/t/check_constraint.test b/mysql-test/t/check_constraint.test index 437463ee45736..c70a208f774d6 100644 --- a/mysql-test/t/check_constraint.test +++ b/mysql-test/t/check_constraint.test @@ -87,6 +87,12 @@ create table t1 (a int, b int, check(a>0)); alter table t1 drop column a; drop table t1; +# +# MDEV-11117 CHECK constraint fails on intermediate step of ALTER +# +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create or replace table t1( c1 int auto_increment primary key, check( c1 > 0 or c1 is null ) ); + # # MDEV-12421 Check constraint with query crashes server and renders DB unusable # diff --git a/mysql-test/t/cte_recursive.test b/mysql-test/t/cte_recursive.test index dd49582e7197e..26dbe2bccc021 100644 --- a/mysql-test/t/cte_recursive.test +++ b/mysql-test/t/cte_recursive.test @@ -1661,3 +1661,176 @@ select * from applied_modules; drop table value_nodes, module_nodes, module_arguments, module_results; +--echo # +--echo # mdev-12519: recursive references in subqueries +--echo # + +create table t1 (lp char(4) not null, rp char(4) not null); +insert into t1 values + ('p1','p2'), ('p2','p3'), ('p3','p4'), ('p4','p5'), + ('p2','p7'), ('p7','p8'), ('p8','p3'), ('p8','p4'); + +set standard_compliant_cte=0; + +with recursive +reachables(p) as +( + select lp from t1 where lp = 'p1' + union + select t1.rp from reachables, t1 + where t1.lp = reachables.p +) +select * from reachables; + +with recursive +reachables(p) as +( + select lp from t1 where lp = 'p1' + union + select t1.rp from reachables, t1 + where 'p3' not in (select * from reachables) and + t1.lp = reachables.p +) +select * from reachables; + +with recursive +reachables(p) as +( + select lp from t1 where lp = 'p1' + union + select t1.rp from reachables, t1 + where 'p3' not in (select p from reachables where p <= 'p5' + union + select p from reachables where p > 'p5') and + t1.lp = reachables.p +) +select * from reachables; + +prepare stmt from " +with recursive +reachables(p) as +( + select lp from t1 where lp = 'p1' + union + select t1.rp from reachables, t1 + where 'p3' not in (select p from reachables where p <= 'p5' + union + select p from reachables where p > 'p5') and + t1.lp = reachables.p +) +select * from reachables; +"; + +execute stmt; +execute stmt; + +deallocate prepare stmt; + +drop table t1; + +create table objects(v char(4) not null); +insert into objects values + ('v1'), ('v2'), ('v3'), ('v4'), ('v5'), + ('v6'), ('v7'), ('v8'), ('v9'), ('v10'); + +create table modules(m char(4) not null); +insert into modules values + ('m1'), ('m2'), ('m3'), ('m4'); + +create table module_arguments(m char(4) not null, v char(4) not null); +insert into module_arguments values + ('m1','v3'), ('m1','v9'), + ('m2','v4'), ('m2','v7'), + ('m3','v6'), ('m4','v2'); + +create table module_results(m char(4) not null, v char(4) not null); +insert into module_results values + ('m1','v4'), + ('m2','v1'), ('m2','v6'), + ('m3','v10'), ('m4','v7'); + +set standard_compliant_cte=0; + +with recursive +reached_objects as +( + select v, 'init' as m from objects where v in ('v3','v7','v9') + union + select module_results.v, module_results.m from module_results, applied_modules + where module_results.m = applied_modules.m +), +applied_modules as +( + select * from modules where 1=0 + union + select modules.m + from + modules + where + not exists (select * from module_arguments + where module_arguments.m = modules.m and + module_arguments.v not in + (select v from reached_objects)) +) +select * from reached_objects; + +with recursive +reached_objects as +( + select v, 'init' as m from objects where v in ('v3','v7','v9') + union + select module_results.v, module_results.m from module_results, applied_modules + where module_results.m = applied_modules.m +), +applied_modules as +( + select * from modules where 1=0 + union + select modules.m + from + modules + where + 'v6' not in (select v from reached_objects) and + not exists (select * from module_arguments + where module_arguments.m = modules.m and + module_arguments.v not in + (select v from reached_objects)) +) +select * from reached_objects; + +prepare stmt from " +with recursive +reached_objects as +( + select v, 'init' as m from objects where v in ('v3','v7','v9') + union + select module_results.v, module_results.m from module_results, applied_modules + where module_results.m = applied_modules.m +), +applied_modules as +( + select * from modules where 1=0 + union + select modules.m + from + modules + where + 'v6' not in (select v from reached_objects) and + not exists (select * from module_arguments + where module_arguments.m = modules.m and + module_arguments.v not in + (select v from reached_objects)) +) +select * from reached_objects; +"; + +execute stmt; +execute stmt; + +deallocate prepare stmt; + +drop table objects, modules, module_arguments, module_results; + +set standard_compliant_cte=default; +select @@standard_compliant_cte; + diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test index 2a043e78ea9b7..a3b349bb38476 100644 --- a/mysql-test/t/default.test +++ b/mysql-test/t/default.test @@ -1287,6 +1287,20 @@ INSERT INTO t1 (a,b) VALUES ('2003-02-01','2003-05-01 12:05:55'); SELECT * FROM t1; DROP TABLE t1; +# +# MDEV-10355 Weird error message upon CREATE TABLE with DEFAULT +# +# Column default value expression that includes a temporal function +# +CREATE OR REPLACE TABLE t1 ( col INT DEFAULT ( 1 LIKE ( NOW() BETWEEN '2000-01-01' AND '2012-12-12' ) ) ); +SHOW CREATE TABLE t1; +SET timestamp = UNIX_TIMESTAMP( '2004-04-04' ); +INSERT INTO t1 VALUES( DEFAULT ); +SET timestamp = DEFAULT; +INSERT INTO t1 VALUES( DEFAULT ); +SELECT * FROM t1; +DROP TABLE t1; + --echo # --echo # Hybrid type functions diff --git a/plugin/aws_key_management/CMakeLists.txt b/plugin/aws_key_management/CMakeLists.txt index 59fdd1684f213..2202efe9e4151 100644 --- a/plugin/aws_key_management/CMakeLists.txt +++ b/plugin/aws_key_management/CMakeLists.txt @@ -108,11 +108,19 @@ ELSE() SET_TARGET_PROPERTIES(${lib} PROPERTIES IMPORTED_LOCATION ${loc}) ENDFOREACH() + # To be compatible with older cmake, we use older version of the SDK + # We increase the version for macs however, so the newest mac could built it. + IF(APPLE) + SET(GIT_TAG "1.0.100") + ELSE() + SET(GIT_TAG "1.0.8") + ENDIF() + SET(AWS_SDK_PATCH_COMMAND ) ExternalProject_Add( aws_sdk_cpp GIT_REPOSITORY "https://github.com/awslabs/aws-sdk-cpp.git" - GIT_TAG "1.0.8" + GIT_TAG ${GIT_TAG} UPDATE_COMMAND "" SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/aws-sdk-cpp" ${byproducts} diff --git a/sql/field.h b/sql/field.h index 9559ba789b14c..8e939fd39cf10 100644 --- a/sql/field.h +++ b/sql/field.h @@ -549,7 +549,10 @@ inline bool is_temporal_type_with_time(enum_field_types type) enum enum_vcol_info_type { VCOL_GENERATED_VIRTUAL, VCOL_GENERATED_STORED, - VCOL_DEFAULT, VCOL_CHECK_FIELD, VCOL_CHECK_TABLE + VCOL_DEFAULT, VCOL_CHECK_FIELD, VCOL_CHECK_TABLE, + /* Additional types should be added here */ + /* Following is the highest value last */ + VCOL_TYPE_NONE = 127 // Since the 0 value is already in use }; static inline const char *vcol_type_name(enum_vcol_info_type type) @@ -564,6 +567,8 @@ static inline const char *vcol_type_name(enum_vcol_info_type type) case VCOL_CHECK_FIELD: case VCOL_CHECK_TABLE: return "CHECK"; + case VCOL_TYPE_NONE: + return "UNTYPED"; } return 0; } @@ -577,7 +582,8 @@ static inline const char *vcol_type_name(enum_vcol_info_type type) #define VCOL_NON_DETERMINISTIC 2 #define VCOL_SESSION_FUNC 4 /* uses session data, e.g. USER or DAYNAME */ #define VCOL_TIME_FUNC 8 -#define VCOL_IMPOSSIBLE 16 +#define VCOL_AUTO_INC 16 +#define VCOL_IMPOSSIBLE 32 #define VCOL_NOT_STRICTLY_DETERMINISTIC \ (VCOL_NON_DETERMINISTIC | VCOL_TIME_FUNC | VCOL_SESSION_FUNC) @@ -595,6 +601,7 @@ static inline const char *vcol_type_name(enum_vcol_info_type type) class Virtual_column_info: public Sql_alloc { private: + enum_vcol_info_type vcol_type; /* Virtual column expression type */ /* The following data is only updated by the parser and read when a Create_field object is created/initialized. @@ -612,7 +619,8 @@ class Virtual_column_info: public Sql_alloc uint flags; Virtual_column_info() - : field_type((enum enum_field_types)MYSQL_TYPE_VIRTUAL), + : vcol_type((enum_vcol_info_type)VCOL_TYPE_NONE), + field_type((enum enum_field_types)MYSQL_TYPE_VIRTUAL), in_partitioning_expr(FALSE), stored_in_db(FALSE), utf8(TRUE), expr(NULL), flags(0) { @@ -620,6 +628,19 @@ class Virtual_column_info: public Sql_alloc name.length= 0; }; ~Virtual_column_info() {} + enum_vcol_info_type get_vcol_type() const + { + return vcol_type; + } + void set_vcol_type(enum_vcol_info_type v_type) + { + vcol_type= v_type; + } + const char *get_vcol_type_name() const + { + DBUG_ASSERT(vcol_type != VCOL_TYPE_NONE); + return vcol_type_name(vcol_type); + } enum_field_types get_real_type() const { return field_type; diff --git a/sql/item.cc b/sql/item.cc index b99b3a23c8a7f..65b49fb163f28 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -616,8 +616,9 @@ void Item::print_value(String *str) str->append("NULL"); else { - switch (result_type()) { + switch (cmp_type()) { case STRING_RESULT: + case TIME_RESULT: append_unescaped(str, ptr->ptr(), ptr->length()); break; case DECIMAL_RESULT: @@ -626,7 +627,6 @@ void Item::print_value(String *str) str->append(*ptr); break; case ROW_RESULT: - case TIME_RESULT: DBUG_ASSERT(0); } } @@ -979,7 +979,7 @@ bool Item_field::register_field_in_write_map(void *arg) This means: - For default fields we can't access the same field or a field after itself that doesn't have a non-constant default value. - - A virtual fields can't access itself or a virtual field after itself. + - A virtual field can't access itself or a virtual field after itself. - user-specified values will not see virtual fields or default expressions, as in INSERT t1 (a) VALUES (b); - no virtual fields can access auto-increment values @@ -995,13 +995,6 @@ bool Item_field::check_field_expression_processor(void *arg) Field *org_field= (Field*) arg; if (field->flags & NO_DEFAULT_VALUE_FLAG) return 0; - if (field->flags & AUTO_INCREMENT_FLAG) - { - my_error(ER_EXPRESSION_REFERS_TO_UNINIT_FIELD, - MYF(0), - org_field->field_name, field->field_name); - return 1; - } if ((field->default_value && field->default_value->flags) || field->vcol_info) { if (field == org_field || @@ -4277,7 +4270,7 @@ Item_param::eq(const Item *item, bool binary_cmp) const void Item_param::print(String *str, enum_query_type query_type) { - if (state == NO_VALUE || query_type & QT_NO_DATA_EXPANSION) + if (state == NO_VALUE) { str->append('?'); } @@ -9597,17 +9590,28 @@ void Item_cache::store(Item *item) void Item_cache::print(String *str, enum_query_type query_type) { - if (value_cached) + if (example && // There is a cached item + (query_type & QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS)) // Caller is show-create-table { - print_value(str); - return; - } - str->append(STRING_WITH_LEN("(")); - if (example) + // Instead of "cache" or the cached value, print the cached item name example->print(str, query_type); + } else - Item::print(str, query_type); - str->append(')'); + { + if (value_cached && !(query_type & QT_NO_DATA_EXPANSION)) + { + print_value(str); + return; + } + if (!(query_type & QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS)) + str->append(STRING_WITH_LEN("(")); + if (example) + example->print(str, query_type); + else + Item::print(str, query_type); + if (!(query_type & QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS)) + str->append(')'); + } } /** @@ -9833,7 +9837,7 @@ int Item_cache_temporal::save_in_field(Field *field, bool no_conversions) void Item_cache_temporal::store_packed(longlong val_arg, Item *example_arg) { - /* An explicit values is given, save it. */ + /* An explicit value is given, save it. */ store(example_arg); value_cached= true; value= val_arg; @@ -10701,6 +10705,7 @@ void Virtual_column_info::print(String *str) QT_ITEM_IDENT_SKIP_DB_NAMES | QT_ITEM_IDENT_SKIP_TABLE_NAMES | QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS | - QT_TO_SYSTEM_CHARSET), + QT_TO_SYSTEM_CHARSET | + QT_NO_DATA_EXPANSION), LOWEST_PRECEDENCE); } diff --git a/sql/item.h b/sql/item.h index bd24b64d99ac4..fbce2889ce96d 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1463,6 +1463,7 @@ class Item: public Value_source, /*========= Item processors, to be used with Item::walk() ========*/ virtual bool remove_dependence_processor(void *arg) { return 0; } virtual bool cleanup_processor(void *arg); + virtual bool cleanup_excluding_fields_processor(void *arg) { return cleanup_processor(arg); } virtual bool cleanup_excluding_const_fields_processor(void *arg) { return cleanup_processor(arg); } virtual bool collect_item_field_processor(void *arg) { return 0; } virtual bool collect_outer_ref_processor(void *arg) {return 0; } @@ -2726,6 +2727,11 @@ class Item_field :public Item_ident bool check_vcol_func_processor(void *arg) { context= 0; + if (field && (field->unireg_check == Field::NEXT_NUMBER)) + { + // Auto increment fields are unsupported + return mark_unsupported_function(field_name, arg, VCOL_FIELD_REF | VCOL_AUTO_INC); + } return mark_unsupported_function(field_name, arg, VCOL_FIELD_REF); } void cleanup(); @@ -2744,6 +2750,8 @@ class Item_field :public Item_ident virtual void print(String *str, enum_query_type query_type); bool exclusive_dependence_on_table_processor(void *map); bool exclusive_dependence_on_grouping_fields_processor(void *arg); + bool cleanup_excluding_fields_processor(void *arg) + { return field ? 0 : cleanup_processor(arg); } bool cleanup_excluding_const_fields_processor(void *arg) { return field && const_item() ? 0 : cleanup_processor(arg); } @@ -4407,6 +4415,14 @@ class Item_ref :public Item_ident { return depended_from != NULL; } bool exclusive_dependence_on_grouping_fields_processor(void *arg) { return depended_from != NULL; } + bool cleanup_excluding_fields_processor(void *arg) + { + Item *item= real_item(); + if (item && item->type() == FIELD_ITEM && + ((Item_field *)item)->field) + return 0; + return cleanup_processor(arg); + } bool cleanup_excluding_const_fields_processor(void *arg) { Item *item= real_item(); @@ -5545,8 +5561,26 @@ class Item_cache: public Item_basic_constant, } bool check_vcol_func_processor(void *arg) { + if (example) + { + Item::vcol_func_processor_result *res= (Item::vcol_func_processor_result*)arg; + example->check_vcol_func_processor(arg); + if (res->errors & VCOL_NOT_STRICTLY_DETERMINISTIC) + res->errors|= VCOL_SESSION_FUNC; + return false; + } return mark_unsupported_function("cache", arg, VCOL_IMPOSSIBLE); } + bool cleanup_excluding_fields_processor(void* arg) + { + cleanup(); + return 0; + } + void cleanup() + { + clear(); + Item_basic_constant::cleanup(); + } /** Check if saved item has a non-NULL value. Will cache value of saved item if not already done. diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index b04c88e9cd800..ba40418b9c41a 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -40,6 +40,7 @@ #include "set_var.h" #include "sql_select.h" #include "sql_parse.h" // check_stack_overrun +#include "sql_cte.h" #include "sql_test.h" double get_post_group_estimate(JOIN* join, double join_op_rows); @@ -312,7 +313,8 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref) else goto end; - if ((uncacheable= engine->uncacheable() & ~UNCACHEABLE_EXPLAIN)) + if ((uncacheable= engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) || + with_recursive_reference) { const_item_cache= 0; if (uncacheable & UNCACHEABLE_RAND) @@ -917,7 +919,7 @@ table_map Item_subselect::used_tables() const bool Item_subselect::const_item() const { DBUG_ASSERT(thd); - return (thd->lex->context_analysis_only ? + return (thd->lex->context_analysis_only || with_recursive_reference ? FALSE : forced_const || const_item_cache); } @@ -937,7 +939,8 @@ void Item_subselect::update_used_tables() if (!(engine->uncacheable() & ~UNCACHEABLE_EXPLAIN)) { // did all used tables become static? - if (!(used_tables_cache & ~engine->upper_select_const_tables())) + if (!(used_tables_cache & ~engine->upper_select_const_tables()) && + ! with_recursive_reference) const_item_cache= 1; } } @@ -1740,7 +1743,7 @@ bool Item_in_subselect::val_bool() if (forced_const) return value; DBUG_ASSERT((engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) || - ! engine->is_executed()); + ! engine->is_executed() || with_recursive_reference); null_value= was_null= FALSE; if (exec()) { @@ -2833,7 +2836,8 @@ bool Item_exists_subselect::exists2in_processor(void *opt_arg) join->having || first_select->with_sum_func || !first_select->leaf_tables.elements|| - !join->conds) + !join->conds || + with_recursive_reference) DBUG_RETURN(FALSE); DBUG_ASSERT(first_select->order_list.elements == 0 && @@ -3485,6 +3489,11 @@ int subselect_single_select_engine::get_identifier() return select_lex->select_number; } +void subselect_single_select_engine::force_reexecution() +{ + executed= false; +} + void subselect_single_select_engine::cleanup() { DBUG_ENTER("subselect_single_select_engine::cleanup"); @@ -3513,6 +3522,11 @@ bool subselect_union_engine::is_executed() const return unit->executed; } +void subselect_union_engine::force_reexecution() +{ + unit->executed= false; +} + /* Check if last execution of the subquery engine produced any rows @@ -3829,7 +3843,8 @@ int subselect_single_select_engine::exec() tab->read_record.read_record= tab->save_read_record; } executed= 1; - if (!(uncacheable() & ~UNCACHEABLE_EXPLAIN)) + if (!(uncacheable() & ~UNCACHEABLE_EXPLAIN) && + !item->with_recursive_reference) item->make_const(); thd->where= save_where; thd->lex->current_select= save_select; @@ -6676,6 +6691,13 @@ void subselect_table_scan_engine::cleanup() } +void Item_subselect::register_as_with_rec_ref(With_element *with_elem) +{ + with_elem->sq_with_rec_ref.link_in_list(this, &this->next_with_rec_ref); + with_recursive_reference= true; +} + + /* Create an execution tracker for the expression cache we're using for this subselect; add the tracker to the query plan. diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 22fc48391decf..4c4af25edf5b4 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -32,6 +32,7 @@ class subselect_engine; class subselect_hash_sj_engine; class Item_bool_func2; class Comp_creator; +class With_element; typedef class st_select_lex SELECT_LEX; @@ -135,6 +136,9 @@ class Item_subselect :public Item_result_field, */ bool with_recursive_reference; + /* To link Item_subselects containing references to the same recursive CTE */ + Item_subselect *next_with_rec_ref; + enum subs_type {UNKNOWN_SUBS, SINGLEROW_SUBS, EXISTS_SUBS, IN_SUBS, ALL_SUBS, ANY_SUBS}; @@ -256,6 +260,7 @@ class Item_subselect :public Item_result_field, return TRUE; } + void register_as_with_rec_ref(With_element *with_elem); void init_expr_cache_tracker(THD *thd); Item* build_clone(THD *thd, MEM_ROOT *mem_root) { return 0; } @@ -831,6 +836,7 @@ class subselect_engine: public Sql_alloc, virtual bool no_rows() = 0; virtual enum_engine_type engine_type() { return ABSTRACT_ENGINE; } virtual int get_identifier() { DBUG_ASSERT(0); return 0; } + virtual void force_reexecution() {} protected: void set_row(List &item_list, Item_cache **row); }; @@ -864,6 +870,7 @@ class subselect_single_select_engine: public subselect_engine bool no_rows(); virtual enum_engine_type engine_type() { return SINGLE_SELECT_ENGINE; } int get_identifier(); + void force_reexecution(); friend class subselect_hash_sj_engine; friend class Item_in_subselect; @@ -894,6 +901,7 @@ class subselect_union_engine: public subselect_engine bool temp= FALSE); bool no_tables(); bool is_executed() const; + void force_reexecution(); bool no_rows(); virtual enum_engine_type engine_type() { return UNION_ENGINE; } }; diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc index d76ee13a010ac..c9976baeabd44 100644 --- a/sql/sql_cte.cc +++ b/sql/sql_cte.cc @@ -1229,6 +1229,7 @@ bool st_select_lex::check_subqueries_with_recursive_references() continue; Item_subselect *subq= (Item_subselect *) sl_master->item; subq->with_recursive_reference= true; + subq->register_as_with_rec_ref(tbl->with); } } return false; diff --git a/sql/sql_cte.h b/sql/sql_cte.h index 227461a16b3c0..3d4a5f825f7aa 100644 --- a/sql/sql_cte.h +++ b/sql/sql_cte.h @@ -118,6 +118,9 @@ class With_element : public Sql_alloc stage and is used at the execution stage. */ select_union_recursive *rec_result; + + /* List of Item_subselects containing recursive references to this CTE */ + SQL_I_List sq_with_rec_ref; With_element(LEX_STRING *name, List list, diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2cdc8d19733a9..c5e4aa5a0dd91 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -868,7 +868,8 @@ JOIN::prepare(TABLE_LIST *tables_init, select_lex->check_unrestricted_recursive( thd->variables.only_standard_compliant_cte)) DBUG_RETURN(-1); - select_lex->check_subqueries_with_recursive_references(); + if (select_lex->first_execution) + select_lex->check_subqueries_with_recursive_references(); int res= check_and_do_in_subquery_rewrites(this); diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 8390699511c33..582ecc3524913 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -1183,7 +1183,8 @@ bool st_select_lex_unit::exec() if (executed && !uncacheable && !describe) DBUG_RETURN(FALSE); executed= 1; - if (!(uncacheable & ~UNCACHEABLE_EXPLAIN) && item) + if (!(uncacheable & ~UNCACHEABLE_EXPLAIN) && item && + !item->with_recursive_reference) item->make_const(); saved_error= optimize(); @@ -1518,6 +1519,12 @@ bool st_select_lex_unit::exec_recursive() if (with_element->level == 1) rec_table->reginfo.join_tab->preread_init_done= true; } + for (Item_subselect *sq= with_element->sq_with_rec_ref.first; + sq; + sq= sq->next_with_rec_ref) + { + sq->engine->force_reexecution(); + } thd->lex->current_select= lex_select_save; err: diff --git a/sql/table.cc b/sql/table.cc index fae17fd8f20b5..cca4f314d69d3 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1973,6 +1973,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, unireg_check == Field::TIMESTAMP_DN_FIELD) { reg_field->default_value= new (&share->mem_root) Virtual_column_info(); + reg_field->default_value->set_vcol_type(VCOL_DEFAULT); reg_field->default_value->stored_in_db= 1; share->default_expressions++; } @@ -2372,6 +2373,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (!(vcol_info= new (&share->mem_root) Virtual_column_info())) goto err; + /* The following can only be true for check_constraints */ if (field_nr != UINT_MAX16) @@ -2381,6 +2383,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, } vcol_screen_pos+= FRM_VCOL_NEW_HEADER_SIZE; + vcol_info->set_vcol_type((enum_vcol_info_type) type); vcol_info->name.length= name_length; if (name_length) vcol_info->name.str= strmake_root(&share->mem_root, @@ -2734,7 +2737,7 @@ bool fix_session_vcol_expr(THD *thd, Virtual_column_info *vcol) if (!(vcol->flags & (VCOL_TIME_FUNC|VCOL_SESSION_FUNC))) DBUG_RETURN(0); - vcol->expr->cleanup(); + vcol->expr->walk(&Item::cleanup_excluding_fields_processor, 0, 0); DBUG_ASSERT(!vcol->expr->fixed); DBUG_RETURN(fix_vcol_expr(thd, vcol)); } @@ -2818,9 +2821,24 @@ static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, int error= func_expr->walk(&Item::check_vcol_func_processor, 0, &res); if (error || (res.errors & VCOL_IMPOSSIBLE)) - { // this can only happen if the frm was corrupted + { + // this can only happen if the frm was corrupted my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), res.name, - "???", "?????"); + vcol->get_vcol_type_name(), vcol->name.str); + DBUG_RETURN(1); + } + else if (res.errors & VCOL_AUTO_INC) + { + /* + An auto_increment field may not be used in an expression for + a check constraint, a default value or a generated column + + Note that this error condition is not detected during parsing + of the statement because the field item does not have a field + pointer at that time + */ + my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), + "AUTO_INCREMENT", vcol->get_vcol_type_name(), res.name); DBUG_RETURN(1); } vcol->flags= res.errors; @@ -2891,6 +2909,7 @@ unpack_vcol_info_from_frm(THD *thd, MEM_ROOT *mem_root, TABLE *table, if (error) goto end; + vcol_storage.vcol_info->set_vcol_type(vcol->get_vcol_type()); vcol_storage.vcol_info->stored_in_db= vcol->stored_in_db; vcol_storage.vcol_info->name= vcol->name; vcol_storage.vcol_info->utf8= vcol->utf8; diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index e1446b409d1d3..489b612a17a52 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -1602,7 +1602,8 @@ btr_page_reorganize_low( /* Copy the PAGE_MAX_TRX_ID or PAGE_ROOT_AUTO_INC. */ memcpy(page + (PAGE_HEADER + PAGE_MAX_TRX_ID), temp_page + (PAGE_HEADER + PAGE_MAX_TRX_ID), 8); - /* PAGE_MAX_TRX_ID is unused in clustered index pages, + /* PAGE_MAX_TRX_ID is unused in clustered index pages + (other than the root where it is repurposed as PAGE_ROOT_AUTO_INC), non-leaf pages, and in temporary tables. It was always zero-initialized in page_create() in all InnoDB versions. PAGE_MAX_TRX_ID must be nonzero on dict_index_is_sec_or_ibuf() @@ -1983,6 +1984,36 @@ btr_root_raise_and_insert( index); } + if (dict_index_is_sec_or_ibuf(index)) { + /* In secondary indexes and the change buffer, + PAGE_MAX_TRX_ID can be reset on the root page, because + the field only matters on leaf pages, and the root no + longer is a leaf page. (Older versions of InnoDB did + set PAGE_MAX_TRX_ID on all secondary index pages.) */ + if (root_page_zip) { + page_zip_write_header( + root_page_zip, + PAGE_HEADER + PAGE_MAX_TRX_ID + + root, 0, mtr); + } else { + mlog_write_ull(PAGE_HEADER + PAGE_MAX_TRX_ID + + root, 0, mtr); + } + } else { + /* PAGE_ROOT_AUTO_INC is only present in the clustered index + root page; on other clustered index pages, we want to reserve + the field PAGE_MAX_TRX_ID for future use. */ + if (new_page_zip) { + page_zip_write_header( + new_page_zip, + PAGE_HEADER + PAGE_MAX_TRX_ID + + new_page, 0, mtr); + } else { + mlog_write_ull(PAGE_HEADER + PAGE_MAX_TRX_ID + + new_page, 0, mtr); + } + } + /* If this is a pessimistic insert which is actually done to perform a pessimistic update then we have stored the lock information of the record to be inserted on the infimum of the @@ -2943,7 +2974,7 @@ btr_page_split_and_insert( btr_page_create(new_block, new_page_zip, cursor->index, btr_page_get_level(page, mtr), mtr); /* Only record the leaf level page splits. */ - if (btr_page_get_level(page, mtr) == 0) { + if (page_is_leaf(page)) { cursor->index->stat_defrag_n_page_split ++; cursor->index->stat_defrag_modified_counter ++; btr_defragment_save_defrag_stats_if_needed(cursor->index); @@ -5132,9 +5163,9 @@ btr_validate_level( rec = btr_cur_get_rec(&node_cur); fprintf(stderr, "\n" - "InnoDB: node ptr child page n:o %lu\n", - (ulong) btr_node_ptr_get_child_page_no( - rec, offsets)); + "InnoDB: node ptr child page n:o " + ULINTPF "\n", + btr_node_ptr_get_child_page_no(rec, offsets)); fputs("InnoDB: record on page ", stderr); rec_print_new(stderr, rec, offsets); diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index c15784a97a4e7..39d6508adf33c 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -2175,7 +2175,7 @@ btr_cur_open_at_index_side_func( page = buf_block_get_frame(block); if (height == ULINT_UNDEFINED - && btr_page_get_level(page, mtr) == 0 + && page_is_leaf(page) && rw_latch != RW_NO_LATCH && rw_latch != root_leaf_rw_latch) { /* We should retry to get the page, because the root page @@ -2532,7 +2532,7 @@ btr_cur_open_at_rnd_pos_func( page = buf_block_get_frame(block); if (height == ULINT_UNDEFINED - && btr_page_get_level(page, mtr) == 0 + && page_is_leaf(page) && rw_latch != RW_NO_LATCH && rw_latch != root_leaf_rw_latch) { /* We should retry to get the page, because the root page diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc index 8c4f27cc78a14..06cd131559088 100644 --- a/storage/innobase/btr/btr0defragment.cc +++ b/storage/innobase/btr/btr0defragment.cc @@ -233,7 +233,9 @@ btr_defragment_add_index( return NULL; } - if (btr_page_get_level(page, &mtr) == 0) { + ut_ad(page_is_root(page)); + + if (page_is_leaf(page)) { // Index root is a leaf page, no need to defragment. mtr_commit(&mtr); return NULL; diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc index 0d59481c4b542..307d6d0ec6c24 100644 --- a/storage/innobase/btr/btr0scrub.cc +++ b/storage/innobase/btr/btr0scrub.cc @@ -1,4 +1,5 @@ // Copyright (c) 2014, Google Inc. +// Copyright (c) 2017, MariaDB Corporation. /**************************************************//** @file btr/btr0scrub.cc @@ -102,16 +103,9 @@ log_scrub_failure( scrub_data->scrub_stat.page_split_failures_unknown++; } - buf_frame_t* buf = buf_block_get_frame(block); - const ulint space_id = mach_read_from_4(buf + FIL_PAGE_SPACE_ID); - const ulint page_no = mach_read_from_4(buf + FIL_PAGE_OFFSET); - fprintf(stderr, - "InnoDB: Warning: Failed to scrub index %s table %s page %lu in space %lu : %s\n", - index->name(), - index->table->name.m_name, - page_no, - space_id, - reason); + ib::warn() << "Failed to scrub index " << index->name + << " of table " << index->table->name + << " page " << block->page.id << ": " << reason; } /**************************************************************** @@ -152,11 +146,10 @@ btr_scrub_lock_dict_func(ulint space_id, bool lock_to_close_table, if (now >= last + 30) { fprintf(stderr, - "WARNING: %s:%u waited %lu seconds for" + "WARNING: %s:%u waited %ld seconds for" " dict_sys lock, space: " ULINTPF - " lock_to_close_table: %u\n", - file, line, (unsigned long)(now - start), - space_id, + " lock_to_close_table: %d\n", + file, line, long(now - start), space_id, lock_to_close_table); last = now; diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index a6ed277a90e04..d29025809245c 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -2,7 +2,7 @@ Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. -Copyright (c) 2013, 2017, MariaDB Corporation. All Rights Reserved. +Copyright (c) 2013, 2017, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -5266,7 +5266,7 @@ buf_page_init( ut_d(buf_LRU_print()); ut_d(buf_validate()); ut_d(buf_LRU_validate()); - ut_ad(0); + ut_error; } ut_ad(!block->page.in_zip_hash); @@ -6076,7 +6076,7 @@ buf_page_io_complete( } ib_push_warning(innobase_get_trx(), DB_DECRYPTION_FAILED, - "Table in tablespace %lu encrypted." + "Table in tablespace %u encrypted." "However key management plugin or used key_id %lu is not found or" " used encryption algorithm or method does not match." " Can't continue opening the table.", @@ -7066,15 +7066,16 @@ buf_print_io_instance( ut_ad(pool_info); fprintf(file, - "Buffer pool size %lu\n" - "Free buffers %lu\n" - "Database pages %lu\n" - "Old database pages %lu\n" - "Modified db pages %lu\n" + "Buffer pool size " ULINTPF "\n" + "Free buffers " ULINTPF "\n" + "Database pages " ULINTPF "\n" + "Old database pages " ULINTPF "\n" + "Modified db pages " ULINTPF "\n" "Percent of dirty pages(LRU & free pages): %.3f\n" "Max dirty pages percent: %.3f\n" - "Pending reads %lu\n" - "Pending writes: LRU %lu, flush list %lu, single page %lu\n", + "Pending reads " ULINTPF "\n" + "Pending writes: LRU " ULINTPF ", flush list " ULINTPF + ", single page " ULINTPF "\n", pool_info->pool_size, pool_info->free_list_len, pool_info->lru_len, @@ -7089,9 +7090,10 @@ buf_print_io_instance( pool_info->n_pending_flush_single_page); fprintf(file, - "Pages made young %lu, not young %lu\n" + "Pages made young " ULINTPF ", not young " ULINTPF "\n" "%.2f youngs/s, %.2f non-youngs/s\n" - "Pages read %lu, created %lu, written %lu\n" + "Pages read " ULINTPF ", created " ULINTPF + ", written " ULINTPF "\n" "%.2f reads/s, %.2f creates/s, %.2f writes/s\n", pool_info->n_pages_made_young, pool_info->n_pages_not_made_young, @@ -7105,23 +7107,22 @@ buf_print_io_instance( pool_info->pages_written_rate); if (pool_info->n_page_get_delta) { - double hit_rate = ((1000 * pool_info->page_read_delta) - / pool_info->n_page_get_delta); + double hit_rate = double(pool_info->page_read_delta) + / pool_info->n_page_get_delta; - if (hit_rate > 1000) { - hit_rate = 1000; + if (hit_rate > 1) { + hit_rate = 1; } - hit_rate = 1000 - hit_rate; - fprintf(file, - "Buffer pool hit rate %lu / 1000," - " young-making rate %lu / 1000 not %lu / 1000\n", - (ulint) hit_rate, - (ulint) (1000 * pool_info->young_making_delta - / pool_info->n_page_get_delta), - (ulint) (1000 * pool_info->not_young_making_delta - / pool_info->n_page_get_delta)); + "Buffer pool hit rate " ULINTPF " / 1000," + " young-making rate " ULINTPF " / 1000 not " + ULINTPF " / 1000\n", + ulint(1000 * (1 - hit_rate)), + ulint(1000 * double(pool_info->young_making_delta) + / pool_info->n_page_get_delta), + ulint(1000 * double(pool_info->not_young_making_delta) + / pool_info->n_page_get_delta)); } else { fputs("No buffer pool page gets since the last printout\n", file); @@ -7372,72 +7373,55 @@ buf_pool_reserve_tmp_slot( return (free_slot); } -/********************************************************************//** -Encrypts a buffer page right before it's flushed to disk -@param[in,out] bpage Page control block -@param[in,out] src_frame Source page -@param[in] space_id Tablespace id -@return either unencrypted source page or decrypted page. -*/ +/** Encryption and page_compression hook that is called just before +a page is written to disk. +@param[in,out] space tablespace +@param[in,out] bpage buffer page +@param[in] src_frame physical page frame that is being encrypted +@return page frame to be written to file +(may be src_frame or an encrypted/compressed copy of it) */ UNIV_INTERN byte* buf_page_encrypt_before_write( + fil_space_t* space, buf_page_t* bpage, - byte* src_frame, - ulint space_id) + byte* src_frame) { + ut_ad(space->id == bpage->id.space()); bpage->real_size = UNIV_PAGE_SIZE; fil_page_type_validate(src_frame); - if (bpage->id.page_no() == 0) { + switch (bpage->id.page_no()) { + case 0: /* Page 0 of a tablespace is not encrypted/compressed */ ut_ad(bpage->key_version == 0); return src_frame; - } - - if (space_id == TRX_SYS_SPACE && bpage->id.page_no() == TRX_SYS_PAGE_NO) { - /* don't encrypt/compress page as it contains address to dblwr buffer */ - bpage->key_version = 0; - return src_frame; - } - - fil_space_t* space = fil_space_acquire_silent(space_id); - - /* Tablespace must exist during write operation */ - if (!space) { - /* This could be true on discard if we have injected a error - case e.g. in innodb.innodb-wl5522-debug-zip so that space - is already marked as stop_new_ops = true. */ - return src_frame; + case TRX_SYS_PAGE_NO: + if (bpage->id.space() == 0) { + /* don't encrypt/compress page as it contains + address to dblwr buffer */ + bpage->key_version = 0; + return src_frame; + } } const page_size_t page_size(space->flags); fil_space_crypt_t* crypt_data = space->crypt_data; - bool encrypted = true; - - if (space->crypt_data != NULL && space->crypt_data->not_encrypted()) { - /* Encryption is disabled */ - encrypted = false; - } - - if (!srv_encrypt_tables && (crypt_data == NULL || crypt_data->is_default_encryption())) { - /* Encryption is disabled */ - encrypted = false; - } + const bool encrypted = crypt_data + && !crypt_data->not_encrypted() + && crypt_data->type != CRYPT_SCHEME_UNENCRYPTED + && (!crypt_data->is_default_encryption() + || srv_encrypt_tables); - /* Is encryption needed? */ - if (crypt_data == NULL || crypt_data->type == CRYPT_SCHEME_UNENCRYPTED) { - /* An unencrypted table */ + if (!encrypted) { bpage->key_version = 0; - encrypted = false; } - bool page_compressed = fil_space_is_page_compressed(bpage->id.space()); + bool page_compressed = FSP_FLAGS_HAS_PAGE_COMPRESSION(space->flags); if (!encrypted && !page_compressed) { /* No need to encrypt or page compress the page */ - fil_space_release(space); return src_frame; } @@ -7464,25 +7448,21 @@ buf_page_encrypt_before_write( bpage->real_size = page_size.physical(); slot->out_buf = dst_frame = tmp; -#ifdef UNIV_DEBUG - fil_page_type_validate(tmp); -#endif - + ut_d(fil_page_type_validate(tmp)); } else { /* First we compress the page content */ ulint out_len = 0; - ulint block_size = fil_space_get_block_size(space_id, bpage->id.page_no(), page_size.logical()); - - byte *tmp = fil_compress_page(space_id, - (byte *)src_frame, - slot->comp_buf, - page_size.logical(), - fil_space_get_page_compression_level(space_id), - block_size, - encrypted, - &out_len, - IF_LZO(slot->lzo_mem, NULL) - ); + + byte *tmp = fil_compress_page( + space, + (byte *)src_frame, + slot->comp_buf, + page_size.logical(), + fsp_flags_get_page_compression_level(space->flags), + fil_space_get_block_size(space, bpage->id.page_no()), + encrypted, + &out_len, + IF_LZO(slot->lzo_mem, NULL)); bpage->real_size = out_len; @@ -7505,7 +7485,6 @@ buf_page_encrypt_before_write( ut_d(fil_page_type_validate(dst_frame)); - fil_space_release(space); // return dst_frame which will be written return dst_frame; } @@ -7553,9 +7532,9 @@ buf_page_decrypt_after_read(buf_page_t* bpage) /* decompress using comp_buf to dst_frame */ fil_decompress_page(slot->comp_buf, - dst_frame, - size.logical(), - &bpage->write_size); + dst_frame, + ulong(size.logical()), + &bpage->write_size); /* Mark this slot as free */ slot->reserved = false; @@ -7600,9 +7579,9 @@ buf_page_decrypt_after_read(buf_page_t* bpage) ut_d(fil_page_type_validate(dst_frame)); /* decompress using comp_buf to dst_frame */ fil_decompress_page(slot->comp_buf, - dst_frame, - size.logical(), - &bpage->write_size); + dst_frame, + ulong(size.logical()), + &bpage->write_size); ut_d(fil_page_type_validate(dst_frame)); } diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index fcf6d55f660c1..6a0179f36ad55 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -595,7 +595,7 @@ buf_dblwr_process(void) /* Decompress the page before validating the checksum. */ fil_decompress_page( - NULL, read_buf, UNIV_PAGE_SIZE, + NULL, read_buf, srv_page_size, NULL, true); } @@ -621,7 +621,7 @@ buf_dblwr_process(void) /* Decompress the page before validating the checksum. */ fil_decompress_page( - NULL, page, UNIV_PAGE_SIZE, NULL, true); + NULL, page, srv_page_size, NULL, true); } if (!fil_space_verify_crypt_checksum(page, page_size, diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index a0ed243d74bf4..366e92a711230 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -1006,11 +1006,16 @@ buf_flush_write_block_low( buf_flush_t flush_type, /*!< in: type of flush */ bool sync) /*!< in: true if sync IO request */ { + fil_space_t* space = fil_space_acquire(bpage->id.space(), true); + if (!space) { + return; + } + ut_ad(space->purpose == FIL_TYPE_TEMPORARY + || space->purpose == FIL_TYPE_IMPORT + || space->purpose == FIL_TYPE_TABLESPACE); + const bool is_temp = space->purpose == FIL_TYPE_TEMPORARY; + ut_ad(is_temp == fsp_is_system_temporary(space->id)); page_t* frame = NULL; - ulint space_id = bpage->id.space(); - const bool is_temp = fsp_is_system_temporary(space_id); - bool atomic_writes = is_temp || fil_space_get_atomic_writes(space_id); - #ifdef UNIV_DEBUG buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); ut_ad(!buf_pool_mutex_own(buf_pool)); @@ -1076,28 +1081,27 @@ buf_flush_write_block_low( break; } - frame = buf_page_encrypt_before_write(bpage, frame, space_id); + frame = buf_page_encrypt_before_write(space, bpage, frame); /* Disable use of double-write buffer for temporary tablespace. Given the nature and load of temporary tablespace doublewrite buffer adds an overhead during flushing. */ - if (!srv_use_doublewrite_buf - || buf_dblwr == NULL - || srv_read_only_mode - || atomic_writes) { - - ut_ad(!srv_read_only_mode - || fsp_is_system_temporary(bpage->id.space())); + if (is_temp || space->atomic_write_supported + || !srv_use_doublewrite_buf + || buf_dblwr == NULL) { ulint type = IORequest::WRITE | IORequest::DO_NOT_WAKE; IORequest request(type, bpage); + /* TODO: pass the tablespace to fil_io() */ fil_io(request, sync, bpage->id, bpage->size, 0, bpage->size.physical(), - frame, bpage); + frame, bpage); } else { + ut_ad(!srv_read_only_mode); + if (flush_type == BUF_FLUSH_SINGLE_PAGE) { buf_dblwr_write_single_page(bpage, sync); } else { @@ -1111,13 +1115,17 @@ buf_flush_write_block_low( are working on. */ if (sync) { ut_ad(flush_type == BUF_FLUSH_SINGLE_PAGE); - fil_flush(bpage->id.space()); + if (!is_temp) { + fil_flush(space); + } /* true means we want to evict this page from the LRU list as well. */ buf_page_io_complete(bpage, true); } + fil_space_release(space); + /* Increment the counter of I/O operations used for selecting LRU policy. */ buf_LRU_stat_inc_io(); diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index d6d5db3dfa94c..c492ec6049435 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 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 @@ -2664,13 +2665,13 @@ buf_LRU_print_instance( } if (bpage->buf_fix_count) { - fprintf(stderr, "buffix count %lu ", - (ulong) bpage->buf_fix_count); + fprintf(stderr, "buffix count %u ", + bpage->buf_fix_count); } if (buf_page_get_io_fix(bpage)) { - fprintf(stderr, "io_fix %lu ", - (ulong) buf_page_get_io_fix(bpage)); + fprintf(stderr, "io_fix %d ", + buf_page_get_io_fix(bpage)); } if (bpage->oldest_modification) { @@ -2681,23 +2682,23 @@ buf_LRU_print_instance( const byte* frame; case BUF_BLOCK_FILE_PAGE: frame = buf_block_get_frame((buf_block_t*) bpage); - fprintf(stderr, "\ntype %lu" + fprintf(stderr, "\ntype " ULINTPF " index id " IB_ID_FMT "\n", - (ulong) fil_page_get_type(frame), + fil_page_get_type(frame), btr_page_get_index_id(frame)); break; case BUF_BLOCK_ZIP_PAGE: frame = bpage->zip.data; - fprintf(stderr, "\ntype %lu size %lu" + fprintf(stderr, "\ntype " ULINTPF " size " ULINTPF " index id " IB_ID_FMT "\n", - (ulong) fil_page_get_type(frame), - (ulong) bpage->size.physical(), + fil_page_get_type(frame), + bpage->size.physical(), btr_page_get_index_id(frame)); break; default: - fprintf(stderr, "\n!state %lu!\n", - (ulong) buf_page_get_state(bpage)); + fprintf(stderr, "\n!state %d!\n", + buf_page_get_state(bpage)); break; } diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc index 8b1900face75c..d819ad50ed969 100644 --- a/storage/innobase/data/data0data.cc +++ b/storage/innobase/data/data0data.cc @@ -429,7 +429,7 @@ dfield_print_also_hex( fputs(" Hex: ",stderr); for (i = 0; i < len; i++) { - fprintf(stderr, "%02lx", static_cast(*data++)); + fprintf(stderr, "%02x", *data++); } if (dfield_is_ext(dfield)) { diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 0db194b7e52bd..0d949a00b27b3 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -6597,7 +6597,7 @@ dict_table_schema_check( if ((ulint) table->n_def - n_sys_cols != req_schema->n_cols) { /* the table has a different number of columns than required */ ut_snprintf(errstr, errstr_sz, - "%s has %lu columns but should have %lu.", + "%s has %lu columns but should have " ULINTPF ".", ut_format_name(req_schema->table_name, buf, sizeof(buf)), table->n_def - n_sys_cols, @@ -6695,7 +6695,7 @@ dict_table_schema_check( ut_snprintf( errstr, errstr_sz, "Table %s has " ULINTPF " foreign key(s) pointing" - " to other tables, but it must have %lu.", + " to other tables, but it must have " ULINTPF ".", ut_format_name(req_schema->table_name, buf, sizeof(buf)), static_cast(table->foreign_set.size()), @@ -6707,7 +6707,7 @@ dict_table_schema_check( ut_snprintf( errstr, errstr_sz, "There are " ULINTPF " foreign key(s) pointing to %s, " - "but there must be %lu.", + "but there must be " ULINTPF ".", static_cast(table->referenced_set.size()), ut_format_name(req_schema->table_name, buf, sizeof(buf)), @@ -6747,7 +6747,7 @@ dict_fs2utf8( strconvert( &my_charset_filename, db, db_len, system_charset_info, - db_utf8, db_utf8_size, &errors); + db_utf8, uint(db_utf8_size), &errors); /* convert each # to @0023 in table name and store the result in buf */ const char* table = dict_remove_db_name(db_and_table); @@ -6774,7 +6774,7 @@ dict_fs2utf8( strconvert( &my_charset_filename, buf, (uint) (buf_p - buf), system_charset_info, - table_utf8, table_utf8_size, + table_utf8, uint(table_utf8_size), &errors); if (errors != 0) { diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index 9eb033a7eb9f1..47bab4141de4c 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -1,6 +1,7 @@ /***************************************************************************** -Copyright (c) 2009, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2009, 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 @@ -1046,8 +1047,8 @@ dict_stats_analyze_index_level( ulint* prev_rec_offsets; ulint i; - DEBUG_PRINTF(" %s(table=%s, index=%s, level=%lu)\n", __func__, - index->table->name, index->name, level); + DEBUG_PRINTF(" %s(table=%s, index=%s, level=" ULINTPF ")\n", + __func__, index->table->name, index->name, level); ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index), MTR_MEMO_SX_LOCK)); @@ -1292,7 +1293,7 @@ dict_stats_analyze_index_level( DEBUG_PRINTF(" %s(): total recs: " UINT64PF ", total pages: " UINT64PF - ", n_diff[%lu]: " UINT64PF "\n", + ", n_diff[" ULINTPF "]: " UINT64PF "\n", __func__, *total_recs, *total_pages, i, n_diff[i]); @@ -1553,7 +1554,7 @@ dict_stats_analyze_index_below_cur( page = buf_block_get_frame(block); - if (btr_page_get_level(page, mtr) == 0) { + if (page_is_leaf(page)) { /* leaf level */ break; } @@ -1598,7 +1599,7 @@ dict_stats_analyze_index_below_cur( } /* make sure we got a leaf page as a result from the above loop */ - ut_ad(btr_page_get_level(page, &mtr) == 0); + ut_ad(page_is_leaf(page)); /* scan the leaf page and find the number of distinct keys, when looking only at the first n_prefix columns; also estimate @@ -1912,8 +1913,9 @@ dict_stats_index_set_n_diff( index->stat_n_sample_sizes[n_prefix - 1] = data->n_leaf_pages_to_analyze; - DEBUG_PRINTF(" %s(): n_diff=" UINT64PF " for n_prefix=%lu" - " (%lu" + DEBUG_PRINTF(" %s(): n_diff=" UINT64PF + " for n_prefix=" ULINTPF + " (" ULINTPF " * " UINT64PF " / " UINT64PF " * " UINT64PF " / " UINT64PF ")\n", __func__, @@ -2068,8 +2070,8 @@ dict_stats_analyze_index( for (n_prefix = n_uniq; n_prefix >= 1; n_prefix--) { - DEBUG_PRINTF(" %s(): searching level with >=%llu" - " distinct records, n_prefix=%lu\n", + DEBUG_PRINTF(" %s(): searching level with >=%llu " + "distinct records, n_prefix=" ULINTPF "\n", __func__, N_DIFF_REQUIRED(index), n_prefix); /* Commit the mtr to release the tree S lock to allow @@ -2173,8 +2175,9 @@ dict_stats_analyze_index( } found_level: - DEBUG_PRINTF(" %s(): found level %lu that has " UINT64PF - " distinct records for n_prefix=%lu\n", + DEBUG_PRINTF(" %s(): found level " ULINTPF + " that has " UINT64PF + " distinct records for n_prefix=" ULINTPF "\n", __func__, level, n_diff_on_level[n_prefix - 1], n_prefix); /* here we are either on level 1 or the level that we are on @@ -2535,20 +2538,19 @@ dict_stats_save( ut_ad(!dict_index_is_ibuf(index)); - for (ulint i = 0; i < index->n_uniq; i++) { + for (unsigned i = 0; i < index->n_uniq; i++) { char stat_name[16]; char stat_description[1024]; - ulint j; ut_snprintf(stat_name, sizeof(stat_name), - "n_diff_pfx%02lu", i + 1); + "n_diff_pfx%02u", i + 1); /* craft a string that contains the column names */ ut_snprintf(stat_description, sizeof(stat_description), "%s", index->fields[0].name()); - for (j = 1; j <= i; j++) { + for (unsigned j = 1; j <= i; j++) { size_t len; len = strlen(stat_description); diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index db7efe89d37db..016b7c3d24eee 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -1,6 +1,6 @@ /***************************************************************************** Copyright (C) 2013, 2015, Google Inc. All Rights Reserved. -Copyright (c) 2014, 2017, MariaDB Corporation. All Rights Reserved. +Copyright (c) 2014, 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 @@ -647,7 +647,8 @@ fil_space_encrypt( comp_mem = (byte *)malloc(UNIV_PAGE_SIZE); uncomp_mem = (byte *)malloc(UNIV_PAGE_SIZE); memcpy(comp_mem, src_frame, UNIV_PAGE_SIZE); - fil_decompress_page(uncomp_mem, comp_mem, page_size.physical(), NULL); + fil_decompress_page(uncomp_mem, comp_mem, + srv_page_size, NULL); src = uncomp_mem; } @@ -657,7 +658,8 @@ fil_space_encrypt( /* Need to decompress the page if it was also compressed */ if (page_compressed_encrypted) { memcpy(comp_mem, tmp_mem, UNIV_PAGE_SIZE); - fil_decompress_page(tmp_mem, comp_mem, page_size.physical(), NULL); + fil_decompress_page(tmp_mem, comp_mem, + srv_page_size, NULL); } bool corrupted = buf_page_is_corrupted(true, tmp_mem, page_size, space); @@ -731,7 +733,8 @@ fil_space_decrypt( << " carries key_version " << key_version << " (should be undefined)"); - mach_write_to_4(src_frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, 0); + memset(src_frame + + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, 0, 4); } return false; @@ -1305,26 +1308,28 @@ fil_crypt_realloc_iops( if (10 * state->cnt_waited > state->batch) { /* if we waited more than 10% re-estimate max_iops */ - uint avg_wait_time_us = + ulint avg_wait_time_us = state->sum_waited_us / state->cnt_waited; + if (avg_wait_time_us == 0) { + avg_wait_time_us = 1; // prevent division by zero + } + DBUG_PRINT("ib_crypt", - ("thr_no: %u - update estimated_max_iops from %u to %u.", + ("thr_no: %u - update estimated_max_iops from %u to " + ULINTPF ".", state->thread_no, state->estimated_max_iops, 1000000 / avg_wait_time_us)); - if (avg_wait_time_us == 0) { - avg_wait_time_us = 1; // prevent division by zero - } - - state->estimated_max_iops = 1000000 / avg_wait_time_us; + state->estimated_max_iops = uint(1000000 / avg_wait_time_us); state->cnt_waited = 0; state->sum_waited_us = 0; } else { DBUG_PRINT("ib_crypt", - ("thr_no: %u only waited %lu%% skip re-estimate.", + ("thr_no: %u only waited " ULINTPF + "%% skip re-estimate.", state->thread_no, (100 * state->cnt_waited) / state->batch)); } @@ -1552,33 +1557,27 @@ fil_crypt_find_page_to_rotate( fil_space_crypt_t *crypt_data = space->crypt_data; - /* Space might already be dropped */ - if (crypt_data) { - mutex_enter(&crypt_data->mutex); - ut_ad(key_state->key_id == crypt_data->key_id); - - if (crypt_data->rotate_state.next_offset < - crypt_data->rotate_state.max_offset) { + mutex_enter(&crypt_data->mutex); + ut_ad(key_state->key_id == crypt_data->key_id); - state->offset = crypt_data->rotate_state.next_offset; - ulint remaining = crypt_data->rotate_state.max_offset - - crypt_data->rotate_state.next_offset; + bool found = crypt_data->rotate_state.max_offset >= + crypt_data->rotate_state.next_offset; - if (batch <= remaining) { - state->batch = batch; - } else { - state->batch = remaining; - } + if (found) { + state->offset = crypt_data->rotate_state.next_offset; + ulint remaining = crypt_data->rotate_state.max_offset - + crypt_data->rotate_state.next_offset; - crypt_data->rotate_state.next_offset += batch; - mutex_exit(&crypt_data->mutex); - return true; + if (batch <= remaining) { + state->batch = batch; + } else { + state->batch = remaining; } - - mutex_exit(&crypt_data->mutex); } - return false; + crypt_data->rotate_state.next_offset += batch; + mutex_exit(&crypt_data->mutex); + return found; } /*********************************************************************** @@ -2160,7 +2159,7 @@ DECLARE_THREAD(fil_crypt_thread)( fil_crypt_start_rotate_space(&new_state, &thr); /* iterate all pages (cooperativly with other threads) */ - while (!thr.should_shutdown() && thr.space && + while (!thr.should_shutdown() && fil_crypt_find_page_to_rotate(&new_state, &thr)) { /* rotate a (set) of pages */ @@ -2169,6 +2168,8 @@ DECLARE_THREAD(fil_crypt_thread)( /* If space is marked as stopping, release space and stop rotation. */ if (thr.space->is_stopping()) { + fil_crypt_complete_rotate_space( + &new_state, &thr); fil_space_release(thr.space); thr.space = NULL; break; diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 06ec31a7ed42b..d91ab3530a1d5 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -3859,8 +3859,6 @@ fil_ibd_create( return(DB_OUT_OF_FILE_SPACE); } - /* printf("Creating tablespace %s id %lu\n", path, space_id); */ - /* We have to write the space id to the file immediately and flush the file to disk. This is because in crash recovery we must be aware what tablespaces exist and what are their space id's, so that we can apply @@ -5489,6 +5487,24 @@ fil_flush( mutex_exit(&fil_system->mutex); } +/** Flush a tablespace. +@param[in,out] space tablespace to flush */ +void +fil_flush(fil_space_t* space) +{ + ut_ad(space->n_pending_ops > 0); + ut_ad(space->purpose == FIL_TYPE_TABLESPACE + || space->purpose == FIL_TYPE_IMPORT); + + if (!space->is_stopping()) { + mutex_enter(&fil_system->mutex); + if (!space->is_stopping()) { + fil_flush_low(space); + } + mutex_exit(&fil_system->mutex); + } +} + /** Flush to disk the writes in file spaces of the given type possibly cached by the OS. @param[in] purpose FIL_TYPE_TABLESPACE or FIL_TYPE_LOG */ @@ -5894,7 +5910,8 @@ fil_iterate( /* If the original page is page_compressed, we need to decompress page before we can update it. */ if (page_compressed) { - fil_decompress_page(NULL, dst, size, NULL); + fil_decompress_page(NULL, dst, ulong(size), + NULL); updated = true; } @@ -5956,12 +5973,13 @@ fil_iterate( if (page_compressed) { ulint len = 0; - byte * res = fil_compress_page(space_id, + byte * res = fil_compress_page( + NULL, src, NULL, size, dict_table_page_compression_level(iter.table), - fil_space_get_block_size(space_id, offset, size), + 512,/* FIXME: use proper block size */ encrypted, &len, NULL); @@ -5976,6 +5994,8 @@ fil_iterate( /* If tablespace is encrypted, encrypt page before we write it back. Note that we should not encrypt the buffer that is in buffer pool. */ + /* NOTE: At this stage of IMPORT the + buffer pool is not being used at all! */ if (decrypted && encrypted) { byte *dest = writeptr + (i * size); ulint space = mach_read_from_4( @@ -6823,73 +6843,24 @@ fil_space_keyrotate_next( return(space); } -/********************************************************************//** -Find correct node from file space -@return node */ -static -fil_node_t* -fil_space_get_node( - fil_space_t* space, /*!< in: file spage */ - ulint space_id, /*!< in: space id */ - os_offset_t* block_offset, /*!< in/out: offset in number of blocks */ - ulint byte_offset, /*!< in: remainder of offset in bytes; in - aio this must be divisible by the OS block - size */ - ulint len) /*!< in: how many bytes to read or write; this - must not cross a file boundary; in aio this - must be a block size multiple */ -{ - fil_node_t* node; - ut_ad(mutex_own(&fil_system->mutex)); - - node = UT_LIST_GET_FIRST(space->chain); - - for (;;) { - if (node == NULL) { - return(NULL); - } else if (fil_is_user_tablespace_id(space->id) - && node->size == 0) { - - /* We do not know the size of a single-table tablespace - before we open the file */ - break; - } else if (node->size > *block_offset) { - /* Found! */ - break; - } else { - *block_offset -= node->size; - node = UT_LIST_GET_NEXT(chain, node); - } - } - - return (node); -} - -/********************************************************************//** -Return block size of node in file space -@param[in] space_id space id -@param[in] block_offset page offset -@param[in] len page len -@return file block size */ +/** Determine the block size of the data file. +@param[in] space tablespace +@param[in] offset page number +@return block size */ UNIV_INTERN ulint -fil_space_get_block_size( - ulint space_id, - os_offset_t block_offset, - ulint len) +fil_space_get_block_size(const fil_space_t* space, unsigned offset) { ulint block_size = 512; - ut_ad(!mutex_own(&fil_system->mutex)); - - mutex_enter(&fil_system->mutex); - fil_space_t* space = fil_space_get_space(space_id); - - if (space) { - fil_node_t* node = fil_space_get_node(space, space_id, &block_offset, 0, len); - if (node) { - block_size = node->block_size; + for (fil_node_t* node = UT_LIST_GET_FIRST(space->chain); + node != NULL; + node = UT_LIST_GET_NEXT(chain, node)) { + block_size = node->block_size; + if (node->size > offset) { + break; } + offset -= node->size; } /* Currently supporting block size up to 4K, @@ -6898,8 +6869,6 @@ fil_space_get_block_size( block_size = 512; } - mutex_exit(&fil_system->mutex); - return block_size; } diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index 179f481c15e32..65c39eae89df4 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -85,8 +85,7 @@ UNIV_INTERN byte* fil_compress_page( /*==============*/ - ulint space_id, /*!< in: tablespace id of the - table. */ + fil_space_t* space, /*!< in,out: tablespace (NULL during IMPORT) */ byte* buf, /*!< in: buffer from which to write; in aio this must be appropriately aligned */ byte* out_buf, /*!< out: compressed buffer */ @@ -104,9 +103,12 @@ fil_compress_page( ulint write_size=0; /* Cache to avoid change during function execution */ ulint comp_method = innodb_compression_algorithm; - ulint orig_page_type; bool allocated=false; + /* page_compression does not apply to tables or tablespaces + that use ROW_FORMAT=COMPRESSED */ + ut_ad(!space || !page_size_t(space->flags).is_compressed()); + if (encrypted) { header_len += FIL_PAGE_COMPRESSION_METHOD_SIZE; } @@ -127,19 +129,13 @@ fil_compress_page( ut_ad(len); ut_ad(out_len); - /* read original page type */ - orig_page_type = mach_read_from_2(buf + FIL_PAGE_TYPE); - - fil_system_enter(); - fil_space_t* space = fil_space_get_by_id(space_id); - fil_system_exit(); - /* Let's not compress file space header or extent descriptor */ - if (orig_page_type == 0 || - orig_page_type == FIL_PAGE_TYPE_FSP_HDR || - orig_page_type == FIL_PAGE_TYPE_XDES || - orig_page_type == FIL_PAGE_PAGE_COMPRESSED) { + switch (fil_page_get_type(buf)) { + case 0: + case FIL_PAGE_TYPE_FSP_HDR: + case FIL_PAGE_TYPE_XDES: + case FIL_PAGE_PAGE_COMPRESSED: *out_len = len; goto err_exit; @@ -151,11 +147,9 @@ fil_compress_page( comp_level = page_zip_level; } -#ifdef UNIV_PAGECOMPRESS_DEBUG - ib_logf(IB_LOG_LEVEL_INFO, - "Preparing for compress for space %lu name %s len %lu.", - space_id, fil_space_name(space), len); -#endif /* UNIV_PAGECOMPRESS_DEBUG */ + DBUG_LOG("compress", "Preparing for space " + << (space ? space->id : 0) << " '" + << (space ? space->name : "(import)") << "' len " << len); write_size = UNIV_PAGE_SIZE - header_len; @@ -252,7 +246,8 @@ fil_compress_page( #endif /* HAVE_SNAPPY */ case PAGE_ZLIB_ALGORITHM: - err = compress2(out_buf+header_len, (ulong*)&write_size, buf, len, comp_level); + err = compress2(out_buf+header_len, (ulong*)&write_size, buf, + uLong(len), comp_level); if (err != Z_OK) { goto err_exit; @@ -304,13 +299,12 @@ fil_compress_page( comp_page = static_cast(ut_malloc_nokey(UNIV_PAGE_SIZE)); uncomp_page = static_cast(ut_malloc_nokey(UNIV_PAGE_SIZE)); memcpy(comp_page, out_buf, UNIV_PAGE_SIZE); - bool tsfound; - const page_size_t page_size = fil_space_get_page_size(space_id, &tsfound); - fil_decompress_page(uncomp_page, comp_page, len, NULL); + fil_decompress_page(uncomp_page, comp_page, ulong(len), NULL); - if (buf_page_is_corrupted(false, uncomp_page, page_size, space)) { - buf_page_print(uncomp_page, page_size, 0); + if (buf_page_is_corrupted(false, uncomp_page, univ_page_size, + space)) { + buf_page_print(uncomp_page, univ_page_size, 0); } ut_free(comp_page); @@ -339,11 +333,10 @@ fil_compress_page( #endif } -#ifdef UNIV_PAGECOMPRESS_DEBUG - ib_logf(IB_LOG_LEVEL_INFO, - "Compression succeeded for space %lu name %s len %lu out_len %lu.", - space_id, fil_space_name(space), len, write_size); -#endif /* UNIV_PAGECOMPRESS_DEBUG */ + DBUG_LOG("compress", "Succeeded for space " + << (space ? space->id : 0) << " '" + << (space ? space->name : "(import)") + << "' len " << len << " out_len " << write_size); srv_stats.page_compression_saved.add((len - write_size)); srv_stats.pages_page_compressed.inc(); @@ -362,17 +355,17 @@ fil_compress_page( /* If error we leave the actual page as it was */ #ifndef UNIV_PAGECOMPRESS_DEBUG - if (space && space->printed_compression_failure == false) { + if (space && !space->printed_compression_failure) { + space->printed_compression_failure = true; #endif ib::warn() << "Compression failed for space: " - << space_id << " name: " - << fil_space_name(space) << " len: " + << space->id << " name: " + << space->name << " len: " << len << " err: " << err << " write_size: " << write_size << " compression method: " << fil_get_compression_alg_name(comp_method) << "."; - space->printed_compression_failure = true; #ifndef UNIV_PAGECOMPRESS_DEBUG } #endif @@ -633,21 +626,16 @@ fil_decompress_page( /* Note that as we have found the page is corrupted, so all this could be incorrect. */ ulint space_id = mach_read_from_4(buf+FIL_PAGE_SPACE_ID); - fil_system_enter(); - fil_space_t* space = fil_space_get_by_id(space_id); - fil_system_exit(); - - bool tsfound; - const page_size_t page_size = fil_space_get_page_size(space_id, &tsfound); + const FilSpace space(space_id, true); ib::error() << "Corruption: Page is marked as compressed" << " space: " << space_id << " name: " - << (space ? fil_space_name(space) : "NULL") + << (space() ? space()->name : "NULL") << " but uncompress failed with error: " << err << " size: " << actual_size << " len: " << len << " compression method: " << fil_get_compression_alg_name(compression_alg) << "."; - buf_page_print(buf, page_size, 0); + buf_page_print(buf, univ_page_size, 0); } diff --git a/storage/innobase/fts/fts0config.cc b/storage/innobase/fts/fts0config.cc index cca3d5fcd8759..4d41df1abf99b 100644 --- a/storage/innobase/fts/fts0config.cc +++ b/storage/innobase/fts/fts0config.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2007, 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 @@ -349,7 +350,7 @@ fts_config_set_index_ulint( ut_a(FTS_MAX_INT_LEN < FTS_MAX_CONFIG_VALUE_LEN); value.f_len = ut_snprintf( - (char*) value.f_str, FTS_MAX_INT_LEN, "%lu", int_value); + (char*) value.f_str, FTS_MAX_INT_LEN, ULINTPF, int_value); error = fts_config_set_index_value(trx, index, name, &value); @@ -422,7 +423,7 @@ fts_config_set_ulint( ut_a(FTS_MAX_INT_LEN < FTS_MAX_CONFIG_VALUE_LEN); value.f_len = my_snprintf( - (char*) value.f_str, FTS_MAX_INT_LEN, "%lu", int_value); + (char*) value.f_str, FTS_MAX_INT_LEN, ULINTPF, int_value); error = fts_config_set_value(trx, fts_table, name, &value); @@ -435,4 +436,3 @@ fts_config_set_ulint( return(error); } - diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index a7d09b5dd47b3..dd0e036170cb6 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, MariaDB Corporation. All Rights reserved. +Copyright (c) 2016, 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 @@ -2542,7 +2542,7 @@ fts_get_max_cache_size( { dberr_t error; fts_string_t value; - ulint cache_size_in_mb; + ulong cache_size_in_mb; /* Set to the default value. */ cache_size_in_mb = FTS_CACHE_SIZE_LOWER_LIMIT_IN_MB; diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc index beef71aa17836..bc1d173cc2927 100644 --- a/storage/innobase/fts/fts0que.cc +++ b/storage/innobase/fts/fts0que.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2007, 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 @@ -487,7 +488,7 @@ fts_query_lcs( len = FTS_ELEM(table, c, 0, 0); fts_print_lcs_table(table, r, c); - printf("\nLen=%lu\n", len); + printf("\nLen=" ULINTPF "\n", len); ut_free(table); diff --git a/storage/innobase/gis/gis0rtree.cc b/storage/innobase/gis/gis0rtree.cc index a558ce3f54d5f..d14bafff72b2f 100644 --- a/storage/innobase/gis/gis0rtree.cc +++ b/storage/innobase/gis/gis0rtree.cc @@ -837,6 +837,9 @@ rtr_split_page_move_rec_list( ulint max_to_move = 0; rtr_rec_move_t* rec_move = NULL; + ut_ad(!dict_index_is_ibuf(index)); + ut_ad(dict_index_is_spatial(index)); + rec_offs_init(offsets_); page_cur_set_before_first(block, &page_cursor); @@ -907,8 +910,7 @@ rtr_split_page_move_rec_list( same temp-table in parallel. max_trx_id is ignored for temp tables because it not required for MVCC. */ - if (dict_index_is_sec_or_ibuf(index) - && page_is_leaf(page) + if (page_is_leaf(page) && !dict_table_is_temporary(index->table)) { page_update_max_trx_id(new_block, NULL, page_get_max_trx_id(page), diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index cd1761d170f6a..62a8f02f5b922 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2297,7 +2297,8 @@ innobase_get_cset_width( if (cset != 0) { sql_print_warning( - "Unknown collation #%lu.", cset); + "Unknown collation #" ULINTPF ".", + cset); } } else { @@ -4212,9 +4213,8 @@ innobase_init( } else if (srv_max_io_capacity < srv_io_capacity) { sql_print_warning("InnoDB: innodb_io_capacity" " cannot be set higher than" - " innodb_io_capacity_max.\n" - "InnoDB: Setting" - " innodb_io_capacity to %lu\n", + " innodb_io_capacity_max." + "Setting innodb_io_capacity=%lu", srv_max_io_capacity); srv_io_capacity = srv_max_io_capacity; @@ -6273,9 +6273,10 @@ innobase_build_index_translation( if (index_mapping == NULL) { /* Report an error if index_mapping continues to be NULL and mysql_num_index is a non-zero value */ - sql_print_error("InnoDB: fail to allocate memory for" - " index translation table. Number of" - " Index:%lu, array size:%lu", + sql_print_error("InnoDB: fail to allocate memory for " + "index translation table. Number of " + "Index: " ULINTPF + ", array size:" ULINTPF, mysql_num_index, share->idx_trans_tbl.array_size); ret = false; @@ -6784,9 +6785,9 @@ ha_innobase::open( if (key_used_on_scan != MAX_KEY) { sql_print_warning( - "Table %s key_used_on_scan is %lu even" - " though there is no primary key inside" - " InnoDB.", name, (ulong) key_used_on_scan); + "Table %s key_used_on_scan is %u even " + "though there is no primary key inside " + "InnoDB.", name, key_used_on_scan); } } @@ -11030,7 +11031,8 @@ wsrep_append_foreign_key( if (rcode != DB_SUCCESS) { WSREP_ERROR( - "FK key set failed: %lu (%lu %lu), index: %s %s, %s", + "FK key set failed: " ULINTPF + " (" ULINTPF " " ULINTPF "), index: %s %s, %s", rcode, referenced, shared, (index) ? index->name() : "void index", (index && index->table) ? index->table->name.m_name : @@ -11092,8 +11094,9 @@ wsrep_append_foreign_key( copy); if (rcode) { - DBUG_PRINT("wsrep", ("row key failed: %lu", rcode)); - WSREP_ERROR("Appending cascaded fk row key failed: %s, %lu", + DBUG_PRINT("wsrep", ("row key failed: " ULINTPF, rcode)); + WSREP_ERROR("Appending cascaded fk row key failed: %s, " + ULINTPF, (wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void", rcode); return DB_ERROR; @@ -11372,13 +11375,7 @@ ha_innobase::position( len = key_info->key_length; } - /* We assume that the 'ref' value len is always fixed for the same - table. */ - - if (len != ref_length) { - sql_print_error("Stored ref len is %lu, but table ref len is" - " %lu", (ulong) len, (ulong) ref_length); - } + ut_ad(len == ref_length); } /*****************************************************************//** @@ -11714,8 +11711,8 @@ create_table_info_t::create_table_def() ER_CANT_CREATE_TABLE, "In InnoDB, charset-collation codes" " must be below 256." - " Unsupported code %lu.", - (ulong) charset_no); + " Unsupported code " ULINTPF ".", + charset_no); mem_heap_free(heap); dict_mem_table_free(table); @@ -12236,7 +12233,7 @@ create_table_info_t::create_options_are_invalid() push_warning_printf( m_thd, Sql_condition::WARN_LEVEL_WARN, ER_ILLEGAL_HA_CREATE_OPTION, - "InnoDB: invalid KEY_BLOCK_SIZE = %lu." + "InnoDB: invalid KEY_BLOCK_SIZE = %u." " Valid values are [1, 2, 4, 8, 16]", m_create_info->key_block_size); ret = "KEY_BLOCK_SIZE"; @@ -12727,7 +12724,7 @@ create_table_info_t::innobase_table_flags() push_warning_printf( m_thd, Sql_condition::WARN_LEVEL_WARN, ER_ILLEGAL_HA_CREATE_OPTION, - "InnoDB: ignoring KEY_BLOCK_SIZE=%lu.", + "InnoDB: ignoring KEY_BLOCK_SIZE=%u.", m_create_info->key_block_size); } } @@ -12749,7 +12746,7 @@ create_table_info_t::innobase_table_flags() push_warning_printf( m_thd, Sql_condition::WARN_LEVEL_WARN, ER_ILLEGAL_HA_CREATE_OPTION, - "InnoDB: ignoring KEY_BLOCK_SIZE=%lu" + "InnoDB: ignoring KEY_BLOCK_SIZE=%u" " unless ROW_FORMAT=COMPRESSED.", m_create_info->key_block_size); zip_allowed = false; @@ -15044,15 +15041,14 @@ ha_innobase::info_low( if (j + 1 > index->n_uniq) { sql_print_error( - "Index %s of %s has %lu columns" - " unique inside InnoDB, but" - " MariaDB is asking statistics for" - " %lu columns. Have you mixed" - " up .frm files from different" + "Index %s of %s has %u columns" + " unique inside InnoDB, but " + "MySQL is asking statistics for" + " %lu columns. Have you mixed " + "up .frm files from different " " installations? %s", index->name(), ib_table->name.m_name, - (unsigned long) index->n_uniq, j + 1, TROUBLESHOOTING_MSG); break; @@ -15582,11 +15578,9 @@ ha_innobase::check( push_warning_printf( thd, Sql_condition::WARN_LEVEL_WARN, ER_NOT_KEYFILE, - "InnoDB: Index '%-.200s' contains %lu" - " entries, should be %lu.", - index->name(), - (ulong) n_rows, - (ulong) n_rows_in_table); + "InnoDB: Index '%-.200s' contains " ULINTPF + " entries, should be " ULINTPF ".", + index->name(), n_rows, n_rows_in_table); is_ok = false; dict_set_corrupted( index, m_prebuilt->trx, @@ -17031,16 +17025,16 @@ innodb_show_rwlock_status( } buf1len = ut_snprintf( - buf1, sizeof buf1, "rwlock: %s:%lu", + buf1, sizeof buf1, "rwlock: %s:%u", innobase_basename(rw_lock->cfile_name), - static_cast(rw_lock->cline)); + rw_lock->cline); int buf2len; char buf2[IO_SIZE]; buf2len = ut_snprintf( - buf2, sizeof buf2, "waits=%lu", - static_cast(rw_lock->count_os_wait)); + buf2, sizeof buf2, "waits=%u", + rw_lock->count_os_wait); if (stat_print(thd, innobase_hton_name, hton_name_len, @@ -17059,16 +17053,16 @@ innodb_show_rwlock_status( char buf1[IO_SIZE]; buf1len = ut_snprintf( - buf1, sizeof buf1, "sum rwlock: %s:%lu", + buf1, sizeof buf1, "sum rwlock: %s:%u", innobase_basename(block_rwlock->cfile_name), - static_cast(block_rwlock->cline)); + block_rwlock->cline); int buf2len; char buf2[IO_SIZE]; buf2len = ut_snprintf( - buf2, sizeof buf2, "waits=%lu", - static_cast(block_rwlock_oswait_count)); + buf2, sizeof buf2, "waits=" ULINTPF, + block_rwlock_oswait_count); if (stat_print(thd, innobase_hton_name, hton_name_len, @@ -20282,9 +20276,9 @@ wsrep_innobase_kill_one_trx( WSREP_LOG_CONFLICT(bf_thd, thd, TRUE); - WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: " - TRX_ID_FMT, - signal, (long long)bf_seqno, + WSREP_DEBUG("BF kill (" ULINTPF ", seqno: " INT64PF + "), victim: (%lu) trx: " TRX_ID_FMT, + signal, bf_seqno, thd_get_thread_id(thd), victim_trx->id); @@ -22725,7 +22719,8 @@ ib_warn_row_too_big(const dict_table_t* table) push_warning_printf( thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_TO_BIG_ROW, - "Row size too large (> %lu). Changing some columns to TEXT" + "Row size too large (> " ULINTPF ")." + " Changing some columns to TEXT" " or BLOB %smay help. In current row format, BLOB prefix of" " %d bytes is stored inline.", free_space , prefix ? "or using ROW_FORMAT=DYNAMIC or" @@ -23070,7 +23065,7 @@ ib_push_frm_error( break; case DICT_FRM_INCONSISTENT_KEYS: - sql_print_error("InnoDB: Table %s contains %lu " + sql_print_error("InnoDB: Table %s contains " ULINTPF " " "indexes inside InnoDB, which " "is different from the number of " "indexes %u defined in the MariaDB " @@ -23085,7 +23080,7 @@ ib_push_frm_error( if (push_warning) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_NO_SUCH_INDEX, - "InnoDB: Table %s contains %lu " + "InnoDB: Table %s contains " ULINTPF " " "indexes inside InnoDB, which " "is different from the number of " "indexes %u defined in the MariaDB ", diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index 2fde0cb23b99e..7a4dc61069406 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -1472,8 +1472,8 @@ ibuf_print_ops( ut_a(UT_ARR_SIZE(op_names) == IBUF_OP_COUNT); for (i = 0; i < IBUF_OP_COUNT; i++) { - fprintf(file, "%s %lu%s", op_names[i], - (ulong) ops[i], (i < (IBUF_OP_COUNT - 1)) ? ", " : ""); + fprintf(file, "%s " ULINTPF "%s", op_names[i], + ops[i], (i < (IBUF_OP_COUNT - 1)) ? ", " : ""); } putc('\n', file); @@ -4928,12 +4928,12 @@ ibuf_print( mutex_enter(&ibuf_mutex); fprintf(file, - "Ibuf: size %lu, free list len %lu," - " seg size %lu, %lu merges\n", - (ulong) ibuf->size, - (ulong) ibuf->free_list_len, - (ulong) ibuf->seg_size, - (ulong) ibuf->n_merges); + "Ibuf: size " ULINTPF ", free list len " ULINTPF "," + " seg size " ULINTPF ", " ULINTPF " merges\n", + ibuf->size, + ibuf->free_list_len, + ibuf->seg_size, + ibuf->n_merges); fputs("merged operations:\n ", file); ibuf_print_ops(ibuf->n_merged_ops, file); @@ -4948,9 +4948,10 @@ ibuf_print( if (count > 0) { fprintf(stderr, - "Ibuf count for space/page %lu/%lu" - " is %lu\n", - (ulong) i, (ulong) j, (ulong) count); + "Ibuf count for page " + ULINTPF ":" ULINTPF "" + " is " ULINTPF "\n", + i, j, count); } } } diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 3aab242606dd8..c0b635ab8c9d6 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -1544,17 +1544,19 @@ buf_flush_update_zip_checksum( ulint size, lsn_t lsn); -/********************************************************************//** -The hook that is called just before a page is written to disk. -The function encrypts the content of the page and returns a pointer -to a frame that will be written instead of the real frame. */ +/** Encryption and page_compression hook that is called just before +a page is written to disk. +@param[in,out] space tablespace +@param[in,out] bpage buffer page +@param[in] src_frame physical page frame that is being encrypted +@return page frame to be written to file +(may be src_frame or an encrypted/compressed copy of it) */ UNIV_INTERN byte* buf_page_encrypt_before_write( -/*==========================*/ - buf_page_t* page, /*!< in/out: buffer page to be flushed */ - byte* frame, /*!< in: src frame */ - ulint space_id); /*!< in: space id */ + fil_space_t* space, + buf_page_t* bpage, + byte* src_frame); /** @brief The temporary memory structure. diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 580118f2fddd5..de4a983ba8162 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -393,13 +393,9 @@ dict_index_is_sec_or_ibuf( /*======================*/ const dict_index_t* index) /*!< in: index */ { - ulint type; - ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - type = index->type; - - return(!(type & DICT_CLUSTERED) || (type & DICT_IBUF)); + return((index->type & (DICT_CLUSTERED | DICT_IBUF)) != DICT_CLUSTERED); } /********************************************************************//** diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index e63550f26ff2f..4583b81c983ba 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -1216,6 +1216,11 @@ fil_flush( /*======*/ ulint space_id); /*!< in: file space id (this can be a group of log files or a tablespace of the database) */ +/** Flush a tablespace. +@param[in,out] space tablespace to flush */ +void +fil_flush(fil_space_t* space); + /** Flush to disk the writes in file spaces of the given type possibly cached by the OS. @param[in] purpose FIL_TYPE_TABLESPACE or FIL_TYPE_LOG */ @@ -1582,18 +1587,13 @@ void test_make_filepath(); #endif /* UNIV_ENABLE_UNIT_TEST_MAKE_FILEPATH */ -/*******************************************************************//** -Returns the block size of the file space -@param[in] space_id space id -@param[in] offset page offset -@param[in] len page len +/** Determine the block size of the data file. +@param[in] space tablespace +@param[in] offset page number @return block size */ UNIV_INTERN ulint -fil_space_get_block_size( - ulint id, - os_offset_t offset, - ulint len); +fil_space_get_block_size(const fil_space_t* space, unsigned offset); /*******************************************************************//** Increments the count of pending operation, if space is not being deleted. @return TRUE if being deleted, and operation should be skipped */ diff --git a/storage/innobase/include/fil0fil.ic b/storage/innobase/include/fil0fil.ic index 01fa1093e5e9e..e3d4fd4d88b3b 100644 --- a/storage/innobase/include/fil0fil.ic +++ b/storage/innobase/include/fil0fil.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2015, 2017 MariaDB Corporation. +Copyright (c) 2015, 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 @@ -26,28 +26,6 @@ Created 31/03/2015 Jan Lindström #ifndef fil0fil_ic #define fil0fil_ic -/*******************************************************************//** -Return space name */ -UNIV_INLINE -char* -fil_space_name( -/*===========*/ - fil_space_t* space) /*!< in: space */ -{ - return (space->name); -} - -/*******************************************************************//** -Return space flags */ -UNIV_INLINE -ulint -fil_space_flags( -/*===========*/ - fil_space_t* space) /*!< in: space */ -{ - return (space->flags); -} - /*******************************************************************//** Return page type name */ UNIV_INLINE diff --git a/storage/innobase/include/fil0pagecompress.h b/storage/innobase/include/fil0pagecompress.h index 0bf6aa75f1960..cd754151d8058 100644 --- a/storage/innobase/include/fil0pagecompress.h +++ b/storage/innobase/include/fil0pagecompress.h @@ -30,34 +30,6 @@ atomic writes information to table space. Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com ***********************************************************************/ -/*******************************************************************//** -Returns the page compression level flag of the space, or 0 if the space -is not compressed. The tablespace must be cached in the memory cache. -@return page compression level if page compressed, ULINT_UNDEFINED if space not found */ -UNIV_INLINE -ulint -fil_space_get_page_compression_level( -/*=================================*/ - ulint id); /*!< in: space id */ -/*******************************************************************//** -Returns the page compression flag of the space, or false if the space -is not compressed. The tablespace must be cached in the memory cache. -@return true if page compressed, false if not or space not found */ -UNIV_INLINE -bool -fil_space_is_page_compressed( -/*=========================*/ - ulint id); /*!< in: space id */ -/*******************************************************************//** -Returns the atomic writes flag of the space, or false if the space -is not using atomic writes. The tablespace must be cached in the memory cache. -@return atomic write table option value */ -UNIV_INLINE -bool -fil_space_get_atomic_writes( -/*=========================*/ - ulint id); /*!< in: space id */ - /****************************************************************//** For page compressed pages compress the page before actual write operation. @@ -66,8 +38,7 @@ UNIV_INTERN byte* fil_compress_page( /*==============*/ - ulint space_id, /*!< in: tablespace id of the - table. */ + fil_space_t* space, /*!< in,out: tablespace (NULL during IMPORT) */ byte* buf, /*!< in: buffer from which to write; in aio this must be appropriately aligned */ byte* out_buf, /*!< out: compressed buffer */ diff --git a/storage/innobase/include/fsp0pagecompress.ic b/storage/innobase/include/fsp0pagecompress.ic index bb11371d712a7..f4b95162b2a44 100644 --- a/storage/innobase/include/fsp0pagecompress.ic +++ b/storage/innobase/include/fsp0pagecompress.ic @@ -74,47 +74,6 @@ fil_page_is_compressed_encrypted( return(mach_read_from_2(buf+FIL_PAGE_TYPE) == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED); } -#ifndef UNIV_INNOCHECKSUM -/*******************************************************************//** -Returns the page compression level of the space, or 0 if the space -is not compressed. The tablespace must be cached in the memory cache. -@return page compression level, 0 if space not found */ -UNIV_INLINE -ulint -fil_space_get_page_compression_level( -/*=================================*/ - ulint id) /*!< in: space id */ -{ - ulint flags; - - flags = fil_space_get_flags(id); - - if (flags && flags != ULINT_UNDEFINED) { - - return(fsp_flags_get_page_compression_level(flags)); - } - - return(0); -} - -/*******************************************************************//** -Extract the page compression from space. -@return true if space is page compressed, false if space is not found -or space is not page compressed. */ -UNIV_INLINE -bool -fil_space_is_page_compressed( -/*=========================*/ - ulint id) /*!< in: space id */ -{ - ulint flags = fil_space_get_flags(id); - - return(flags != ULINT_UNDEFINED - && FSP_FLAGS_HAS_PAGE_COMPRESSION(flags)); -} - -#endif /* UNIV_INNOCHECKSUM */ - /****************************************************************//** Get the name of the compression algorithm used for page compression. @@ -154,31 +113,6 @@ fil_get_compression_alg_name( } #ifndef UNIV_INNOCHECKSUM -/*******************************************************************//** -Returns the atomic writes flag of the space, or false if the space -is not using atomic writes. The tablespace must be cached in the memory cache. -@return 1 if atomic writes can be used for the file */ -UNIV_INLINE -bool -fil_space_get_atomic_writes( -/*========================*/ - ulint id) /*!< in: space id */ -{ - struct fil_space_t* space; - bool ret= 0; - - ut_ad(fil_system); - - mutex_enter(&fil_system->mutex); - - if ((space = fil_space_get_by_id(id))) - ret= space->atomic_write_supported; - - mutex_exit(&fil_system->mutex); - return(ret); -} - - /*******************************************************************//** Find out wheather the page is page compressed with lzo method @return true if page is page compressed with lzo method, false if not */ diff --git a/storage/innobase/include/mtr0log.ic b/storage/innobase/include/mtr0log.ic index 701f1482e6407..972fdc8151841 100644 --- a/storage/innobase/include/mtr0log.ic +++ b/storage/innobase/include/mtr0log.ic @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 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 @@ -227,20 +228,11 @@ mlog_write_initial_log_record_fast( if (space == TRX_SYS_SPACE && offset >= FSP_EXTENT_SIZE && offset < 3 * FSP_EXTENT_SIZE) { - if (buf_dblwr_being_created) { - /* Do nothing: we only come to this branch in an - InnoDB database creation. We do not redo log - anything for the doublewrite buffer pages. */ - return(log_ptr); - } else { - ib::error() << "Trying to redo log a record of type " - << type << " on page " - << page_id_t(space, offset) << "in the" - " doublewrite buffer, continuing anyway." - " Please post a bug report to" - " bugs.mysql.com."; - ut_ad(0); - } + ut_ad(buf_dblwr_being_created); + /* Do nothing: we only come to this branch in an + InnoDB database creation. We do not redo log + anything for the doublewrite buffer pages. */ + return(log_ptr); } return(mlog_write_initial_log_record_low(type, space, offset, diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 51ca6c08eca23..452f6a0b64f78 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -51,24 +51,11 @@ struct fil_space_t; extern bool os_has_said_disk_full; -/** Number of pending read operations */ -extern ulint os_n_pending_reads; -/** Number of pending write operations */ -extern ulint os_n_pending_writes; - /** File offset in bytes */ typedef ib_uint64_t os_offset_t; #ifdef _WIN32 -/** -Gets the operating system version. Currently works only on Windows. -@return OS_WIN95, OS_WIN31, OS_WINNT, OS_WIN2000, OS_WINXP, OS_WINVISTA, -OS_WIN7. */ - -ulint -os_get_os_version(); - typedef HANDLE os_file_dir_t; /*!< directory stream */ /** We define always WIN_ASYNC_IO, and check at run-time whether diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index 7250a96bb5dfd..1c680ce7cc463 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -295,7 +295,7 @@ page_is_comp( /*=========*/ const page_t* page) /*!< in: index page */ { - return(page_header_get_field(page, PAGE_N_HEAP) & 0x8000); + return(page[PAGE_HEADER + PAGE_N_HEAP] & 0x80); } /************************************************************//** diff --git a/storage/innobase/include/pars0grm.h b/storage/innobase/include/pars0grm.h index 788090a2e74fb..90a7468bc9a8e 100644 --- a/storage/innobase/include/pars0grm.h +++ b/storage/innobase/include/pars0grm.h @@ -48,104 +48,101 @@ extern int yydebug; PARS_INT_LIT = 258, PARS_FLOAT_LIT = 259, PARS_STR_LIT = 260, - PARS_FIXBINARY_LIT = 261, - PARS_BLOB_LIT = 262, - PARS_NULL_LIT = 263, - PARS_ID_TOKEN = 264, - PARS_AND_TOKEN = 265, - PARS_OR_TOKEN = 266, - PARS_NOT_TOKEN = 267, - PARS_GE_TOKEN = 268, - PARS_LE_TOKEN = 269, - PARS_NE_TOKEN = 270, - PARS_PROCEDURE_TOKEN = 271, - PARS_IN_TOKEN = 272, - PARS_OUT_TOKEN = 273, - PARS_BINARY_TOKEN = 274, - PARS_BLOB_TOKEN = 275, - PARS_INT_TOKEN = 276, - PARS_INTEGER_TOKEN = 277, - PARS_FLOAT_TOKEN = 278, - PARS_CHAR_TOKEN = 279, - PARS_IS_TOKEN = 280, - PARS_BEGIN_TOKEN = 281, - PARS_END_TOKEN = 282, - PARS_IF_TOKEN = 283, - PARS_THEN_TOKEN = 284, - PARS_ELSE_TOKEN = 285, - PARS_ELSIF_TOKEN = 286, - PARS_LOOP_TOKEN = 287, - PARS_WHILE_TOKEN = 288, - PARS_RETURN_TOKEN = 289, - PARS_SELECT_TOKEN = 290, - PARS_SUM_TOKEN = 291, - PARS_COUNT_TOKEN = 292, - PARS_DISTINCT_TOKEN = 293, - PARS_FROM_TOKEN = 294, - PARS_WHERE_TOKEN = 295, - PARS_FOR_TOKEN = 296, - PARS_DDOT_TOKEN = 297, - PARS_READ_TOKEN = 298, - PARS_ORDER_TOKEN = 299, - PARS_BY_TOKEN = 300, - PARS_ASC_TOKEN = 301, - PARS_DESC_TOKEN = 302, - PARS_INSERT_TOKEN = 303, - PARS_INTO_TOKEN = 304, - PARS_VALUES_TOKEN = 305, - PARS_UPDATE_TOKEN = 306, - PARS_SET_TOKEN = 307, - PARS_DELETE_TOKEN = 308, - PARS_CURRENT_TOKEN = 309, - PARS_OF_TOKEN = 310, - PARS_CREATE_TOKEN = 311, - PARS_TABLE_TOKEN = 312, - PARS_INDEX_TOKEN = 313, - PARS_UNIQUE_TOKEN = 314, - PARS_CLUSTERED_TOKEN = 315, - PARS_ON_TOKEN = 316, - PARS_ASSIGN_TOKEN = 317, - PARS_DECLARE_TOKEN = 318, - PARS_CURSOR_TOKEN = 319, - PARS_SQL_TOKEN = 320, - PARS_OPEN_TOKEN = 321, - PARS_FETCH_TOKEN = 322, - PARS_CLOSE_TOKEN = 323, - PARS_NOTFOUND_TOKEN = 324, - PARS_TO_CHAR_TOKEN = 325, - PARS_TO_NUMBER_TOKEN = 326, - PARS_TO_BINARY_TOKEN = 327, - PARS_BINARY_TO_NUMBER_TOKEN = 328, - PARS_SUBSTR_TOKEN = 329, - PARS_REPLSTR_TOKEN = 330, - PARS_CONCAT_TOKEN = 331, - PARS_INSTR_TOKEN = 332, - PARS_LENGTH_TOKEN = 333, - PARS_SYSDATE_TOKEN = 334, - PARS_PRINTF_TOKEN = 335, - PARS_ASSERT_TOKEN = 336, - PARS_RND_TOKEN = 337, - PARS_RND_STR_TOKEN = 338, - PARS_ROW_PRINTF_TOKEN = 339, - PARS_COMMIT_TOKEN = 340, - PARS_ROLLBACK_TOKEN = 341, - PARS_WORK_TOKEN = 342, - PARS_UNSIGNED_TOKEN = 343, - PARS_EXIT_TOKEN = 344, - PARS_FUNCTION_TOKEN = 345, - PARS_LOCK_TOKEN = 346, - PARS_SHARE_TOKEN = 347, - PARS_MODE_TOKEN = 348, - PARS_LIKE_TOKEN = 349, - PARS_LIKE_TOKEN_EXACT = 350, - PARS_LIKE_TOKEN_PREFIX = 351, - PARS_LIKE_TOKEN_SUFFIX = 352, - PARS_LIKE_TOKEN_SUBSTR = 353, - PARS_TABLE_NAME_TOKEN = 354, - PARS_COMPACT_TOKEN = 355, - PARS_BLOCK_SIZE_TOKEN = 356, - PARS_BIGINT_TOKEN = 357, - NEG = 358 + PARS_NULL_LIT = 261, + PARS_ID_TOKEN = 262, + PARS_AND_TOKEN = 263, + PARS_OR_TOKEN = 264, + PARS_NOT_TOKEN = 265, + PARS_GE_TOKEN = 266, + PARS_LE_TOKEN = 267, + PARS_NE_TOKEN = 268, + PARS_PROCEDURE_TOKEN = 269, + PARS_IN_TOKEN = 270, + PARS_OUT_TOKEN = 271, + PARS_BINARY_TOKEN = 272, + PARS_BLOB_TOKEN = 273, + PARS_INT_TOKEN = 274, + PARS_FLOAT_TOKEN = 275, + PARS_CHAR_TOKEN = 276, + PARS_IS_TOKEN = 277, + PARS_BEGIN_TOKEN = 278, + PARS_END_TOKEN = 279, + PARS_IF_TOKEN = 280, + PARS_THEN_TOKEN = 281, + PARS_ELSE_TOKEN = 282, + PARS_ELSIF_TOKEN = 283, + PARS_LOOP_TOKEN = 284, + PARS_WHILE_TOKEN = 285, + PARS_RETURN_TOKEN = 286, + PARS_SELECT_TOKEN = 287, + PARS_SUM_TOKEN = 288, + PARS_COUNT_TOKEN = 289, + PARS_DISTINCT_TOKEN = 290, + PARS_FROM_TOKEN = 291, + PARS_WHERE_TOKEN = 292, + PARS_FOR_TOKEN = 293, + PARS_DDOT_TOKEN = 294, + PARS_READ_TOKEN = 295, + PARS_ORDER_TOKEN = 296, + PARS_BY_TOKEN = 297, + PARS_ASC_TOKEN = 298, + PARS_DESC_TOKEN = 299, + PARS_INSERT_TOKEN = 300, + PARS_INTO_TOKEN = 301, + PARS_VALUES_TOKEN = 302, + PARS_UPDATE_TOKEN = 303, + PARS_SET_TOKEN = 304, + PARS_DELETE_TOKEN = 305, + PARS_CURRENT_TOKEN = 306, + PARS_OF_TOKEN = 307, + PARS_CREATE_TOKEN = 308, + PARS_TABLE_TOKEN = 309, + PARS_INDEX_TOKEN = 310, + PARS_UNIQUE_TOKEN = 311, + PARS_CLUSTERED_TOKEN = 312, + PARS_ON_TOKEN = 313, + PARS_ASSIGN_TOKEN = 314, + PARS_DECLARE_TOKEN = 315, + PARS_CURSOR_TOKEN = 316, + PARS_SQL_TOKEN = 317, + PARS_OPEN_TOKEN = 318, + PARS_FETCH_TOKEN = 319, + PARS_CLOSE_TOKEN = 320, + PARS_NOTFOUND_TOKEN = 321, + PARS_TO_CHAR_TOKEN = 322, + PARS_TO_NUMBER_TOKEN = 323, + PARS_TO_BINARY_TOKEN = 324, + PARS_BINARY_TO_NUMBER_TOKEN = 325, + PARS_SUBSTR_TOKEN = 326, + PARS_REPLSTR_TOKEN = 327, + PARS_CONCAT_TOKEN = 328, + PARS_INSTR_TOKEN = 329, + PARS_LENGTH_TOKEN = 330, + PARS_SYSDATE_TOKEN = 331, + PARS_PRINTF_TOKEN = 332, + PARS_ASSERT_TOKEN = 333, + PARS_RND_TOKEN = 334, + PARS_RND_STR_TOKEN = 335, + PARS_ROW_PRINTF_TOKEN = 336, + PARS_COMMIT_TOKEN = 337, + PARS_ROLLBACK_TOKEN = 338, + PARS_WORK_TOKEN = 339, + PARS_UNSIGNED_TOKEN = 340, + PARS_EXIT_TOKEN = 341, + PARS_FUNCTION_TOKEN = 342, + PARS_LOCK_TOKEN = 343, + PARS_SHARE_TOKEN = 344, + PARS_MODE_TOKEN = 345, + PARS_LIKE_TOKEN = 346, + PARS_LIKE_TOKEN_EXACT = 347, + PARS_LIKE_TOKEN_PREFIX = 348, + PARS_LIKE_TOKEN_SUFFIX = 349, + PARS_LIKE_TOKEN_SUBSTR = 350, + PARS_TABLE_NAME_TOKEN = 351, + PARS_COMPACT_TOKEN = 352, + PARS_BLOCK_SIZE_TOKEN = 353, + PARS_BIGINT_TOKEN = 354, + NEG = 355 }; #endif diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h index 1b1597d0fba05..e4034f3a6ffe5 100644 --- a/storage/innobase/include/srv0mon.h +++ b/storage/innobase/include/srv0mon.h @@ -2,7 +2,7 @@ Copyright (c) 2010, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2016, MariaDB Corporation. +Copyright (c) 2013, 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 @@ -603,9 +603,10 @@ on the counters */ /** Atomically increment a monitor counter. Use MONITOR_INC if appropriate mutex protection exists. -@param monitor monitor to be incremented by 1 */ -# define MONITOR_ATOMIC_INC(monitor) \ - if (MONITOR_IS_ON(monitor)) { \ +@param monitor monitor to be incremented by 1 +@param enabled whether the monitor is enabled */ +#define MONITOR_ATOMIC_INC_LOW(monitor, enabled) \ + if (enabled) { \ ib_uint64_t value; \ value = my_atomic_add64( \ (int64*) &MONITOR_VALUE(monitor), 1) + 1; \ @@ -618,9 +619,10 @@ Use MONITOR_INC if appropriate mutex protection exists. /** Atomically decrement a monitor counter. Use MONITOR_DEC if appropriate mutex protection exists. -@param monitor monitor to be decremented by 1 */ -# define MONITOR_ATOMIC_DEC(monitor) \ - if (MONITOR_IS_ON(monitor)) { \ +@param monitor monitor to be decremented by 1 +@param enabled whether the monitor is enabled */ +#define MONITOR_ATOMIC_DEC_LOW(monitor, enabled) \ + if (enabled) { \ ib_uint64_t value; \ value = my_atomic_add64( \ (int64*) &MONITOR_VALUE(monitor), -1) - 1; \ @@ -631,6 +633,17 @@ Use MONITOR_DEC if appropriate mutex protection exists. } \ } +/** Atomically increment a monitor counter if it is enabled. +Use MONITOR_INC if appropriate mutex protection exists. +@param monitor monitor to be incremented by 1 */ +#define MONITOR_ATOMIC_INC(monitor) \ + MONITOR_ATOMIC_INC_LOW(monitor, MONITOR_IS_ON(monitor)) +/** Atomically decrement a monitor counter if it is enabled. +Use MONITOR_DEC if appropriate mutex protection exists. +@param monitor monitor to be decremented by 1 */ +#define MONITOR_ATOMIC_DEC(monitor) \ + MONITOR_ATOMIC_DEC_LOW(monitor, MONITOR_IS_ON(monitor)) + #define MONITOR_DEC(monitor) \ if (MONITOR_IS_ON(monitor)) { \ MONITOR_VALUE(monitor)--; \ diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index cb2674ebddf99..faf5387a5d141 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -102,6 +102,7 @@ support cross-platform development and expose comonly used SQL names. */ #endif #include +#define __STDC_FORMAT_MACROS /* Enable C99 printf format macros */ #include #ifdef HAVE_UNISTD_H #include @@ -282,16 +283,7 @@ rarely invoked function for size instead for speed. */ #define UNIV_INLINE static inline -#ifdef _WIN32 -# ifdef _WIN64 -# define UNIV_WORD_SIZE 8 -# else -# define UNIV_WORD_SIZE 4 -# endif -#else /* !_WIN32 */ -/** MySQL config.h generated by CMake will define SIZEOF_LONG in Posix */ -#define UNIV_WORD_SIZE SIZEOF_LONG -#endif /* _WIN32 */ +#define UNIV_WORD_SIZE SIZEOF_SIZE_T /** The following alignment is used in memory allocations in memory heap management to ensure correct alignment for doubles etc. */ @@ -463,52 +455,48 @@ mysql_com.h if you are to use this macro. */ ========================== */ -/* Note that inside MySQL 'byte' is defined as char on Linux! */ -#define byte unsigned char +/** Unsigned octet of bits */ +typedef unsigned char byte; +/** Machine-word-width unsigned integer */ +typedef size_t ulint; +/** Machine-word-width signed integer */ +typedef ssize_t lint; -/* Another basic type we use is unsigned long integer which should be equal to -the word size of the machine, that is on a 32-bit platform 32 bits, and on a -64-bit platform 64 bits. We also give the printf format for the type as a -macro ULINTPF. */ +/** ulint format for the printf() family of functions */ +#define ULINTPF "%zu" +/** ulint hexadecimal format for the printf() family of functions */ +#define ULINTPFx "%zx" #ifdef _WIN32 /* Use the integer types and formatting strings defined in Visual Studio. */ # define UINT32PF "%u" -# define UINT64PF "%llu" -# define UINT64PFx "%016llx" +# define INT64PF "%lld" # define UINT64scan "llu" -typedef unsigned __int64 ib_uint64_t; -typedef unsigned __int32 ib_uint32_t; -#else -# define UINT32PF "%u" -#if SIZEOF_LONG == 8 -# define UINT64PF "%lu" -# define UINT64PFx "%016lx" -# define UINT64scan "lu" -#else -# define UINT64PF "%llu" # define UINT64PFx "%016llx" +#elif defined __APPLE__ +/* Apple prefers to call the 64-bit types 'long long' +in both 32-bit and 64-bit environments. */ +# define UINT32PF "%" PRIu32 +# define INT64PF "%lld" # define UINT64scan "llu" +# define UINT64PFx "%016llx" +#else +/* Use the integer types and formatting strings defined in the C99 standard. */ +# define UINT32PF "%" PRIu32 +# define INT64PF "%" PRId64 +# define UINT64scan PRIu64 +# define UINT64PFx "%016" PRIx64 #endif + +typedef int64_t ib_int64_t; typedef uint64_t ib_uint64_t; typedef uint32_t ib_uint32_t; -#endif /* _WIN32 */ -#ifdef _WIN64 -typedef unsigned __int64 ulint; -typedef __int64 lint; -# define ULINTPF UINT64PF -#else -typedef unsigned long int ulint; -typedef long int lint; -# define ULINTPF "%lu" -#endif /* _WIN64 */ +#define UINT64PF "%" UINT64scan +#define IB_ID_FMT UINT64PF -#ifndef _WIN32 -#if SIZEOF_LONG != SIZEOF_VOIDP -#error "Error: InnoDB's ulint must be of the same size as void*" -#endif -#endif +/** Log sequence number (also used for redo log byte arithmetics) */ +typedef ib_uint64_t lsn_t; /** The 'undefined' value for a ulint */ #define ULINT_UNDEFINED ((ulint)(-1)) diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index c2bd792a2b1b6..c3574913c7c72 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -3618,18 +3618,7 @@ lock_move_reorganize_page( } } -#ifdef UNIV_DEBUG - { - ulint i = lock_rec_find_set_bit(lock); - - /* Check that all locks were moved. */ - if (i != ULINT_UNDEFINED) { - ib::fatal() << "lock_move_reorganize_page(): " - << i << " not moved in " - << (void*) lock; - } - } -#endif /* UNIV_DEBUG */ + ut_ad(lock_rec_find_set_bit(lock) == ULINT_UNDEFINED); } lock_mutex_exit(); @@ -6611,7 +6600,7 @@ lock_rec_block_validate( if (err != DB_SUCCESS) { ib::error() << "Lock rec block validate failed for tablespace " - << ((space && space->name) ? space->name : " system ") + << space->name << " space_id " << space_id << " page_no " << page_no << " err " << err; } diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index d26886e45f95a..c96260ca1ac9a 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -742,14 +742,11 @@ log_calc_max_ages(void) if (!success) { ib::error() << "Cannot continue operation. ib_logfiles are too" - " small for innodb_thread_concurrency " + " small for innodb_thread_concurrency=" << srv_thread_concurrency << ". The combined size of" " ib_logfiles should be bigger than" - " 200 kB * innodb_thread_concurrency. To get mysqld" - " to start up, set innodb_thread_concurrency in" - " my.cnf to a lower value, for example, to 8. After" - " an ERROR-FREE shutdown of mysqld you can adjust" - " the size of ib_logfiles. " << INNODB_PARAMETERS_MSG; + " 200 kB * innodb_thread_concurrency. " + << INNODB_PARAMETERS_MSG; } return(success); diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 8764f40b4e3f8..f5c42abf365f9 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -2,7 +2,7 @@ Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. -Copyright (c) 2012, 2017, MariaDB Corporation. +Copyright (c) 2013, 2017, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Percona Inc.. Those modifications are @@ -687,10 +687,6 @@ ulint os_n_fsyncs; static ulint os_n_file_reads_old; static ulint os_n_file_writes_old; static ulint os_n_fsyncs_old; -/** Number of pending write operations */ -ulint os_n_pending_writes; -/** Number of pending read operations */ -ulint os_n_pending_reads; static time_t os_last_printout; bool os_has_said_disk_full; @@ -4945,14 +4941,11 @@ os_file_pwrite( ++os_n_file_writes; - (void) my_atomic_addlint(&os_n_pending_writes, 1); - MONITOR_ATOMIC_INC(MONITOR_OS_PENDING_WRITES); - + const bool monitor = MONITOR_IS_ON(MONITOR_OS_PENDING_WRITES); + MONITOR_ATOMIC_INC_LOW(MONITOR_OS_PENDING_WRITES, monitor); ssize_t n_bytes = os_file_io(type, file, const_cast(buf), n, offset, err); - - (void) my_atomic_addlint(&os_n_pending_writes, -1); - MONITOR_ATOMIC_DEC(MONITOR_OS_PENDING_WRITES); + MONITOR_ATOMIC_DEC_LOW(MONITOR_OS_PENDING_WRITES, monitor); return(n_bytes); } @@ -5032,13 +5025,10 @@ os_file_pread( { ++os_n_file_reads; - (void) my_atomic_addlint(&os_n_pending_reads, 1); - MONITOR_ATOMIC_INC(MONITOR_OS_PENDING_READS); - + const bool monitor = MONITOR_IS_ON(MONITOR_OS_PENDING_READS); + MONITOR_ATOMIC_INC_LOW(MONITOR_OS_PENDING_READS, monitor); ssize_t n_bytes = os_file_io(type, file, buf, n, offset, err); - - (void) my_atomic_addlint(&os_n_pending_reads, -1); - MONITOR_ATOMIC_DEC(MONITOR_OS_PENDING_READS); + MONITOR_ATOMIC_DEC_LOW(MONITOR_OS_PENDING_READS, monitor); return(n_bytes); } @@ -7362,7 +7352,7 @@ AIO::print_segment_info( fprintf(file, ", "); } - fprintf(file, "%lu", *segments); + fprintf(file, ULINTPF, *segments); } fprintf(file, "] "); @@ -7443,8 +7433,8 @@ os_aio_print(FILE* file) double avg_bytes_read; for (ulint i = 0; i < srv_n_file_io_threads; ++i) { - fprintf(file, "I/O thread %lu state: %s (%s)", - (ulint) i, + fprintf(file, "I/O thread " ULINTPF " state: %s (%s)", + i, srv_io_thread_op_info[i], srv_io_thread_function[i]); @@ -7467,19 +7457,24 @@ os_aio_print(FILE* file) time_elapsed = 0.001 + difftime(current_time, os_last_printout); fprintf(file, - "Pending flushes (fsync) log: %lu; buffer pool: %lu\n" - "%lu OS file reads, %lu OS file writes, %lu OS fsyncs\n", - (ulint) fil_n_pending_log_flushes, - (ulint) fil_n_pending_tablespace_flushes, - (ulint) os_n_file_reads, - (ulint) os_n_file_writes, - (ulint) os_n_fsyncs); - - if (os_n_pending_writes != 0 || os_n_pending_reads != 0) { + "Pending flushes (fsync) log: " ULINTPF + "; buffer pool: " ULINTPF "\n" + ULINTPF " OS file reads, " + ULINTPF " OS file writes, " + ULINTPF " OS fsyncs\n", + fil_n_pending_log_flushes, + fil_n_pending_tablespace_flushes, + os_n_file_reads, + os_n_file_writes, + os_n_fsyncs); + + const ulint n_reads = ulint(MONITOR_VALUE(MONITOR_OS_PENDING_READS)); + const ulint n_writes = ulint(MONITOR_VALUE(MONITOR_OS_PENDING_WRITES)); + + if (n_reads != 0 || n_writes != 0) { fprintf(file, - "%lu pending preads, %lu pending pwrites\n", - (ulint) os_n_pending_reads, - (ulint) os_n_pending_writes); + ULINTPF " pending reads, " ULINTPF " pending writes\n", + n_reads, n_writes); } if (os_n_file_reads == os_n_file_reads_old) { @@ -7490,7 +7485,7 @@ os_aio_print(FILE* file) } fprintf(file, - "%.2f reads/s, %lu avg bytes/read," + "%.2f reads/s, " ULINTPF " avg bytes/read," " %.2f writes/s, %.2f fsyncs/s\n", (os_n_file_reads - os_n_file_reads_old) / time_elapsed, @@ -7545,7 +7540,7 @@ AIO::to_file(FILE* file) const { acquire(); - fprintf(file, " %lu\n", static_cast(m_n_reserved)); + fprintf(file, " " ULINTPF "\n", m_n_reserved); for (ulint i = 0; i < m_slots.size(); ++i) { diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index f2ba1c6422956..df7d26c63e809 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -1324,7 +1324,8 @@ page_cur_insert_rec_low( data_len = rec_offs_data_size(offsets); fprintf(stderr, "InnoDB: Error: current_rec == insert_rec " - " extra_len %lu data_len %lu insert_buf %p rec %p\n", + " extra_len " ULINTPF + " data_len " ULINTPF " insert_buf %p rec %p\n", extra_len, data_len, insert_buf, rec); fprintf(stderr, "InnoDB; Physical record: \n"); rec_print(stderr, rec, index); diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 11b8838ce2dfb..88c5a42581846 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -2,7 +2,7 @@ Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2014, 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 diff --git a/storage/innobase/pars/pars0grm.cc b/storage/innobase/pars/pars0grm.cc index ef732209978e8..a0a09771106a3 100644 --- a/storage/innobase/pars/pars0grm.cc +++ b/storage/innobase/pars/pars0grm.cc @@ -119,104 +119,101 @@ extern int yydebug; PARS_INT_LIT = 258, PARS_FLOAT_LIT = 259, PARS_STR_LIT = 260, - PARS_FIXBINARY_LIT = 261, - PARS_BLOB_LIT = 262, - PARS_NULL_LIT = 263, - PARS_ID_TOKEN = 264, - PARS_AND_TOKEN = 265, - PARS_OR_TOKEN = 266, - PARS_NOT_TOKEN = 267, - PARS_GE_TOKEN = 268, - PARS_LE_TOKEN = 269, - PARS_NE_TOKEN = 270, - PARS_PROCEDURE_TOKEN = 271, - PARS_IN_TOKEN = 272, - PARS_OUT_TOKEN = 273, - PARS_BINARY_TOKEN = 274, - PARS_BLOB_TOKEN = 275, - PARS_INT_TOKEN = 276, - PARS_INTEGER_TOKEN = 277, - PARS_FLOAT_TOKEN = 278, - PARS_CHAR_TOKEN = 279, - PARS_IS_TOKEN = 280, - PARS_BEGIN_TOKEN = 281, - PARS_END_TOKEN = 282, - PARS_IF_TOKEN = 283, - PARS_THEN_TOKEN = 284, - PARS_ELSE_TOKEN = 285, - PARS_ELSIF_TOKEN = 286, - PARS_LOOP_TOKEN = 287, - PARS_WHILE_TOKEN = 288, - PARS_RETURN_TOKEN = 289, - PARS_SELECT_TOKEN = 290, - PARS_SUM_TOKEN = 291, - PARS_COUNT_TOKEN = 292, - PARS_DISTINCT_TOKEN = 293, - PARS_FROM_TOKEN = 294, - PARS_WHERE_TOKEN = 295, - PARS_FOR_TOKEN = 296, - PARS_DDOT_TOKEN = 297, - PARS_READ_TOKEN = 298, - PARS_ORDER_TOKEN = 299, - PARS_BY_TOKEN = 300, - PARS_ASC_TOKEN = 301, - PARS_DESC_TOKEN = 302, - PARS_INSERT_TOKEN = 303, - PARS_INTO_TOKEN = 304, - PARS_VALUES_TOKEN = 305, - PARS_UPDATE_TOKEN = 306, - PARS_SET_TOKEN = 307, - PARS_DELETE_TOKEN = 308, - PARS_CURRENT_TOKEN = 309, - PARS_OF_TOKEN = 310, - PARS_CREATE_TOKEN = 311, - PARS_TABLE_TOKEN = 312, - PARS_INDEX_TOKEN = 313, - PARS_UNIQUE_TOKEN = 314, - PARS_CLUSTERED_TOKEN = 315, - PARS_ON_TOKEN = 316, - PARS_ASSIGN_TOKEN = 317, - PARS_DECLARE_TOKEN = 318, - PARS_CURSOR_TOKEN = 319, - PARS_SQL_TOKEN = 320, - PARS_OPEN_TOKEN = 321, - PARS_FETCH_TOKEN = 322, - PARS_CLOSE_TOKEN = 323, - PARS_NOTFOUND_TOKEN = 324, - PARS_TO_CHAR_TOKEN = 325, - PARS_TO_NUMBER_TOKEN = 326, - PARS_TO_BINARY_TOKEN = 327, - PARS_BINARY_TO_NUMBER_TOKEN = 328, - PARS_SUBSTR_TOKEN = 329, - PARS_REPLSTR_TOKEN = 330, - PARS_CONCAT_TOKEN = 331, - PARS_INSTR_TOKEN = 332, - PARS_LENGTH_TOKEN = 333, - PARS_SYSDATE_TOKEN = 334, - PARS_PRINTF_TOKEN = 335, - PARS_ASSERT_TOKEN = 336, - PARS_RND_TOKEN = 337, - PARS_RND_STR_TOKEN = 338, - PARS_ROW_PRINTF_TOKEN = 339, - PARS_COMMIT_TOKEN = 340, - PARS_ROLLBACK_TOKEN = 341, - PARS_WORK_TOKEN = 342, - PARS_UNSIGNED_TOKEN = 343, - PARS_EXIT_TOKEN = 344, - PARS_FUNCTION_TOKEN = 345, - PARS_LOCK_TOKEN = 346, - PARS_SHARE_TOKEN = 347, - PARS_MODE_TOKEN = 348, - PARS_LIKE_TOKEN = 349, - PARS_LIKE_TOKEN_EXACT = 350, - PARS_LIKE_TOKEN_PREFIX = 351, - PARS_LIKE_TOKEN_SUFFIX = 352, - PARS_LIKE_TOKEN_SUBSTR = 353, - PARS_TABLE_NAME_TOKEN = 354, - PARS_COMPACT_TOKEN = 355, - PARS_BLOCK_SIZE_TOKEN = 356, - PARS_BIGINT_TOKEN = 357, - NEG = 358 + PARS_NULL_LIT = 261, + PARS_ID_TOKEN = 262, + PARS_AND_TOKEN = 263, + PARS_OR_TOKEN = 264, + PARS_NOT_TOKEN = 265, + PARS_GE_TOKEN = 266, + PARS_LE_TOKEN = 267, + PARS_NE_TOKEN = 268, + PARS_PROCEDURE_TOKEN = 269, + PARS_IN_TOKEN = 270, + PARS_OUT_TOKEN = 271, + PARS_BINARY_TOKEN = 272, + PARS_BLOB_TOKEN = 273, + PARS_INT_TOKEN = 274, + PARS_FLOAT_TOKEN = 275, + PARS_CHAR_TOKEN = 276, + PARS_IS_TOKEN = 277, + PARS_BEGIN_TOKEN = 278, + PARS_END_TOKEN = 279, + PARS_IF_TOKEN = 280, + PARS_THEN_TOKEN = 281, + PARS_ELSE_TOKEN = 282, + PARS_ELSIF_TOKEN = 283, + PARS_LOOP_TOKEN = 284, + PARS_WHILE_TOKEN = 285, + PARS_RETURN_TOKEN = 286, + PARS_SELECT_TOKEN = 287, + PARS_SUM_TOKEN = 288, + PARS_COUNT_TOKEN = 289, + PARS_DISTINCT_TOKEN = 290, + PARS_FROM_TOKEN = 291, + PARS_WHERE_TOKEN = 292, + PARS_FOR_TOKEN = 293, + PARS_DDOT_TOKEN = 294, + PARS_READ_TOKEN = 295, + PARS_ORDER_TOKEN = 296, + PARS_BY_TOKEN = 297, + PARS_ASC_TOKEN = 298, + PARS_DESC_TOKEN = 299, + PARS_INSERT_TOKEN = 300, + PARS_INTO_TOKEN = 301, + PARS_VALUES_TOKEN = 302, + PARS_UPDATE_TOKEN = 303, + PARS_SET_TOKEN = 304, + PARS_DELETE_TOKEN = 305, + PARS_CURRENT_TOKEN = 306, + PARS_OF_TOKEN = 307, + PARS_CREATE_TOKEN = 308, + PARS_TABLE_TOKEN = 309, + PARS_INDEX_TOKEN = 310, + PARS_UNIQUE_TOKEN = 311, + PARS_CLUSTERED_TOKEN = 312, + PARS_ON_TOKEN = 313, + PARS_ASSIGN_TOKEN = 314, + PARS_DECLARE_TOKEN = 315, + PARS_CURSOR_TOKEN = 316, + PARS_SQL_TOKEN = 317, + PARS_OPEN_TOKEN = 318, + PARS_FETCH_TOKEN = 319, + PARS_CLOSE_TOKEN = 320, + PARS_NOTFOUND_TOKEN = 321, + PARS_TO_CHAR_TOKEN = 322, + PARS_TO_NUMBER_TOKEN = 323, + PARS_TO_BINARY_TOKEN = 324, + PARS_BINARY_TO_NUMBER_TOKEN = 325, + PARS_SUBSTR_TOKEN = 326, + PARS_REPLSTR_TOKEN = 327, + PARS_CONCAT_TOKEN = 328, + PARS_INSTR_TOKEN = 329, + PARS_LENGTH_TOKEN = 330, + PARS_SYSDATE_TOKEN = 331, + PARS_PRINTF_TOKEN = 332, + PARS_ASSERT_TOKEN = 333, + PARS_RND_TOKEN = 334, + PARS_RND_STR_TOKEN = 335, + PARS_ROW_PRINTF_TOKEN = 336, + PARS_COMMIT_TOKEN = 337, + PARS_ROLLBACK_TOKEN = 338, + PARS_WORK_TOKEN = 339, + PARS_UNSIGNED_TOKEN = 340, + PARS_EXIT_TOKEN = 341, + PARS_FUNCTION_TOKEN = 342, + PARS_LOCK_TOKEN = 343, + PARS_SHARE_TOKEN = 344, + PARS_MODE_TOKEN = 345, + PARS_LIKE_TOKEN = 346, + PARS_LIKE_TOKEN_EXACT = 347, + PARS_LIKE_TOKEN_PREFIX = 348, + PARS_LIKE_TOKEN_SUFFIX = 349, + PARS_LIKE_TOKEN_SUBSTR = 350, + PARS_TABLE_NAME_TOKEN = 351, + PARS_COMPACT_TOKEN = 352, + PARS_BLOCK_SIZE_TOKEN = 353, + PARS_BIGINT_TOKEN = 354, + NEG = 355 }; #endif @@ -236,7 +233,7 @@ int yyparse (void); /* Copy the second part of user declarations. */ -#line 240 "pars0grm.cc" /* yacc.c:358 */ +#line 237 "pars0grm.cc" /* yacc.c:358 */ #ifdef short # undef short @@ -478,21 +475,21 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 824 +#define YYLAST 780 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 119 +#define YYNTOKENS 116 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 72 /* YYNRULES -- Number of rules. */ -#define YYNRULES 181 +#define YYNRULES 178 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 348 +#define YYNSTATES 345 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 358 +#define YYMAXUTOK 355 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -504,16 +501,16 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 111, 2, 2, - 113, 114, 108, 107, 116, 106, 2, 109, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 112, - 104, 103, 105, 115, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 108, 2, 2, + 110, 111, 105, 104, 113, 103, 2, 106, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 109, + 101, 100, 102, 112, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 117, 2, 118, 2, 2, 2, 2, + 2, 2, 2, 114, 2, 115, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -536,32 +533,31 @@ static const yytype_uint8 yytranslate[] = 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 110 + 95, 96, 97, 98, 99, 107 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 163, 163, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 191, 192, 197, 198, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 226, 231, 232, 233, 234, 236, 237, - 238, 239, 240, 241, 242, 245, 247, 248, 252, 258, - 263, 264, 265, 269, 273, 274, 279, 280, 281, 286, - 287, 288, 292, 293, 298, 304, 311, 312, 313, 318, - 320, 323, 327, 328, 332, 333, 338, 339, 344, 345, - 346, 350, 351, 358, 373, 378, 381, 389, 395, 396, - 401, 407, 416, 424, 432, 439, 447, 455, 461, 468, - 474, 475, 480, 481, 483, 487, 494, 500, 510, 514, - 518, 525, 532, 536, 544, 553, 554, 559, 560, 565, - 566, 572, 573, 579, 580, 585, 586, 591, 602, 603, - 608, 609, 613, 614, 618, 632, 633, 637, 642, 647, - 648, 649, 650, 651, 652, 656, 661, 669, 670, 671, - 676, 682, 684, 685, 689, 697, 703, 704, 707, 709, - 710, 714 + 0, 160, 160, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 188, 189, 194, 195, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 221, 226, 227, 228, 229, 231, 232, 233, 234, + 235, 236, 237, 240, 242, 243, 247, 253, 258, 259, + 260, 264, 268, 269, 274, 275, 276, 281, 282, 283, + 287, 288, 293, 299, 306, 307, 308, 313, 315, 318, + 322, 323, 327, 328, 333, 334, 339, 340, 341, 345, + 346, 353, 368, 373, 376, 384, 390, 391, 396, 402, + 411, 419, 427, 434, 442, 450, 456, 463, 469, 470, + 475, 476, 478, 482, 489, 495, 505, 509, 513, 520, + 527, 531, 539, 548, 549, 554, 555, 560, 561, 567, + 568, 574, 575, 580, 581, 586, 597, 598, 603, 604, + 608, 609, 613, 627, 628, 632, 637, 642, 643, 644, + 645, 646, 650, 655, 663, 664, 665, 670, 676, 678, + 679, 683, 691, 697, 698, 701, 703, 704, 708 }; #endif @@ -571,19 +567,18 @@ static const yytype_uint16 yyrline[] = static const char *const yytname[] = { "$end", "error", "$undefined", "PARS_INT_LIT", "PARS_FLOAT_LIT", - "PARS_STR_LIT", "PARS_FIXBINARY_LIT", "PARS_BLOB_LIT", "PARS_NULL_LIT", - "PARS_ID_TOKEN", "PARS_AND_TOKEN", "PARS_OR_TOKEN", "PARS_NOT_TOKEN", - "PARS_GE_TOKEN", "PARS_LE_TOKEN", "PARS_NE_TOKEN", - "PARS_PROCEDURE_TOKEN", "PARS_IN_TOKEN", "PARS_OUT_TOKEN", - "PARS_BINARY_TOKEN", "PARS_BLOB_TOKEN", "PARS_INT_TOKEN", - "PARS_INTEGER_TOKEN", "PARS_FLOAT_TOKEN", "PARS_CHAR_TOKEN", - "PARS_IS_TOKEN", "PARS_BEGIN_TOKEN", "PARS_END_TOKEN", "PARS_IF_TOKEN", - "PARS_THEN_TOKEN", "PARS_ELSE_TOKEN", "PARS_ELSIF_TOKEN", - "PARS_LOOP_TOKEN", "PARS_WHILE_TOKEN", "PARS_RETURN_TOKEN", - "PARS_SELECT_TOKEN", "PARS_SUM_TOKEN", "PARS_COUNT_TOKEN", - "PARS_DISTINCT_TOKEN", "PARS_FROM_TOKEN", "PARS_WHERE_TOKEN", - "PARS_FOR_TOKEN", "PARS_DDOT_TOKEN", "PARS_READ_TOKEN", - "PARS_ORDER_TOKEN", "PARS_BY_TOKEN", "PARS_ASC_TOKEN", "PARS_DESC_TOKEN", + "PARS_STR_LIT", "PARS_NULL_LIT", "PARS_ID_TOKEN", "PARS_AND_TOKEN", + "PARS_OR_TOKEN", "PARS_NOT_TOKEN", "PARS_GE_TOKEN", "PARS_LE_TOKEN", + "PARS_NE_TOKEN", "PARS_PROCEDURE_TOKEN", "PARS_IN_TOKEN", + "PARS_OUT_TOKEN", "PARS_BINARY_TOKEN", "PARS_BLOB_TOKEN", + "PARS_INT_TOKEN", "PARS_FLOAT_TOKEN", "PARS_CHAR_TOKEN", "PARS_IS_TOKEN", + "PARS_BEGIN_TOKEN", "PARS_END_TOKEN", "PARS_IF_TOKEN", "PARS_THEN_TOKEN", + "PARS_ELSE_TOKEN", "PARS_ELSIF_TOKEN", "PARS_LOOP_TOKEN", + "PARS_WHILE_TOKEN", "PARS_RETURN_TOKEN", "PARS_SELECT_TOKEN", + "PARS_SUM_TOKEN", "PARS_COUNT_TOKEN", "PARS_DISTINCT_TOKEN", + "PARS_FROM_TOKEN", "PARS_WHERE_TOKEN", "PARS_FOR_TOKEN", + "PARS_DDOT_TOKEN", "PARS_READ_TOKEN", "PARS_ORDER_TOKEN", + "PARS_BY_TOKEN", "PARS_ASC_TOKEN", "PARS_DESC_TOKEN", "PARS_INSERT_TOKEN", "PARS_INTO_TOKEN", "PARS_VALUES_TOKEN", "PARS_UPDATE_TOKEN", "PARS_SET_TOKEN", "PARS_DELETE_TOKEN", "PARS_CURRENT_TOKEN", "PARS_OF_TOKEN", "PARS_CREATE_TOKEN", @@ -646,15 +641,15 @@ static const yytype_uint16 yytoknum[] = 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 61, 60, 62, 45, 43, 42, 47, - 358, 37, 59, 40, 41, 63, 44, 123, 125 + 61, 60, 62, 45, 43, 42, 47, 355, 37, 59, + 40, 41, 63, 44, 123, 125 }; # endif -#define YYPACT_NINF -179 +#define YYPACT_NINF -176 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-179))) + (!!((Yystate) == (-176))) #define YYTABLE_NINF -1 @@ -665,41 +660,41 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 35, 50, 72, -37, -36, -179, -179, 67, 49, -179, - -78, 13, 13, 53, 67, -179, -179, -179, -179, -179, - -179, -179, -179, 76, -179, 13, -179, 7, -31, -34, - -179, -179, -179, -179, -14, -179, 77, 83, 583, -179, - 78, -10, 42, 284, 284, -179, 17, 96, 58, 2, - 69, -16, 105, 107, 108, -179, -179, -179, 84, 31, - 37, -179, 113, -179, 403, -179, 14, 15, 19, -4, - 21, 89, 23, 24, 89, 25, 26, 32, 33, 44, - 45, 47, 51, 52, 54, 55, 56, 57, 60, 62, - 63, 84, -179, 284, -179, -179, -179, -179, -179, -179, - 43, 284, 59, -179, -179, -179, -179, -179, -179, -179, - -179, -179, -179, -179, 284, 284, 571, 70, 612, 73, - 74, -179, 699, -179, -45, 95, 145, 2, -179, -179, - 136, 2, 2, -179, 129, -179, 116, -179, -179, -179, - -179, 79, -179, -179, -179, 284, -179, 80, -179, -179, - 194, -179, -179, -179, -179, -179, -179, -179, -179, -179, - -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, - -179, -179, -179, 82, 699, 121, 715, 122, 3, 210, - 284, 284, 284, 284, 284, 583, 190, 284, 284, 284, - 284, 284, 284, 284, 284, 583, 284, -29, 187, 173, - 2, 284, -179, 195, -179, 92, -179, 149, 199, 97, - 699, -72, 284, 156, 699, -179, -179, -179, -179, 715, - 715, 4, 4, 699, 343, -179, 4, 4, 4, 12, - 12, 3, 3, -69, 463, 226, 204, 101, -179, 100, - -179, -32, -179, 642, 114, -179, 103, 217, 218, 117, - -179, 100, -179, -66, -179, 284, -59, 220, 583, 284, - -179, 202, 207, -179, 203, -179, 128, -179, 244, 284, - 2, 216, 284, 284, 195, 13, -179, -52, 200, 146, - 144, 154, 699, -179, -179, 583, 672, -179, 246, -179, - -179, -179, -179, 224, 189, 679, 699, -179, 165, 181, - 217, 2, -179, -179, -179, 583, -179, -179, 265, 239, - 583, 281, 197, -179, 193, -179, 182, 583, 205, 253, - -179, 523, 185, -179, 289, 206, -179, 293, 212, 294, - 274, -179, 300, -179, 307, -179, -51, -179, 22, -179, - -179, -179, -179, 302, -179, -179, -179, -179 + 20, 21, 41, -64, -59, -176, -176, 48, 54, -176, + -74, 12, 12, 45, 48, -176, -176, -176, -176, -176, + -176, -176, 69, -176, 12, -176, 8, -32, -43, -176, + -176, -176, -176, -13, -176, 72, 81, 445, -176, 75, + -11, 42, 530, 530, -176, 16, 99, 67, -3, 78, + -14, 108, 109, 110, -176, -176, -176, 86, 36, 44, + -176, 122, -176, 216, -176, 22, 23, 25, 6, 26, + 93, 27, 33, 93, 46, 51, 53, 56, 61, 63, + 64, 66, 68, 70, 71, 76, 79, 89, 94, 95, + 86, -176, 530, -176, -176, -176, -176, 43, 530, 49, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, 530, 530, 570, 77, 603, 80, 96, -176, 674, + -176, -38, 118, 161, -3, -176, -176, 129, -3, -3, + -176, 148, -176, 163, -176, -176, -176, -176, 97, -176, + -176, -176, 530, -176, 100, -176, -176, 481, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + 102, 674, 149, 220, 155, 14, 91, 530, 530, 530, + 530, 530, 445, 219, 530, 530, 530, 530, 530, 530, + 530, 530, 445, 530, -24, 218, 267, -3, 530, -176, + 221, -176, 117, -176, 179, 228, 124, 674, -65, 530, + 185, 674, -176, -176, -176, -176, 220, 220, 19, 19, + 674, 136, -176, 19, 19, 19, 3, 3, 14, 14, + -57, 326, 554, 231, 128, -176, 130, -176, -1, -176, + 610, 142, -176, 131, 238, 242, 141, -176, 130, -176, + -52, -176, 530, -51, 246, 445, 530, -176, 227, 233, + -176, 229, -176, 151, -176, 252, 530, -3, 225, 530, + 530, 221, 12, -176, -48, 207, 156, 153, 164, 674, + -176, -176, 445, 626, -176, 250, -176, -176, -176, -176, + 230, 194, 655, 674, -176, 173, 187, 238, -3, -176, + -176, -176, 445, -176, -176, 270, 245, 445, 284, 204, + -176, 192, -176, 181, 445, 203, 253, -176, 386, 193, + -176, 286, 205, -176, 296, 217, 299, 279, -176, 303, + -176, 307, -176, -47, -176, 30, -176, -176, -176, -176, + 305, -176, -176, -176, -176 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -707,67 +702,67 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 0, 0, 0, 1, 2, 167, 0, 168, - 0, 0, 0, 0, 0, 163, 164, 159, 160, 162, - 161, 165, 166, 171, 169, 0, 172, 178, 0, 0, - 173, 176, 177, 179, 0, 170, 0, 0, 0, 180, - 0, 0, 0, 0, 0, 129, 86, 0, 0, 0, - 0, 150, 0, 0, 0, 70, 71, 72, 0, 0, - 0, 128, 0, 25, 0, 3, 0, 0, 0, 0, - 0, 92, 0, 0, 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 2, 164, 0, 165, + 0, 0, 0, 0, 0, 160, 161, 157, 159, 158, + 162, 163, 168, 166, 0, 169, 175, 0, 0, 170, + 173, 174, 176, 0, 167, 0, 0, 0, 177, 0, + 0, 0, 0, 0, 127, 84, 0, 0, 0, 0, + 148, 0, 0, 0, 68, 69, 70, 0, 0, 0, + 126, 0, 25, 0, 3, 0, 0, 0, 0, 0, + 90, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 175, 0, 29, 30, 31, 32, 33, 34, - 27, 0, 35, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 0, 0, 0, 0, 0, 0, - 0, 89, 82, 87, 91, 0, 0, 0, 155, 156, - 0, 0, 0, 151, 152, 130, 0, 131, 117, 157, - 158, 0, 181, 26, 4, 79, 11, 0, 106, 12, - 0, 112, 113, 16, 17, 115, 116, 14, 15, 13, - 10, 8, 5, 6, 7, 9, 18, 20, 19, 23, - 24, 21, 22, 0, 118, 0, 51, 0, 40, 0, + 0, 172, 0, 29, 30, 31, 32, 27, 0, 33, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 0, 0, 0, 0, 0, 0, 0, 87, 80, + 85, 89, 0, 0, 0, 153, 154, 0, 0, 0, + 149, 150, 128, 0, 129, 115, 155, 156, 0, 178, + 26, 4, 77, 11, 0, 104, 12, 0, 110, 111, + 16, 17, 113, 114, 14, 15, 13, 10, 8, 5, + 6, 7, 9, 18, 20, 19, 23, 24, 21, 22, + 0, 116, 0, 49, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 0, 0, 0, 76, 0, - 0, 0, 104, 0, 114, 0, 153, 0, 76, 65, - 80, 0, 79, 0, 93, 174, 52, 53, 41, 49, - 50, 46, 47, 48, 122, 43, 42, 44, 45, 37, - 36, 38, 39, 0, 0, 0, 0, 0, 77, 90, - 88, 92, 74, 0, 0, 108, 111, 0, 0, 77, - 133, 132, 66, 0, 69, 0, 0, 0, 0, 0, - 120, 124, 0, 28, 0, 85, 0, 83, 0, 0, - 0, 94, 0, 0, 0, 0, 135, 0, 0, 0, - 0, 0, 81, 105, 110, 123, 0, 121, 0, 126, - 84, 78, 75, 0, 96, 0, 107, 109, 137, 143, - 0, 0, 73, 68, 67, 0, 125, 95, 0, 101, - 0, 0, 139, 144, 145, 136, 0, 119, 0, 0, - 103, 0, 0, 140, 141, 0, 147, 0, 0, 0, - 0, 138, 0, 134, 0, 148, 0, 97, 98, 127, - 142, 146, 154, 0, 99, 100, 102, 149 + 0, 77, 0, 0, 0, 74, 0, 0, 0, 102, + 0, 112, 0, 151, 0, 74, 63, 78, 0, 77, + 0, 91, 171, 50, 51, 39, 47, 48, 44, 45, + 46, 120, 41, 40, 42, 43, 35, 34, 36, 37, + 0, 0, 0, 0, 0, 75, 88, 86, 90, 72, + 0, 0, 106, 109, 0, 0, 75, 131, 130, 64, + 0, 67, 0, 0, 0, 0, 0, 118, 122, 0, + 28, 0, 83, 0, 81, 0, 0, 0, 92, 0, + 0, 0, 0, 133, 0, 0, 0, 0, 0, 79, + 103, 108, 121, 0, 119, 0, 124, 82, 76, 73, + 0, 94, 0, 105, 107, 135, 141, 0, 0, 71, + 66, 65, 0, 123, 93, 0, 99, 0, 0, 137, + 142, 143, 134, 0, 117, 0, 0, 101, 0, 0, + 138, 139, 0, 145, 0, 0, 0, 0, 136, 0, + 132, 0, 146, 0, 95, 96, 125, 140, 144, 152, + 0, 97, 98, 100, 147 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -179, -179, -63, -178, -41, -179, -179, -179, -179, -179, - -179, -179, 104, -154, 123, -179, -179, -68, -179, -179, - -179, -179, -30, -179, -179, 64, -179, 247, -179, -179, - -179, -179, -179, -179, -179, -179, 65, -179, -179, -179, - -179, -179, -179, -179, -179, -179, -179, 27, -179, -179, - -179, -179, -179, -179, -179, -179, -179, -179, -179, -117, - -179, -179, -12, 309, -179, 298, -179, -179, -179, 303, - -179, -179 + -176, -176, -62, -175, -40, -176, -176, -176, -176, -176, + -176, -176, 111, -166, 119, -176, -176, -67, -176, -176, + -176, -176, -33, -176, -176, 47, -176, 240, -176, -176, + -176, -176, -176, -176, -176, -176, 59, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, 17, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -115, + -176, -176, -12, 313, -176, 293, -176, -176, -176, 295, + -176, -176 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 2, 63, 64, 210, 117, 253, 65, 66, 67, - 250, 241, 239, 211, 123, 124, 125, 151, 294, 309, - 346, 320, 68, 69, 70, 245, 246, 152, 71, 72, - 73, 74, 75, 76, 77, 78, 260, 261, 262, 79, - 80, 81, 82, 83, 84, 85, 86, 276, 277, 312, - 324, 333, 314, 326, 87, 336, 134, 207, 88, 130, - 89, 90, 21, 9, 10, 26, 27, 31, 32, 33, - 34, 3 + -1, 2, 62, 63, 207, 114, 250, 64, 65, 66, + 247, 238, 236, 208, 120, 121, 122, 148, 291, 306, + 343, 317, 67, 68, 69, 242, 243, 149, 70, 71, + 72, 73, 74, 75, 76, 77, 257, 258, 259, 78, + 79, 80, 81, 82, 83, 84, 85, 273, 274, 309, + 321, 330, 311, 323, 86, 333, 131, 204, 87, 127, + 88, 89, 20, 9, 10, 25, 26, 30, 31, 32, + 33, 3 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -775,241 +770,232 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint16 yytable[] = { - 22, 143, 116, 118, 198, 122, 155, 224, 269, 236, - 202, 128, 38, 28, 204, 205, 25, 234, 184, 184, - 94, 95, 96, 97, 98, 99, 100, 184, 138, 101, - 36, 46, 15, 16, 17, 18, 13, 19, 14, 148, - 233, 132, 254, 133, 255, 263, 147, 255, 280, 29, - 281, 1, 174, 119, 120, 283, 37, 255, 256, 4, - 176, 173, 299, 342, 300, 343, 11, 12, 344, 345, - 29, 199, 5, 178, 179, 6, 8, 7, 23, 237, - 285, 35, 102, 242, 270, 25, 40, 103, 104, 105, - 106, 107, 41, 108, 109, 110, 111, 186, 186, 112, - 113, 129, 92, 91, 93, 126, 186, 127, 131, 214, - 190, 191, 192, 193, 135, 20, 136, 137, 139, 46, - 192, 193, 141, 114, 140, 121, 144, 317, 145, 150, - 115, 146, 321, 149, 200, 153, 154, 157, 158, 219, - 220, 221, 222, 223, 159, 160, 226, 227, 228, 229, - 230, 231, 232, 292, 175, 235, 161, 162, 122, 163, - 243, 143, 201, 164, 165, 208, 166, 167, 168, 169, - 177, 143, 170, 271, 171, 172, 94, 95, 96, 97, - 98, 99, 100, 194, 316, 101, 196, 197, 203, 206, - 216, 217, 209, 212, 215, 225, 238, 94, 95, 96, - 97, 98, 99, 100, 244, 247, 101, 248, 249, 119, - 120, 257, 252, 266, 282, 267, 268, 273, 286, 274, - 180, 181, 143, 182, 183, 184, 275, 278, 214, 284, - 279, 295, 296, 259, 288, 289, 180, 181, 102, 182, - 183, 184, 290, 103, 104, 105, 106, 107, 213, 108, - 109, 110, 111, 291, 143, 112, 113, 293, 143, 102, - 302, 301, 303, 298, 103, 104, 105, 106, 107, 304, - 108, 109, 110, 111, 306, 307, 112, 113, 311, 114, - 308, 313, 318, 319, 322, 323, 115, 94, 95, 96, - 97, 98, 99, 100, 325, 327, 101, 328, 329, 331, - 114, 332, 335, 338, 186, 337, 339, 115, 340, 334, - 341, 347, 251, 187, 188, 189, 190, 191, 192, 193, - 186, 156, 240, 24, 218, 30, 287, 315, 0, 187, - 188, 189, 190, 191, 192, 193, 0, 39, 297, 0, - 265, 0, 0, 0, 0, 0, 0, 0, 0, 102, - 0, 0, 42, 0, 103, 104, 105, 106, 107, 0, - 108, 109, 110, 111, 0, 0, 112, 113, 0, 0, - 0, 43, 0, 258, 259, 0, 44, 45, 46, 0, - 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, - 114, 48, 0, 0, 49, 0, 50, 115, 0, 51, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, - 53, 54, 42, 0, 0, 0, 0, 0, 55, 0, - 0, 0, 0, 56, 57, 0, 0, 58, 59, 60, - 142, 43, 61, 0, 0, 0, 44, 45, 46, 0, - 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, - 0, 48, 0, 0, 49, 0, 50, 0, 0, 51, - 62, 0, 0, 0, 0, 0, 0, 0, 0, 52, - 53, 54, 42, 0, 0, 0, 0, 0, 55, 0, - 0, 0, 0, 56, 57, 0, 0, 58, 59, 60, - 264, 43, 61, 0, 0, 0, 44, 45, 46, 0, - 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, - 0, 48, 0, 0, 49, 0, 50, 0, 0, 51, - 62, 0, 0, 0, 0, 0, 0, 0, 0, 52, - 53, 54, 42, 0, 0, 0, 0, 0, 55, 0, - 0, 0, 0, 56, 57, 0, 0, 58, 59, 60, - 330, 43, 61, 0, 0, 0, 44, 45, 46, 0, - 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, - 0, 48, 0, 0, 49, 0, 50, 0, 0, 51, - 62, 180, 181, 0, 182, 183, 184, 0, 0, 52, - 53, 54, 42, 0, 0, 0, 0, 0, 55, 0, - 185, 0, 0, 56, 57, 0, 0, 58, 59, 60, - 0, 43, 61, 0, 0, 0, 44, 45, 46, 0, - 0, 0, 180, 181, 47, 182, 183, 184, 0, 0, - 0, 48, 0, 0, 49, 0, 50, 0, 0, 51, - 62, 0, 0, 0, 195, 0, 0, 0, 0, 52, - 53, 54, 180, 181, 0, 182, 183, 184, 55, 0, - 0, 0, 0, 56, 57, 186, 0, 58, 59, 60, - 0, 0, 61, 0, 187, 188, 189, 190, 191, 192, - 193, 0, 180, 181, 272, 182, 183, 184, 0, 180, - 181, 0, 182, 183, 184, 0, 0, 0, 0, 0, - 62, 305, 0, 0, 0, 0, 186, 0, 0, 180, - 181, 310, 182, 183, 184, 187, 188, 189, 190, 191, - 192, 193, 0, 0, 0, 0, 0, 0, 182, 183, - 184, 0, 0, 0, 0, 0, 186, 0, 0, 0, - 0, 0, 0, 0, 0, 187, 188, 189, 190, 191, - 192, 193, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 186, 0, 0, 0, - 0, 0, 0, 186, 0, 187, 188, 189, 190, 191, - 192, 193, 187, 188, 189, 190, 191, 192, 193, 0, - 0, 0, 0, 186, 0, 0, 0, 0, 0, 0, - 0, 0, 187, 188, 189, 190, 191, 192, 193, 186, - 0, 0, 0, 0, 0, 0, 0, 0, 187, 188, - 189, 190, 191, 192, 193 + 21, 140, 113, 115, 125, 119, 152, 221, 195, 199, + 37, 233, 27, 201, 202, 24, 181, 231, 35, 93, + 94, 95, 96, 97, 135, 230, 98, 181, 4, 15, + 16, 17, 181, 18, 1, 145, 266, 13, 45, 14, + 129, 5, 130, 253, 36, 6, 251, 28, 252, 116, + 117, 7, 171, 144, 260, 8, 252, 170, 173, 277, + 280, 278, 252, 296, 339, 297, 340, 22, 28, 11, + 12, 175, 176, 341, 342, 196, 24, 34, 99, 39, + 282, 234, 239, 100, 101, 102, 103, 104, 40, 105, + 106, 107, 108, 126, 183, 109, 110, 90, 91, 177, + 178, 92, 179, 180, 181, 183, 123, 211, 189, 190, + 183, 19, 267, 124, 128, 132, 133, 134, 45, 111, + 136, 118, 187, 188, 189, 190, 112, 314, 137, 138, + 147, 141, 318, 142, 143, 146, 150, 216, 217, 218, + 219, 220, 151, 41, 223, 224, 225, 226, 227, 228, + 229, 172, 289, 232, 197, 154, 119, 174, 240, 140, + 155, 42, 156, 255, 256, 157, 43, 44, 45, 140, + 158, 268, 159, 160, 46, 161, 198, 162, 200, 163, + 164, 47, 183, 313, 48, 165, 49, 191, 166, 50, + 193, 184, 185, 186, 187, 188, 189, 190, 167, 51, + 52, 53, 215, 168, 169, 203, 194, 206, 54, 205, + 209, 212, 279, 55, 56, 213, 283, 57, 58, 59, + 140, 214, 60, 41, 222, 235, 211, 244, 241, 292, + 293, 179, 180, 181, 245, 246, 249, 254, 263, 264, + 139, 42, 270, 265, 271, 272, 43, 44, 45, 275, + 61, 276, 140, 281, 46, 256, 140, 285, 286, 288, + 295, 47, 287, 290, 48, 298, 49, 299, 300, 50, + 93, 94, 95, 96, 97, 303, 301, 98, 304, 51, + 52, 53, 305, 308, 310, 315, 316, 319, 54, 320, + 322, 324, 325, 55, 56, 326, 329, 57, 58, 59, + 116, 117, 60, 332, 328, 331, 335, 334, 336, 337, + 338, 183, 344, 153, 312, 237, 248, 284, 294, 29, + 184, 185, 186, 187, 188, 189, 190, 23, 38, 99, + 61, 0, 0, 41, 100, 101, 102, 103, 104, 0, + 105, 106, 107, 108, 0, 0, 109, 110, 0, 0, + 261, 42, 0, 0, 0, 0, 43, 44, 45, 0, + 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, + 111, 47, 0, 0, 48, 0, 49, 112, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, + 52, 53, 0, 41, 0, 0, 0, 0, 54, 0, + 0, 0, 0, 55, 56, 0, 0, 57, 58, 59, + 327, 42, 60, 0, 0, 0, 43, 44, 45, 0, + 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, + 0, 47, 0, 0, 48, 0, 49, 0, 0, 50, + 61, 0, 0, 0, 0, 0, 0, 0, 0, 51, + 52, 53, 41, 0, 0, 0, 0, 0, 54, 0, + 0, 0, 0, 55, 56, 0, 0, 57, 58, 59, + 42, 0, 60, 0, 0, 43, 44, 45, 0, 0, + 0, 0, 0, 46, 93, 94, 95, 96, 97, 0, + 47, 98, 0, 48, 0, 49, 0, 0, 50, 0, + 61, 0, 0, 0, 0, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, 0, 54, 0, 0, + 0, 0, 55, 56, 0, 0, 57, 58, 59, 0, + 0, 60, 210, 93, 94, 95, 96, 97, 0, 0, + 98, 0, 0, 99, 0, 0, 0, 0, 100, 101, + 102, 103, 104, 0, 105, 106, 107, 108, 0, 61, + 109, 110, 177, 178, 0, 179, 180, 181, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 177, 178, + 0, 179, 180, 181, 111, 0, 0, 0, 0, 0, + 0, 112, 99, 0, 0, 0, 182, 100, 101, 102, + 103, 104, 0, 105, 106, 107, 108, 0, 0, 109, + 110, 177, 178, 0, 179, 180, 181, 0, 177, 178, + 0, 179, 180, 181, 0, 0, 0, 0, 0, 0, + 0, 0, 192, 111, 177, 178, 0, 179, 180, 181, + 112, 0, 0, 0, 0, 183, 0, 0, 0, 269, + 0, 0, 302, 0, 184, 185, 186, 187, 188, 189, + 190, 183, 0, 177, 178, 262, 179, 180, 181, 0, + 184, 185, 186, 187, 188, 189, 190, 0, 0, 0, + 0, 0, 177, 178, 307, 179, 180, 181, 0, 0, + 0, 0, 0, 0, 183, 0, 0, 0, 0, 0, + 0, 183, 0, 184, 185, 186, 187, 188, 189, 190, + 184, 185, 186, 187, 188, 189, 190, 183, 0, 0, + 0, 0, 0, 0, 0, 0, 184, 185, 186, 187, + 188, 189, 190, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 183, 0, 0, 0, + 0, 0, 0, 0, 0, 184, 185, 186, 187, 188, + 189, 190, 0, 0, 0, 183, 0, 0, 0, 0, + 0, 0, 0, 0, 184, 185, 186, 187, 188, 189, + 190 }; static const yytype_int16 yycheck[] = { - 12, 64, 43, 44, 49, 46, 74, 185, 40, 38, - 127, 9, 26, 25, 131, 132, 9, 195, 15, 15, - 3, 4, 5, 6, 7, 8, 9, 15, 58, 12, - 64, 35, 19, 20, 21, 22, 114, 24, 116, 69, - 194, 57, 114, 59, 116, 114, 50, 116, 114, 63, - 116, 16, 93, 36, 37, 114, 90, 116, 212, 9, - 101, 91, 114, 114, 116, 116, 17, 18, 46, 47, - 63, 116, 0, 114, 115, 112, 9, 113, 25, 108, - 258, 112, 65, 200, 116, 9, 9, 70, 71, 72, - 73, 74, 9, 76, 77, 78, 79, 94, 94, 82, - 83, 99, 112, 25, 62, 9, 94, 49, 39, 150, - 106, 107, 108, 109, 9, 102, 9, 9, 87, 35, - 108, 109, 9, 106, 87, 108, 112, 305, 113, 40, - 113, 112, 310, 112, 39, 112, 112, 112, 112, 180, - 181, 182, 183, 184, 112, 112, 187, 188, 189, 190, - 191, 192, 193, 270, 111, 196, 112, 112, 199, 112, - 201, 224, 17, 112, 112, 49, 112, 112, 112, 112, - 111, 234, 112, 241, 112, 112, 3, 4, 5, 6, - 7, 8, 9, 113, 301, 12, 113, 113, 52, 60, - 69, 69, 113, 113, 112, 5, 9, 3, 4, 5, - 6, 7, 8, 9, 9, 113, 12, 58, 9, 36, - 37, 55, 115, 9, 255, 114, 116, 103, 259, 116, - 10, 11, 285, 13, 14, 15, 9, 9, 269, 9, - 113, 272, 273, 31, 27, 32, 10, 11, 65, 13, - 14, 15, 114, 70, 71, 72, 73, 74, 54, 76, - 77, 78, 79, 9, 317, 82, 83, 41, 321, 65, - 114, 61, 118, 275, 70, 71, 72, 73, 74, 115, - 76, 77, 78, 79, 28, 51, 82, 83, 113, 106, - 91, 100, 17, 44, 3, 88, 113, 3, 4, 5, - 6, 7, 8, 9, 101, 113, 12, 92, 45, 114, - 106, 12, 9, 9, 94, 93, 32, 113, 8, 103, - 3, 9, 208, 103, 104, 105, 106, 107, 108, 109, - 94, 74, 199, 14, 114, 27, 261, 300, -1, 103, - 104, 105, 106, 107, 108, 109, -1, 34, 274, -1, - 114, -1, -1, -1, -1, -1, -1, -1, -1, 65, - -1, -1, 9, -1, 70, 71, 72, 73, 74, -1, - 76, 77, 78, 79, -1, -1, 82, 83, -1, -1, - -1, 28, -1, 30, 31, -1, 33, 34, 35, -1, - -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, - 106, 48, -1, -1, 51, -1, 53, 113, -1, 56, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, - 67, 68, 9, -1, -1, -1, -1, -1, 75, -1, - -1, -1, -1, 80, 81, -1, -1, 84, 85, 86, - 27, 28, 89, -1, -1, -1, 33, 34, 35, -1, - -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, - -1, 48, -1, -1, 51, -1, 53, -1, -1, 56, - 117, -1, -1, -1, -1, -1, -1, -1, -1, 66, - 67, 68, 9, -1, -1, -1, -1, -1, 75, -1, - -1, -1, -1, 80, 81, -1, -1, 84, 85, 86, - 27, 28, 89, -1, -1, -1, 33, 34, 35, -1, - -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, - -1, 48, -1, -1, 51, -1, 53, -1, -1, 56, - 117, -1, -1, -1, -1, -1, -1, -1, -1, 66, - 67, 68, 9, -1, -1, -1, -1, -1, 75, -1, - -1, -1, -1, 80, 81, -1, -1, 84, 85, 86, - 27, 28, 89, -1, -1, -1, 33, 34, 35, -1, - -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, - -1, 48, -1, -1, 51, -1, 53, -1, -1, 56, - 117, 10, 11, -1, 13, 14, 15, -1, -1, 66, - 67, 68, 9, -1, -1, -1, -1, -1, 75, -1, - 29, -1, -1, 80, 81, -1, -1, 84, 85, 86, - -1, 28, 89, -1, -1, -1, 33, 34, 35, -1, - -1, -1, 10, 11, 41, 13, 14, 15, -1, -1, - -1, 48, -1, -1, 51, -1, 53, -1, -1, 56, - 117, -1, -1, -1, 32, -1, -1, -1, -1, 66, - 67, 68, 10, 11, -1, 13, 14, 15, 75, -1, - -1, -1, -1, 80, 81, 94, -1, 84, 85, 86, - -1, -1, 89, -1, 103, 104, 105, 106, 107, 108, - 109, -1, 10, 11, 42, 13, 14, 15, -1, 10, - 11, -1, 13, 14, 15, -1, -1, -1, -1, -1, - 117, 29, -1, -1, -1, -1, 94, -1, -1, 10, - 11, 32, 13, 14, 15, 103, 104, 105, 106, 107, - 108, 109, -1, -1, -1, -1, -1, -1, 13, 14, - 15, -1, -1, -1, -1, -1, 94, -1, -1, -1, - -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, - 108, 109, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 94, -1, -1, -1, - -1, -1, -1, 94, -1, 103, 104, 105, 106, 107, - 108, 109, 103, 104, 105, 106, 107, 108, 109, -1, - -1, -1, -1, 94, -1, -1, -1, -1, -1, -1, - -1, -1, 103, 104, 105, 106, 107, 108, 109, 94, - -1, -1, -1, -1, -1, -1, -1, -1, 103, 104, - 105, 106, 107, 108, 109 + 12, 63, 42, 43, 7, 45, 73, 182, 46, 124, + 23, 35, 24, 128, 129, 7, 13, 192, 61, 3, + 4, 5, 6, 7, 57, 191, 10, 13, 7, 17, + 18, 19, 13, 21, 14, 68, 37, 111, 32, 113, + 54, 0, 56, 209, 87, 109, 111, 60, 113, 33, + 34, 110, 92, 47, 111, 7, 113, 90, 98, 111, + 111, 113, 113, 111, 111, 113, 113, 22, 60, 15, + 16, 111, 112, 43, 44, 113, 7, 109, 62, 7, + 255, 105, 197, 67, 68, 69, 70, 71, 7, 73, + 74, 75, 76, 96, 91, 79, 80, 22, 109, 8, + 9, 59, 11, 12, 13, 91, 7, 147, 105, 106, + 91, 99, 113, 46, 36, 7, 7, 7, 32, 103, + 84, 105, 103, 104, 105, 106, 110, 302, 84, 7, + 37, 109, 307, 110, 109, 109, 109, 177, 178, 179, + 180, 181, 109, 7, 184, 185, 186, 187, 188, 189, + 190, 108, 267, 193, 36, 109, 196, 108, 198, 221, + 109, 25, 109, 27, 28, 109, 30, 31, 32, 231, + 109, 238, 109, 109, 38, 109, 15, 109, 49, 109, + 109, 45, 91, 298, 48, 109, 50, 110, 109, 53, + 110, 100, 101, 102, 103, 104, 105, 106, 109, 63, + 64, 65, 111, 109, 109, 57, 110, 110, 72, 46, + 110, 109, 252, 77, 78, 66, 256, 81, 82, 83, + 282, 66, 86, 7, 5, 7, 266, 110, 7, 269, + 270, 11, 12, 13, 55, 7, 112, 52, 7, 111, + 24, 25, 100, 113, 113, 7, 30, 31, 32, 7, + 114, 110, 314, 7, 38, 28, 318, 24, 29, 7, + 272, 45, 111, 38, 48, 58, 50, 111, 115, 53, + 3, 4, 5, 6, 7, 25, 112, 10, 48, 63, + 64, 65, 88, 110, 97, 15, 41, 3, 72, 85, + 98, 110, 89, 77, 78, 42, 10, 81, 82, 83, + 33, 34, 86, 7, 111, 100, 7, 90, 29, 6, + 3, 91, 7, 73, 297, 196, 205, 258, 271, 26, + 100, 101, 102, 103, 104, 105, 106, 14, 33, 62, + 114, -1, -1, 7, 67, 68, 69, 70, 71, -1, + 73, 74, 75, 76, -1, -1, 79, 80, -1, -1, + 24, 25, -1, -1, -1, -1, 30, 31, 32, -1, + -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, + 103, 45, -1, -1, 48, -1, 50, 110, -1, 53, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, + 64, 65, -1, 7, -1, -1, -1, -1, 72, -1, + -1, -1, -1, 77, 78, -1, -1, 81, 82, 83, + 24, 25, 86, -1, -1, -1, 30, 31, 32, -1, + -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, + -1, 45, -1, -1, 48, -1, 50, -1, -1, 53, + 114, -1, -1, -1, -1, -1, -1, -1, -1, 63, + 64, 65, 7, -1, -1, -1, -1, -1, 72, -1, + -1, -1, -1, 77, 78, -1, -1, 81, 82, 83, + 25, -1, 86, -1, -1, 30, 31, 32, -1, -1, + -1, -1, -1, 38, 3, 4, 5, 6, 7, -1, + 45, 10, -1, 48, -1, 50, -1, -1, 53, -1, + 114, -1, -1, -1, -1, -1, -1, -1, 63, 64, + 65, -1, -1, -1, -1, -1, -1, 72, -1, -1, + -1, -1, 77, 78, -1, -1, 81, 82, 83, -1, + -1, 86, 51, 3, 4, 5, 6, 7, -1, -1, + 10, -1, -1, 62, -1, -1, -1, -1, 67, 68, + 69, 70, 71, -1, 73, 74, 75, 76, -1, 114, + 79, 80, 8, 9, -1, 11, 12, 13, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 8, 9, + -1, 11, 12, 13, 103, -1, -1, -1, -1, -1, + -1, 110, 62, -1, -1, -1, 26, 67, 68, 69, + 70, 71, -1, 73, 74, 75, 76, -1, -1, 79, + 80, 8, 9, -1, 11, 12, 13, -1, 8, 9, + -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, + -1, -1, 29, 103, 8, 9, -1, 11, 12, 13, + 110, -1, -1, -1, -1, 91, -1, -1, -1, 39, + -1, -1, 26, -1, 100, 101, 102, 103, 104, 105, + 106, 91, -1, 8, 9, 111, 11, 12, 13, -1, + 100, 101, 102, 103, 104, 105, 106, -1, -1, -1, + -1, -1, 8, 9, 29, 11, 12, 13, -1, -1, + -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, + -1, 91, -1, 100, 101, 102, 103, 104, 105, 106, + 100, 101, 102, 103, 104, 105, 106, 91, -1, -1, + -1, -1, -1, -1, -1, -1, 100, 101, 102, 103, + 104, 105, 106, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, + -1, -1, -1, -1, -1, 100, 101, 102, 103, 104, + 105, 106, -1, -1, -1, 91, -1, -1, -1, -1, + -1, -1, -1, -1, 100, 101, 102, 103, 104, 105, + 106 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 16, 120, 190, 9, 0, 112, 113, 9, 182, - 183, 17, 18, 114, 116, 19, 20, 21, 22, 24, - 102, 181, 181, 25, 182, 9, 184, 185, 181, 63, - 184, 186, 187, 188, 189, 112, 64, 90, 26, 188, - 9, 9, 9, 28, 33, 34, 35, 41, 48, 51, - 53, 56, 66, 67, 68, 75, 80, 81, 84, 85, - 86, 89, 117, 121, 122, 126, 127, 128, 141, 142, - 143, 147, 148, 149, 150, 151, 152, 153, 154, 158, - 159, 160, 161, 162, 163, 164, 165, 173, 177, 179, - 180, 25, 112, 62, 3, 4, 5, 6, 7, 8, - 9, 12, 65, 70, 71, 72, 73, 74, 76, 77, - 78, 79, 82, 83, 106, 113, 123, 124, 123, 36, - 37, 108, 123, 133, 134, 135, 9, 49, 9, 99, - 178, 39, 57, 59, 175, 9, 9, 9, 141, 87, - 87, 9, 27, 121, 112, 113, 112, 50, 141, 112, - 40, 136, 146, 112, 112, 136, 146, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 141, 123, 111, 123, 111, 123, 123, - 10, 11, 13, 14, 15, 29, 94, 103, 104, 105, - 106, 107, 108, 109, 113, 32, 113, 113, 49, 116, - 39, 17, 178, 52, 178, 178, 60, 176, 49, 113, - 123, 132, 113, 54, 123, 112, 69, 69, 114, 123, - 123, 123, 123, 123, 122, 5, 123, 123, 123, 123, - 123, 123, 123, 132, 122, 123, 38, 108, 9, 131, - 133, 130, 178, 123, 9, 144, 145, 113, 58, 9, - 129, 131, 115, 125, 114, 116, 132, 55, 30, 31, - 155, 156, 157, 114, 27, 114, 9, 114, 116, 40, - 116, 136, 42, 103, 116, 9, 166, 167, 9, 113, - 114, 116, 123, 114, 9, 122, 123, 155, 27, 32, - 114, 9, 178, 41, 137, 123, 123, 144, 181, 114, - 116, 61, 114, 118, 115, 29, 28, 51, 91, 138, - 32, 113, 168, 100, 171, 166, 178, 122, 17, 44, - 140, 122, 3, 88, 169, 101, 172, 113, 92, 45, - 27, 114, 12, 170, 103, 9, 174, 93, 9, 32, - 8, 3, 114, 116, 46, 47, 139, 9 + 0, 14, 117, 187, 7, 0, 109, 110, 7, 179, + 180, 15, 16, 111, 113, 17, 18, 19, 21, 99, + 178, 178, 22, 179, 7, 181, 182, 178, 60, 181, + 183, 184, 185, 186, 109, 61, 87, 23, 185, 7, + 7, 7, 25, 30, 31, 32, 38, 45, 48, 50, + 53, 63, 64, 65, 72, 77, 78, 81, 82, 83, + 86, 114, 118, 119, 123, 124, 125, 138, 139, 140, + 144, 145, 146, 147, 148, 149, 150, 151, 155, 156, + 157, 158, 159, 160, 161, 162, 170, 174, 176, 177, + 22, 109, 59, 3, 4, 5, 6, 7, 10, 62, + 67, 68, 69, 70, 71, 73, 74, 75, 76, 79, + 80, 103, 110, 120, 121, 120, 33, 34, 105, 120, + 130, 131, 132, 7, 46, 7, 96, 175, 36, 54, + 56, 172, 7, 7, 7, 138, 84, 84, 7, 24, + 118, 109, 110, 109, 47, 138, 109, 37, 133, 143, + 109, 109, 133, 143, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 138, 120, 108, 120, 108, 120, 120, 8, 9, 11, + 12, 13, 26, 91, 100, 101, 102, 103, 104, 105, + 106, 110, 29, 110, 110, 46, 113, 36, 15, 175, + 49, 175, 175, 57, 173, 46, 110, 120, 129, 110, + 51, 120, 109, 66, 66, 111, 120, 120, 120, 120, + 120, 119, 5, 120, 120, 120, 120, 120, 120, 120, + 129, 119, 120, 35, 105, 7, 128, 130, 127, 175, + 120, 7, 141, 142, 110, 55, 7, 126, 128, 112, + 122, 111, 113, 129, 52, 27, 28, 152, 153, 154, + 111, 24, 111, 7, 111, 113, 37, 113, 133, 39, + 100, 113, 7, 163, 164, 7, 110, 111, 113, 120, + 111, 7, 119, 120, 152, 24, 29, 111, 7, 175, + 38, 134, 120, 120, 141, 178, 111, 113, 58, 111, + 115, 112, 26, 25, 48, 88, 135, 29, 110, 165, + 97, 168, 163, 175, 119, 15, 41, 137, 119, 3, + 85, 166, 98, 169, 110, 89, 42, 24, 111, 10, + 167, 100, 7, 171, 90, 7, 29, 6, 3, 111, + 113, 43, 44, 136, 7 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 119, 120, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 122, 122, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 125, 125, 125, 126, 127, - 128, 128, 128, 129, 130, 130, 131, 131, 131, 132, - 132, 132, 133, 133, 133, 133, 134, 134, 134, 135, - 135, 135, 136, 136, 137, 137, 138, 138, 139, 139, - 139, 140, 140, 141, 142, 143, 143, 144, 145, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 156, 157, 157, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 165, 166, 167, 167, 168, 168, 169, - 169, 170, 170, 171, 171, 172, 172, 173, 174, 174, - 175, 175, 176, 176, 177, 178, 178, 179, 180, 181, - 181, 181, 181, 181, 181, 182, 182, 183, 183, 183, - 184, 185, 185, 185, 186, 187, 188, 188, 189, 189, - 189, 190 + 0, 116, 117, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 118, 118, 119, 119, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 122, 122, 122, 123, 124, 125, 125, + 125, 126, 127, 127, 128, 128, 128, 129, 129, 129, + 130, 130, 130, 130, 131, 131, 131, 132, 132, 132, + 133, 133, 134, 134, 135, 135, 136, 136, 136, 137, + 137, 138, 139, 140, 140, 141, 142, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 153, + 154, 154, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 162, 163, 164, 164, 165, 165, 166, 166, 167, + 167, 168, 168, 169, 169, 170, 171, 171, 172, 172, + 173, 173, 174, 175, 175, 176, 177, 178, 178, 178, + 178, 178, 179, 179, 180, 180, 180, 181, 182, 182, + 182, 183, 184, 185, 185, 186, 186, 186, 187 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -1018,22 +1004,21 @@ static const yytype_uint8 yyr2[] = 0, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 4, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, - 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 2, 3, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 1, 3, 6, 4, - 1, 1, 1, 3, 1, 3, 0, 1, 3, 0, - 1, 3, 1, 4, 5, 4, 0, 1, 3, 1, - 3, 1, 0, 2, 0, 2, 0, 4, 0, 1, - 1, 0, 4, 8, 3, 5, 2, 3, 1, 3, - 4, 4, 2, 2, 3, 2, 2, 2, 3, 4, - 1, 2, 0, 2, 1, 7, 6, 10, 1, 1, - 2, 2, 4, 4, 5, 1, 3, 0, 3, 0, - 1, 0, 2, 0, 1, 0, 3, 8, 1, 3, - 0, 1, 0, 1, 10, 1, 1, 2, 2, 1, - 1, 1, 1, 1, 1, 3, 3, 0, 1, 3, - 3, 0, 1, 2, 6, 4, 1, 1, 0, 1, - 2, 11 + 1, 1, 1, 1, 3, 3, 3, 3, 2, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, + 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 1, 3, 6, 4, 1, 1, + 1, 3, 1, 3, 0, 1, 3, 0, 1, 3, + 1, 4, 5, 4, 0, 1, 3, 1, 3, 1, + 0, 2, 0, 2, 0, 4, 0, 1, 1, 0, + 4, 8, 3, 5, 2, 3, 1, 3, 4, 4, + 2, 2, 3, 2, 2, 2, 3, 4, 1, 2, + 0, 2, 1, 7, 6, 10, 1, 1, 2, 2, + 4, 4, 5, 1, 3, 0, 3, 0, 1, 0, + 2, 0, 1, 0, 3, 8, 1, 3, 0, 1, + 0, 1, 10, 1, 1, 2, 2, 1, 1, 1, + 1, 1, 3, 3, 0, 1, 3, 3, 0, 1, + 2, 6, 4, 1, 1, 0, 1, 2, 11 }; @@ -1710,471 +1695,459 @@ yyparse (void) switch (yyn) { case 25: -#line 191 "pars0grm.y" /* yacc.c:1646 */ +#line 188 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); } -#line 1716 "pars0grm.cc" /* yacc.c:1646 */ +#line 1701 "pars0grm.cc" /* yacc.c:1646 */ break; case 26: -#line 193 "pars0grm.y" /* yacc.c:1646 */ +#line 190 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last((yyvsp[-1]), (yyvsp[0])); } -#line 1722 "pars0grm.cc" /* yacc.c:1646 */ +#line 1707 "pars0grm.cc" /* yacc.c:1646 */ break; case 27: -#line 197 "pars0grm.y" /* yacc.c:1646 */ +#line 194 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]);} -#line 1728 "pars0grm.cc" /* yacc.c:1646 */ +#line 1713 "pars0grm.cc" /* yacc.c:1646 */ break; case 28: -#line 199 "pars0grm.y" /* yacc.c:1646 */ +#line 196 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_func((yyvsp[-3]), (yyvsp[-1])); } -#line 1734 "pars0grm.cc" /* yacc.c:1646 */ +#line 1719 "pars0grm.cc" /* yacc.c:1646 */ break; case 29: -#line 200 "pars0grm.y" /* yacc.c:1646 */ +#line 197 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]);} -#line 1740 "pars0grm.cc" /* yacc.c:1646 */ +#line 1725 "pars0grm.cc" /* yacc.c:1646 */ break; case 30: -#line 201 "pars0grm.y" /* yacc.c:1646 */ +#line 198 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]);} -#line 1746 "pars0grm.cc" /* yacc.c:1646 */ +#line 1731 "pars0grm.cc" /* yacc.c:1646 */ break; case 31: -#line 202 "pars0grm.y" /* yacc.c:1646 */ +#line 199 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]);} -#line 1752 "pars0grm.cc" /* yacc.c:1646 */ +#line 1737 "pars0grm.cc" /* yacc.c:1646 */ break; case 32: -#line 203 "pars0grm.y" /* yacc.c:1646 */ +#line 200 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]);} -#line 1758 "pars0grm.cc" /* yacc.c:1646 */ +#line 1743 "pars0grm.cc" /* yacc.c:1646 */ break; case 33: -#line 204 "pars0grm.y" /* yacc.c:1646 */ +#line 201 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]);} -#line 1764 "pars0grm.cc" /* yacc.c:1646 */ +#line 1749 "pars0grm.cc" /* yacc.c:1646 */ break; case 34: -#line 205 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]);} -#line 1770 "pars0grm.cc" /* yacc.c:1646 */ +#line 202 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op('+', (yyvsp[-2]), (yyvsp[0])); } +#line 1755 "pars0grm.cc" /* yacc.c:1646 */ break; case 35: -#line 206 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]);} -#line 1776 "pars0grm.cc" /* yacc.c:1646 */ +#line 203 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op('-', (yyvsp[-2]), (yyvsp[0])); } +#line 1761 "pars0grm.cc" /* yacc.c:1646 */ break; case 36: -#line 207 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op('+', (yyvsp[-2]), (yyvsp[0])); } -#line 1782 "pars0grm.cc" /* yacc.c:1646 */ +#line 204 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op('*', (yyvsp[-2]), (yyvsp[0])); } +#line 1767 "pars0grm.cc" /* yacc.c:1646 */ break; case 37: -#line 208 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op('-', (yyvsp[-2]), (yyvsp[0])); } -#line 1788 "pars0grm.cc" /* yacc.c:1646 */ +#line 205 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op('/', (yyvsp[-2]), (yyvsp[0])); } +#line 1773 "pars0grm.cc" /* yacc.c:1646 */ break; case 38: -#line 209 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op('*', (yyvsp[-2]), (yyvsp[0])); } -#line 1794 "pars0grm.cc" /* yacc.c:1646 */ +#line 206 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op('-', (yyvsp[0]), NULL); } +#line 1779 "pars0grm.cc" /* yacc.c:1646 */ break; case 39: -#line 210 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op('/', (yyvsp[-2]), (yyvsp[0])); } -#line 1800 "pars0grm.cc" /* yacc.c:1646 */ +#line 207 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[-1]); } +#line 1785 "pars0grm.cc" /* yacc.c:1646 */ break; case 40: -#line 211 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op('-', (yyvsp[0]), NULL); } -#line 1806 "pars0grm.cc" /* yacc.c:1646 */ +#line 208 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op('=', (yyvsp[-2]), (yyvsp[0])); } +#line 1791 "pars0grm.cc" /* yacc.c:1646 */ break; case 41: -#line 212 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[-1]); } -#line 1812 "pars0grm.cc" /* yacc.c:1646 */ +#line 210 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op(PARS_LIKE_TOKEN, (yyvsp[-2]), (yyvsp[0])); } +#line 1797 "pars0grm.cc" /* yacc.c:1646 */ break; case 42: -#line 213 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op('=', (yyvsp[-2]), (yyvsp[0])); } -#line 1818 "pars0grm.cc" /* yacc.c:1646 */ +#line 211 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op('<', (yyvsp[-2]), (yyvsp[0])); } +#line 1803 "pars0grm.cc" /* yacc.c:1646 */ break; case 43: -#line 215 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op(PARS_LIKE_TOKEN, (yyvsp[-2]), (yyvsp[0])); } -#line 1824 "pars0grm.cc" /* yacc.c:1646 */ +#line 212 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op('>', (yyvsp[-2]), (yyvsp[0])); } +#line 1809 "pars0grm.cc" /* yacc.c:1646 */ break; case 44: -#line 216 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op('<', (yyvsp[-2]), (yyvsp[0])); } -#line 1830 "pars0grm.cc" /* yacc.c:1646 */ +#line 213 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op(PARS_GE_TOKEN, (yyvsp[-2]), (yyvsp[0])); } +#line 1815 "pars0grm.cc" /* yacc.c:1646 */ break; case 45: -#line 217 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op('>', (yyvsp[-2]), (yyvsp[0])); } -#line 1836 "pars0grm.cc" /* yacc.c:1646 */ +#line 214 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op(PARS_LE_TOKEN, (yyvsp[-2]), (yyvsp[0])); } +#line 1821 "pars0grm.cc" /* yacc.c:1646 */ break; case 46: -#line 218 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op(PARS_GE_TOKEN, (yyvsp[-2]), (yyvsp[0])); } -#line 1842 "pars0grm.cc" /* yacc.c:1646 */ +#line 215 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op(PARS_NE_TOKEN, (yyvsp[-2]), (yyvsp[0])); } +#line 1827 "pars0grm.cc" /* yacc.c:1646 */ break; case 47: -#line 219 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op(PARS_LE_TOKEN, (yyvsp[-2]), (yyvsp[0])); } -#line 1848 "pars0grm.cc" /* yacc.c:1646 */ +#line 216 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op(PARS_AND_TOKEN, (yyvsp[-2]), (yyvsp[0])); } +#line 1833 "pars0grm.cc" /* yacc.c:1646 */ break; case 48: -#line 220 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op(PARS_NE_TOKEN, (yyvsp[-2]), (yyvsp[0])); } -#line 1854 "pars0grm.cc" /* yacc.c:1646 */ +#line 217 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op(PARS_OR_TOKEN, (yyvsp[-2]), (yyvsp[0])); } +#line 1839 "pars0grm.cc" /* yacc.c:1646 */ break; case 49: -#line 221 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op(PARS_AND_TOKEN, (yyvsp[-2]), (yyvsp[0])); } -#line 1860 "pars0grm.cc" /* yacc.c:1646 */ +#line 218 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op(PARS_NOT_TOKEN, (yyvsp[0]), NULL); } +#line 1845 "pars0grm.cc" /* yacc.c:1646 */ break; case 50: -#line 222 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op(PARS_OR_TOKEN, (yyvsp[-2]), (yyvsp[0])); } -#line 1866 "pars0grm.cc" /* yacc.c:1646 */ +#line 220 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op(PARS_NOTFOUND_TOKEN, (yyvsp[-2]), NULL); } +#line 1851 "pars0grm.cc" /* yacc.c:1646 */ break; case 51: -#line 223 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op(PARS_NOT_TOKEN, (yyvsp[0]), NULL); } -#line 1872 "pars0grm.cc" /* yacc.c:1646 */ +#line 222 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_op(PARS_NOTFOUND_TOKEN, (yyvsp[-2]), NULL); } +#line 1857 "pars0grm.cc" /* yacc.c:1646 */ break; case 52: -#line 225 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op(PARS_NOTFOUND_TOKEN, (yyvsp[-2]), NULL); } -#line 1878 "pars0grm.cc" /* yacc.c:1646 */ +#line 226 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_to_char_token; } +#line 1863 "pars0grm.cc" /* yacc.c:1646 */ break; case 53: #line 227 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_op(PARS_NOTFOUND_TOKEN, (yyvsp[-2]), NULL); } -#line 1884 "pars0grm.cc" /* yacc.c:1646 */ + { (yyval) = &pars_to_number_token; } +#line 1869 "pars0grm.cc" /* yacc.c:1646 */ break; case 54: -#line 231 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_to_char_token; } -#line 1890 "pars0grm.cc" /* yacc.c:1646 */ +#line 228 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_to_binary_token; } +#line 1875 "pars0grm.cc" /* yacc.c:1646 */ break; case 55: -#line 232 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_to_number_token; } -#line 1896 "pars0grm.cc" /* yacc.c:1646 */ +#line 230 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_binary_to_number_token; } +#line 1881 "pars0grm.cc" /* yacc.c:1646 */ break; case 56: -#line 233 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_to_binary_token; } -#line 1902 "pars0grm.cc" /* yacc.c:1646 */ +#line 231 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_substr_token; } +#line 1887 "pars0grm.cc" /* yacc.c:1646 */ break; case 57: -#line 235 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_binary_to_number_token; } -#line 1908 "pars0grm.cc" /* yacc.c:1646 */ +#line 232 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_concat_token; } +#line 1893 "pars0grm.cc" /* yacc.c:1646 */ break; case 58: -#line 236 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_substr_token; } -#line 1914 "pars0grm.cc" /* yacc.c:1646 */ +#line 233 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_instr_token; } +#line 1899 "pars0grm.cc" /* yacc.c:1646 */ break; case 59: -#line 237 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_concat_token; } -#line 1920 "pars0grm.cc" /* yacc.c:1646 */ +#line 234 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_length_token; } +#line 1905 "pars0grm.cc" /* yacc.c:1646 */ break; case 60: -#line 238 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_instr_token; } -#line 1926 "pars0grm.cc" /* yacc.c:1646 */ +#line 235 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_sysdate_token; } +#line 1911 "pars0grm.cc" /* yacc.c:1646 */ break; case 61: -#line 239 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_length_token; } -#line 1932 "pars0grm.cc" /* yacc.c:1646 */ +#line 236 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_rnd_token; } +#line 1917 "pars0grm.cc" /* yacc.c:1646 */ break; case 62: -#line 240 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_sysdate_token; } -#line 1938 "pars0grm.cc" /* yacc.c:1646 */ +#line 237 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_rnd_str_token; } +#line 1923 "pars0grm.cc" /* yacc.c:1646 */ break; - case 63: -#line 241 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_rnd_token; } -#line 1944 "pars0grm.cc" /* yacc.c:1646 */ + case 66: +#line 248 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_stored_procedure_call( + static_cast((yyvsp[-4]))); } +#line 1930 "pars0grm.cc" /* yacc.c:1646 */ break; - case 64: -#line 242 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_rnd_str_token; } -#line 1950 "pars0grm.cc" /* yacc.c:1646 */ + case 67: +#line 254 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_procedure_call((yyvsp[-3]), (yyvsp[-1])); } +#line 1936 "pars0grm.cc" /* yacc.c:1646 */ break; case 68: -#line 253 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_stored_procedure_call( - static_cast((yyvsp[-4]))); } -#line 1957 "pars0grm.cc" /* yacc.c:1646 */ +#line 258 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_replstr_token; } +#line 1942 "pars0grm.cc" /* yacc.c:1646 */ break; case 69: #line 259 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_procedure_call((yyvsp[-3]), (yyvsp[-1])); } -#line 1963 "pars0grm.cc" /* yacc.c:1646 */ + { (yyval) = &pars_printf_token; } +#line 1948 "pars0grm.cc" /* yacc.c:1646 */ break; case 70: -#line 263 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_replstr_token; } -#line 1969 "pars0grm.cc" /* yacc.c:1646 */ +#line 260 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_assert_token; } +#line 1954 "pars0grm.cc" /* yacc.c:1646 */ break; case 71: #line 264 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_printf_token; } -#line 1975 "pars0grm.cc" /* yacc.c:1646 */ + { (yyval) = (yyvsp[-2]); } +#line 1960 "pars0grm.cc" /* yacc.c:1646 */ break; case 72: -#line 265 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_assert_token; } -#line 1981 "pars0grm.cc" /* yacc.c:1646 */ +#line 268 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); } +#line 1966 "pars0grm.cc" /* yacc.c:1646 */ break; case 73: -#line 269 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[-2]); } -#line 1987 "pars0grm.cc" /* yacc.c:1646 */ +#line 270 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); } +#line 1972 "pars0grm.cc" /* yacc.c:1646 */ break; case 74: -#line 273 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); } -#line 1993 "pars0grm.cc" /* yacc.c:1646 */ +#line 274 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = NULL; } +#line 1978 "pars0grm.cc" /* yacc.c:1646 */ break; case 75: #line 275 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); } -#line 1999 "pars0grm.cc" /* yacc.c:1646 */ + { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); } +#line 1984 "pars0grm.cc" /* yacc.c:1646 */ break; case 76: -#line 279 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = NULL; } -#line 2005 "pars0grm.cc" /* yacc.c:1646 */ +#line 277 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); } +#line 1990 "pars0grm.cc" /* yacc.c:1646 */ break; case 77: -#line 280 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); } -#line 2011 "pars0grm.cc" /* yacc.c:1646 */ +#line 281 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = NULL; } +#line 1996 "pars0grm.cc" /* yacc.c:1646 */ break; case 78: #line 282 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); } -#line 2017 "pars0grm.cc" /* yacc.c:1646 */ + { (yyval) = que_node_list_add_last(NULL, (yyvsp[0]));} +#line 2002 "pars0grm.cc" /* yacc.c:1646 */ break; case 79: -#line 286 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = NULL; } -#line 2023 "pars0grm.cc" /* yacc.c:1646 */ +#line 283 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); } +#line 2008 "pars0grm.cc" /* yacc.c:1646 */ break; case 80: #line 287 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0]));} -#line 2029 "pars0grm.cc" /* yacc.c:1646 */ - break; - - case 81: -#line 288 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); } -#line 2035 "pars0grm.cc" /* yacc.c:1646 */ - break; - - case 82: -#line 292 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2041 "pars0grm.cc" /* yacc.c:1646 */ +#line 2014 "pars0grm.cc" /* yacc.c:1646 */ break; - case 83: -#line 294 "pars0grm.y" /* yacc.c:1646 */ + case 81: +#line 289 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_func(&pars_count_token, que_node_list_add_last(NULL, sym_tab_add_int_lit( pars_sym_tab_global, 1))); } -#line 2050 "pars0grm.cc" /* yacc.c:1646 */ +#line 2023 "pars0grm.cc" /* yacc.c:1646 */ break; - case 84: -#line 299 "pars0grm.y" /* yacc.c:1646 */ + case 82: +#line 294 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_func(&pars_count_token, que_node_list_add_last(NULL, pars_func(&pars_distinct_token, que_node_list_add_last( NULL, (yyvsp[-1]))))); } -#line 2060 "pars0grm.cc" /* yacc.c:1646 */ +#line 2033 "pars0grm.cc" /* yacc.c:1646 */ break; - case 85: -#line 305 "pars0grm.y" /* yacc.c:1646 */ + case 83: +#line 300 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_func(&pars_sum_token, que_node_list_add_last(NULL, (yyvsp[-1]))); } -#line 2068 "pars0grm.cc" /* yacc.c:1646 */ +#line 2041 "pars0grm.cc" /* yacc.c:1646 */ break; - case 86: -#line 311 "pars0grm.y" /* yacc.c:1646 */ + case 84: +#line 306 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2074 "pars0grm.cc" /* yacc.c:1646 */ +#line 2047 "pars0grm.cc" /* yacc.c:1646 */ break; - case 87: -#line 312 "pars0grm.y" /* yacc.c:1646 */ + case 85: +#line 307 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); } -#line 2080 "pars0grm.cc" /* yacc.c:1646 */ +#line 2053 "pars0grm.cc" /* yacc.c:1646 */ break; - case 88: -#line 314 "pars0grm.y" /* yacc.c:1646 */ + case 86: +#line 309 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); } -#line 2086 "pars0grm.cc" /* yacc.c:1646 */ +#line 2059 "pars0grm.cc" /* yacc.c:1646 */ break; - case 89: -#line 318 "pars0grm.y" /* yacc.c:1646 */ + case 87: +#line 313 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_select_list(&pars_star_denoter, NULL); } -#line 2093 "pars0grm.cc" /* yacc.c:1646 */ +#line 2066 "pars0grm.cc" /* yacc.c:1646 */ break; - case 90: -#line 321 "pars0grm.y" /* yacc.c:1646 */ + case 88: +#line 316 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_select_list( (yyvsp[-2]), static_cast((yyvsp[0]))); } -#line 2100 "pars0grm.cc" /* yacc.c:1646 */ +#line 2073 "pars0grm.cc" /* yacc.c:1646 */ + break; + + case 89: +#line 318 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = pars_select_list((yyvsp[0]), NULL); } +#line 2079 "pars0grm.cc" /* yacc.c:1646 */ + break; + + case 90: +#line 322 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = NULL; } +#line 2085 "pars0grm.cc" /* yacc.c:1646 */ break; case 91: #line 323 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = pars_select_list((yyvsp[0]), NULL); } -#line 2106 "pars0grm.cc" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 2091 "pars0grm.cc" /* yacc.c:1646 */ break; case 92: #line 327 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2112 "pars0grm.cc" /* yacc.c:1646 */ +#line 2097 "pars0grm.cc" /* yacc.c:1646 */ break; case 93: -#line 328 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 2118 "pars0grm.cc" /* yacc.c:1646 */ +#line 329 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_update_token; } +#line 2103 "pars0grm.cc" /* yacc.c:1646 */ break; case 94: -#line 332 "pars0grm.y" /* yacc.c:1646 */ +#line 333 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2124 "pars0grm.cc" /* yacc.c:1646 */ +#line 2109 "pars0grm.cc" /* yacc.c:1646 */ break; case 95: -#line 334 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_update_token; } -#line 2130 "pars0grm.cc" /* yacc.c:1646 */ +#line 335 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_share_token; } +#line 2115 "pars0grm.cc" /* yacc.c:1646 */ break; case 96: -#line 338 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = NULL; } -#line 2136 "pars0grm.cc" /* yacc.c:1646 */ +#line 339 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_asc_token; } +#line 2121 "pars0grm.cc" /* yacc.c:1646 */ break; case 97: #line 340 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_share_token; } -#line 2142 "pars0grm.cc" /* yacc.c:1646 */ + { (yyval) = &pars_asc_token; } +#line 2127 "pars0grm.cc" /* yacc.c:1646 */ break; case 98: -#line 344 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_asc_token; } -#line 2148 "pars0grm.cc" /* yacc.c:1646 */ +#line 341 "pars0grm.y" /* yacc.c:1646 */ + { (yyval) = &pars_desc_token; } +#line 2133 "pars0grm.cc" /* yacc.c:1646 */ break; case 99: #line 345 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_asc_token; } -#line 2154 "pars0grm.cc" /* yacc.c:1646 */ - break; - - case 100: -#line 346 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_desc_token; } -#line 2160 "pars0grm.cc" /* yacc.c:1646 */ - break; - - case 101: -#line 350 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2166 "pars0grm.cc" /* yacc.c:1646 */ +#line 2139 "pars0grm.cc" /* yacc.c:1646 */ break; - case 102: -#line 352 "pars0grm.y" /* yacc.c:1646 */ + case 100: +#line 347 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_order_by( static_cast((yyvsp[-1])), static_cast((yyvsp[0]))); } -#line 2174 "pars0grm.cc" /* yacc.c:1646 */ +#line 2147 "pars0grm.cc" /* yacc.c:1646 */ break; - case 103: -#line 363 "pars0grm.y" /* yacc.c:1646 */ + case 101: +#line 358 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_select_statement( static_cast((yyvsp[-6])), static_cast((yyvsp[-4])), @@ -2182,498 +2155,492 @@ yyparse (void) static_cast((yyvsp[-2])), static_cast((yyvsp[-1])), static_cast((yyvsp[0]))); } -#line 2186 "pars0grm.cc" /* yacc.c:1646 */ +#line 2159 "pars0grm.cc" /* yacc.c:1646 */ break; - case 104: -#line 374 "pars0grm.y" /* yacc.c:1646 */ + case 102: +#line 369 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2192 "pars0grm.cc" /* yacc.c:1646 */ +#line 2165 "pars0grm.cc" /* yacc.c:1646 */ break; - case 105: -#line 379 "pars0grm.y" /* yacc.c:1646 */ + case 103: +#line 374 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_insert_statement( static_cast((yyvsp[-4])), (yyvsp[-1]), NULL); } -#line 2199 "pars0grm.cc" /* yacc.c:1646 */ +#line 2172 "pars0grm.cc" /* yacc.c:1646 */ break; - case 106: -#line 382 "pars0grm.y" /* yacc.c:1646 */ + case 104: +#line 377 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_insert_statement( static_cast((yyvsp[-1])), NULL, static_cast((yyvsp[0]))); } -#line 2208 "pars0grm.cc" /* yacc.c:1646 */ +#line 2181 "pars0grm.cc" /* yacc.c:1646 */ break; - case 107: -#line 389 "pars0grm.y" /* yacc.c:1646 */ + case 105: +#line 384 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_column_assignment( static_cast((yyvsp[-2])), static_cast((yyvsp[0]))); } -#line 2216 "pars0grm.cc" /* yacc.c:1646 */ +#line 2189 "pars0grm.cc" /* yacc.c:1646 */ break; - case 108: -#line 395 "pars0grm.y" /* yacc.c:1646 */ + case 106: +#line 390 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); } -#line 2222 "pars0grm.cc" /* yacc.c:1646 */ +#line 2195 "pars0grm.cc" /* yacc.c:1646 */ break; - case 109: -#line 397 "pars0grm.y" /* yacc.c:1646 */ + case 107: +#line 392 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); } -#line 2228 "pars0grm.cc" /* yacc.c:1646 */ +#line 2201 "pars0grm.cc" /* yacc.c:1646 */ break; - case 110: -#line 403 "pars0grm.y" /* yacc.c:1646 */ + case 108: +#line 398 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2234 "pars0grm.cc" /* yacc.c:1646 */ +#line 2207 "pars0grm.cc" /* yacc.c:1646 */ break; - case 111: -#line 409 "pars0grm.y" /* yacc.c:1646 */ + case 109: +#line 404 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_update_statement_start( FALSE, static_cast((yyvsp[-2])), static_cast((yyvsp[0]))); } -#line 2243 "pars0grm.cc" /* yacc.c:1646 */ +#line 2216 "pars0grm.cc" /* yacc.c:1646 */ break; - case 112: -#line 417 "pars0grm.y" /* yacc.c:1646 */ + case 110: +#line 412 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_update_statement( static_cast((yyvsp[-1])), NULL, static_cast((yyvsp[0]))); } -#line 2252 "pars0grm.cc" /* yacc.c:1646 */ +#line 2225 "pars0grm.cc" /* yacc.c:1646 */ break; - case 113: -#line 425 "pars0grm.y" /* yacc.c:1646 */ + case 111: +#line 420 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_update_statement( static_cast((yyvsp[-1])), static_cast((yyvsp[0])), NULL); } -#line 2261 "pars0grm.cc" /* yacc.c:1646 */ +#line 2234 "pars0grm.cc" /* yacc.c:1646 */ break; - case 114: -#line 433 "pars0grm.y" /* yacc.c:1646 */ + case 112: +#line 428 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_update_statement_start( TRUE, static_cast((yyvsp[0])), NULL); } -#line 2269 "pars0grm.cc" /* yacc.c:1646 */ +#line 2242 "pars0grm.cc" /* yacc.c:1646 */ break; - case 115: -#line 440 "pars0grm.y" /* yacc.c:1646 */ + case 113: +#line 435 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_update_statement( static_cast((yyvsp[-1])), NULL, static_cast((yyvsp[0]))); } -#line 2278 "pars0grm.cc" /* yacc.c:1646 */ +#line 2251 "pars0grm.cc" /* yacc.c:1646 */ break; - case 116: -#line 448 "pars0grm.y" /* yacc.c:1646 */ + case 114: +#line 443 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_update_statement( static_cast((yyvsp[-1])), static_cast((yyvsp[0])), NULL); } -#line 2287 "pars0grm.cc" /* yacc.c:1646 */ +#line 2260 "pars0grm.cc" /* yacc.c:1646 */ break; - case 117: -#line 456 "pars0grm.y" /* yacc.c:1646 */ + case 115: +#line 451 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_row_printf_statement( static_cast((yyvsp[0]))); } -#line 2294 "pars0grm.cc" /* yacc.c:1646 */ +#line 2267 "pars0grm.cc" /* yacc.c:1646 */ break; - case 118: -#line 462 "pars0grm.y" /* yacc.c:1646 */ + case 116: +#line 457 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_assignment_statement( static_cast((yyvsp[-2])), static_cast((yyvsp[0]))); } -#line 2302 "pars0grm.cc" /* yacc.c:1646 */ +#line 2275 "pars0grm.cc" /* yacc.c:1646 */ break; - case 119: -#line 470 "pars0grm.y" /* yacc.c:1646 */ + case 117: +#line 465 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_elsif_element((yyvsp[-2]), (yyvsp[0])); } -#line 2308 "pars0grm.cc" /* yacc.c:1646 */ +#line 2281 "pars0grm.cc" /* yacc.c:1646 */ break; - case 120: -#line 474 "pars0grm.y" /* yacc.c:1646 */ + case 118: +#line 469 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); } -#line 2314 "pars0grm.cc" /* yacc.c:1646 */ +#line 2287 "pars0grm.cc" /* yacc.c:1646 */ break; - case 121: -#line 476 "pars0grm.y" /* yacc.c:1646 */ + case 119: +#line 471 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last((yyvsp[-1]), (yyvsp[0])); } -#line 2320 "pars0grm.cc" /* yacc.c:1646 */ +#line 2293 "pars0grm.cc" /* yacc.c:1646 */ break; - case 122: -#line 480 "pars0grm.y" /* yacc.c:1646 */ + case 120: +#line 475 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2326 "pars0grm.cc" /* yacc.c:1646 */ +#line 2299 "pars0grm.cc" /* yacc.c:1646 */ break; - case 123: -#line 482 "pars0grm.y" /* yacc.c:1646 */ + case 121: +#line 477 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2332 "pars0grm.cc" /* yacc.c:1646 */ +#line 2305 "pars0grm.cc" /* yacc.c:1646 */ break; - case 124: -#line 483 "pars0grm.y" /* yacc.c:1646 */ + case 122: +#line 478 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2338 "pars0grm.cc" /* yacc.c:1646 */ +#line 2311 "pars0grm.cc" /* yacc.c:1646 */ break; - case 125: -#line 490 "pars0grm.y" /* yacc.c:1646 */ + case 123: +#line 485 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_if_statement((yyvsp[-5]), (yyvsp[-3]), (yyvsp[-2])); } -#line 2344 "pars0grm.cc" /* yacc.c:1646 */ +#line 2317 "pars0grm.cc" /* yacc.c:1646 */ break; - case 126: -#line 496 "pars0grm.y" /* yacc.c:1646 */ + case 124: +#line 491 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_while_statement((yyvsp[-4]), (yyvsp[-2])); } -#line 2350 "pars0grm.cc" /* yacc.c:1646 */ +#line 2323 "pars0grm.cc" /* yacc.c:1646 */ break; - case 127: -#line 504 "pars0grm.y" /* yacc.c:1646 */ + case 125: +#line 499 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_for_statement( static_cast((yyvsp[-8])), (yyvsp[-6]), (yyvsp[-4]), (yyvsp[-2])); } -#line 2358 "pars0grm.cc" /* yacc.c:1646 */ +#line 2331 "pars0grm.cc" /* yacc.c:1646 */ break; - case 128: -#line 510 "pars0grm.y" /* yacc.c:1646 */ + case 126: +#line 505 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_exit_statement(); } -#line 2364 "pars0grm.cc" /* yacc.c:1646 */ +#line 2337 "pars0grm.cc" /* yacc.c:1646 */ break; - case 129: -#line 514 "pars0grm.y" /* yacc.c:1646 */ + case 127: +#line 509 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_return_statement(); } -#line 2370 "pars0grm.cc" /* yacc.c:1646 */ +#line 2343 "pars0grm.cc" /* yacc.c:1646 */ break; - case 130: -#line 519 "pars0grm.y" /* yacc.c:1646 */ + case 128: +#line 514 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_open_statement( ROW_SEL_OPEN_CURSOR, static_cast((yyvsp[0]))); } -#line 2378 "pars0grm.cc" /* yacc.c:1646 */ +#line 2351 "pars0grm.cc" /* yacc.c:1646 */ break; - case 131: -#line 526 "pars0grm.y" /* yacc.c:1646 */ + case 129: +#line 521 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_open_statement( ROW_SEL_CLOSE_CURSOR, static_cast((yyvsp[0]))); } -#line 2386 "pars0grm.cc" /* yacc.c:1646 */ +#line 2359 "pars0grm.cc" /* yacc.c:1646 */ break; - case 132: -#line 533 "pars0grm.y" /* yacc.c:1646 */ + case 130: +#line 528 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_fetch_statement( static_cast((yyvsp[-2])), static_cast((yyvsp[0])), NULL); } -#line 2394 "pars0grm.cc" /* yacc.c:1646 */ +#line 2367 "pars0grm.cc" /* yacc.c:1646 */ break; - case 133: -#line 537 "pars0grm.y" /* yacc.c:1646 */ + case 131: +#line 532 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_fetch_statement( static_cast((yyvsp[-2])), NULL, static_cast((yyvsp[0]))); } -#line 2403 "pars0grm.cc" /* yacc.c:1646 */ +#line 2376 "pars0grm.cc" /* yacc.c:1646 */ break; - case 134: -#line 545 "pars0grm.y" /* yacc.c:1646 */ + case 132: +#line 540 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_column_def( static_cast((yyvsp[-4])), static_cast((yyvsp[-3])), static_cast((yyvsp[-2])), (yyvsp[-1]), (yyvsp[0])); } -#line 2413 "pars0grm.cc" /* yacc.c:1646 */ +#line 2386 "pars0grm.cc" /* yacc.c:1646 */ break; - case 135: -#line 553 "pars0grm.y" /* yacc.c:1646 */ + case 133: +#line 548 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); } -#line 2419 "pars0grm.cc" /* yacc.c:1646 */ +#line 2392 "pars0grm.cc" /* yacc.c:1646 */ break; - case 136: -#line 555 "pars0grm.y" /* yacc.c:1646 */ + case 134: +#line 550 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); } -#line 2425 "pars0grm.cc" /* yacc.c:1646 */ +#line 2398 "pars0grm.cc" /* yacc.c:1646 */ break; - case 137: -#line 559 "pars0grm.y" /* yacc.c:1646 */ + case 135: +#line 554 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2431 "pars0grm.cc" /* yacc.c:1646 */ +#line 2404 "pars0grm.cc" /* yacc.c:1646 */ break; - case 138: -#line 561 "pars0grm.y" /* yacc.c:1646 */ + case 136: +#line 556 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2437 "pars0grm.cc" /* yacc.c:1646 */ +#line 2410 "pars0grm.cc" /* yacc.c:1646 */ break; - case 139: -#line 565 "pars0grm.y" /* yacc.c:1646 */ + case 137: +#line 560 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2443 "pars0grm.cc" /* yacc.c:1646 */ +#line 2416 "pars0grm.cc" /* yacc.c:1646 */ break; - case 140: -#line 567 "pars0grm.y" /* yacc.c:1646 */ + case 138: +#line 562 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = &pars_int_token; /* pass any non-NULL pointer */ } -#line 2450 "pars0grm.cc" /* yacc.c:1646 */ +#line 2423 "pars0grm.cc" /* yacc.c:1646 */ break; - case 141: -#line 572 "pars0grm.y" /* yacc.c:1646 */ + case 139: +#line 567 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2456 "pars0grm.cc" /* yacc.c:1646 */ +#line 2429 "pars0grm.cc" /* yacc.c:1646 */ break; - case 142: -#line 574 "pars0grm.y" /* yacc.c:1646 */ + case 140: +#line 569 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = &pars_int_token; /* pass any non-NULL pointer */ } -#line 2463 "pars0grm.cc" /* yacc.c:1646 */ +#line 2436 "pars0grm.cc" /* yacc.c:1646 */ break; - case 143: -#line 579 "pars0grm.y" /* yacc.c:1646 */ + case 141: +#line 574 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2469 "pars0grm.cc" /* yacc.c:1646 */ +#line 2442 "pars0grm.cc" /* yacc.c:1646 */ break; - case 144: -#line 580 "pars0grm.y" /* yacc.c:1646 */ + case 142: +#line 575 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = &pars_int_token; /* pass any non-NULL pointer */ } -#line 2476 "pars0grm.cc" /* yacc.c:1646 */ +#line 2449 "pars0grm.cc" /* yacc.c:1646 */ break; - case 145: -#line 585 "pars0grm.y" /* yacc.c:1646 */ + case 143: +#line 580 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2482 "pars0grm.cc" /* yacc.c:1646 */ +#line 2455 "pars0grm.cc" /* yacc.c:1646 */ break; - case 146: -#line 587 "pars0grm.y" /* yacc.c:1646 */ + case 144: +#line 582 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2488 "pars0grm.cc" /* yacc.c:1646 */ +#line 2461 "pars0grm.cc" /* yacc.c:1646 */ break; - case 147: -#line 594 "pars0grm.y" /* yacc.c:1646 */ + case 145: +#line 589 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_create_table( static_cast((yyvsp[-5])), static_cast((yyvsp[-3])), static_cast((yyvsp[-1])), static_cast((yyvsp[0]))); } -#line 2498 "pars0grm.cc" /* yacc.c:1646 */ +#line 2471 "pars0grm.cc" /* yacc.c:1646 */ break; - case 148: -#line 602 "pars0grm.y" /* yacc.c:1646 */ + case 146: +#line 597 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); } -#line 2504 "pars0grm.cc" /* yacc.c:1646 */ +#line 2477 "pars0grm.cc" /* yacc.c:1646 */ break; - case 149: -#line 604 "pars0grm.y" /* yacc.c:1646 */ + case 147: +#line 599 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); } -#line 2510 "pars0grm.cc" /* yacc.c:1646 */ +#line 2483 "pars0grm.cc" /* yacc.c:1646 */ break; - case 150: -#line 608 "pars0grm.y" /* yacc.c:1646 */ + case 148: +#line 603 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2516 "pars0grm.cc" /* yacc.c:1646 */ +#line 2489 "pars0grm.cc" /* yacc.c:1646 */ break; - case 151: -#line 609 "pars0grm.y" /* yacc.c:1646 */ + case 149: +#line 604 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = &pars_unique_token; } -#line 2522 "pars0grm.cc" /* yacc.c:1646 */ +#line 2495 "pars0grm.cc" /* yacc.c:1646 */ break; - case 152: -#line 613 "pars0grm.y" /* yacc.c:1646 */ + case 150: +#line 608 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2528 "pars0grm.cc" /* yacc.c:1646 */ +#line 2501 "pars0grm.cc" /* yacc.c:1646 */ break; - case 153: -#line 614 "pars0grm.y" /* yacc.c:1646 */ + case 151: +#line 609 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = &pars_clustered_token; } -#line 2534 "pars0grm.cc" /* yacc.c:1646 */ +#line 2507 "pars0grm.cc" /* yacc.c:1646 */ break; - case 154: -#line 623 "pars0grm.y" /* yacc.c:1646 */ + case 152: +#line 618 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_create_index( static_cast((yyvsp[-8])), static_cast((yyvsp[-7])), static_cast((yyvsp[-5])), static_cast((yyvsp[-3])), static_cast((yyvsp[-1]))); } -#line 2545 "pars0grm.cc" /* yacc.c:1646 */ +#line 2518 "pars0grm.cc" /* yacc.c:1646 */ break; - case 155: -#line 632 "pars0grm.y" /* yacc.c:1646 */ + case 153: +#line 627 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2551 "pars0grm.cc" /* yacc.c:1646 */ +#line 2524 "pars0grm.cc" /* yacc.c:1646 */ break; - case 156: -#line 633 "pars0grm.y" /* yacc.c:1646 */ + case 154: +#line 628 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2557 "pars0grm.cc" /* yacc.c:1646 */ +#line 2530 "pars0grm.cc" /* yacc.c:1646 */ break; - case 157: -#line 638 "pars0grm.y" /* yacc.c:1646 */ + case 155: +#line 633 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_commit_statement(); } -#line 2563 "pars0grm.cc" /* yacc.c:1646 */ +#line 2536 "pars0grm.cc" /* yacc.c:1646 */ break; - case 158: -#line 643 "pars0grm.y" /* yacc.c:1646 */ + case 156: +#line 638 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_rollback_statement(); } -#line 2569 "pars0grm.cc" /* yacc.c:1646 */ +#line 2542 "pars0grm.cc" /* yacc.c:1646 */ break; - case 159: -#line 647 "pars0grm.y" /* yacc.c:1646 */ - { (yyval) = &pars_int_token; } -#line 2575 "pars0grm.cc" /* yacc.c:1646 */ - break; - - case 160: -#line 648 "pars0grm.y" /* yacc.c:1646 */ + case 157: +#line 642 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = &pars_int_token; } -#line 2581 "pars0grm.cc" /* yacc.c:1646 */ +#line 2548 "pars0grm.cc" /* yacc.c:1646 */ break; - case 161: -#line 649 "pars0grm.y" /* yacc.c:1646 */ + case 158: +#line 643 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = &pars_bigint_token; } -#line 2587 "pars0grm.cc" /* yacc.c:1646 */ +#line 2554 "pars0grm.cc" /* yacc.c:1646 */ break; - case 162: -#line 650 "pars0grm.y" /* yacc.c:1646 */ + case 159: +#line 644 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = &pars_char_token; } -#line 2593 "pars0grm.cc" /* yacc.c:1646 */ +#line 2560 "pars0grm.cc" /* yacc.c:1646 */ break; - case 163: -#line 651 "pars0grm.y" /* yacc.c:1646 */ + case 160: +#line 645 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = &pars_binary_token; } -#line 2599 "pars0grm.cc" /* yacc.c:1646 */ +#line 2566 "pars0grm.cc" /* yacc.c:1646 */ break; - case 164: -#line 652 "pars0grm.y" /* yacc.c:1646 */ + case 161: +#line 646 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = &pars_blob_token; } -#line 2605 "pars0grm.cc" /* yacc.c:1646 */ +#line 2572 "pars0grm.cc" /* yacc.c:1646 */ break; - case 165: -#line 657 "pars0grm.y" /* yacc.c:1646 */ + case 162: +#line 651 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_parameter_declaration( static_cast((yyvsp[-2])), PARS_INPUT, static_cast((yyvsp[0]))); } -#line 2614 "pars0grm.cc" /* yacc.c:1646 */ +#line 2581 "pars0grm.cc" /* yacc.c:1646 */ break; - case 166: -#line 662 "pars0grm.y" /* yacc.c:1646 */ + case 163: +#line 656 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_parameter_declaration( static_cast((yyvsp[-2])), PARS_OUTPUT, static_cast((yyvsp[0]))); } -#line 2623 "pars0grm.cc" /* yacc.c:1646 */ +#line 2590 "pars0grm.cc" /* yacc.c:1646 */ break; - case 167: -#line 669 "pars0grm.y" /* yacc.c:1646 */ + case 164: +#line 663 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2629 "pars0grm.cc" /* yacc.c:1646 */ +#line 2596 "pars0grm.cc" /* yacc.c:1646 */ break; - case 168: -#line 670 "pars0grm.y" /* yacc.c:1646 */ + case 165: +#line 664 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); } -#line 2635 "pars0grm.cc" /* yacc.c:1646 */ +#line 2602 "pars0grm.cc" /* yacc.c:1646 */ break; - case 169: -#line 672 "pars0grm.y" /* yacc.c:1646 */ + case 166: +#line 666 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); } -#line 2641 "pars0grm.cc" /* yacc.c:1646 */ +#line 2608 "pars0grm.cc" /* yacc.c:1646 */ break; - case 170: -#line 677 "pars0grm.y" /* yacc.c:1646 */ + case 167: +#line 671 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_variable_declaration( static_cast((yyvsp[-2])), static_cast((yyvsp[-1]))); } -#line 2649 "pars0grm.cc" /* yacc.c:1646 */ +#line 2616 "pars0grm.cc" /* yacc.c:1646 */ break; - case 174: -#line 691 "pars0grm.y" /* yacc.c:1646 */ + case 171: +#line 685 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_cursor_declaration( static_cast((yyvsp[-3])), static_cast((yyvsp[-1]))); } -#line 2657 "pars0grm.cc" /* yacc.c:1646 */ +#line 2624 "pars0grm.cc" /* yacc.c:1646 */ break; - case 175: -#line 698 "pars0grm.y" /* yacc.c:1646 */ + case 172: +#line 692 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_function_declaration( static_cast((yyvsp[-1]))); } -#line 2664 "pars0grm.cc" /* yacc.c:1646 */ +#line 2631 "pars0grm.cc" /* yacc.c:1646 */ break; - case 181: -#line 720 "pars0grm.y" /* yacc.c:1646 */ + case 178: +#line 714 "pars0grm.y" /* yacc.c:1646 */ { (yyval) = pars_procedure_definition( static_cast((yyvsp[-9])), static_cast((yyvsp[-7])), (yyvsp[-1])); } -#line 2673 "pars0grm.cc" /* yacc.c:1646 */ +#line 2640 "pars0grm.cc" /* yacc.c:1646 */ break; -#line 2677 "pars0grm.cc" /* yacc.c:1646 */ +#line 2644 "pars0grm.cc" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2901,5 +2868,5 @@ yyparse (void) #endif return yyresult; } -#line 726 "pars0grm.y" /* yacc.c:1906 */ +#line 720 "pars0grm.y" /* yacc.c:1906 */ diff --git a/storage/innobase/pars/pars0grm.y b/storage/innobase/pars/pars0grm.y index 5f3cb41310fb1..9b0a6766c3eba 100644 --- a/storage/innobase/pars/pars0grm.y +++ b/storage/innobase/pars/pars0grm.y @@ -48,8 +48,6 @@ yylex(void); %token PARS_INT_LIT %token PARS_FLOAT_LIT %token PARS_STR_LIT -%token PARS_FIXBINARY_LIT -%token PARS_BLOB_LIT %token PARS_NULL_LIT %token PARS_ID_TOKEN %token PARS_AND_TOKEN @@ -64,7 +62,6 @@ yylex(void); %token PARS_BINARY_TOKEN %token PARS_BLOB_TOKEN %token PARS_INT_TOKEN -%token PARS_INTEGER_TOKEN %token PARS_FLOAT_TOKEN %token PARS_CHAR_TOKEN %token PARS_IS_TOKEN @@ -200,8 +197,6 @@ exp: | PARS_INT_LIT { $$ = $1;} | PARS_FLOAT_LIT { $$ = $1;} | PARS_STR_LIT { $$ = $1;} - | PARS_FIXBINARY_LIT { $$ = $1;} - | PARS_BLOB_LIT { $$ = $1;} | PARS_NULL_LIT { $$ = $1;} | PARS_SQL_TOKEN { $$ = $1;} | exp '+' exp { $$ = pars_op('+', $1, $3); } @@ -645,7 +640,6 @@ rollback_statement: type_name: PARS_INT_TOKEN { $$ = &pars_int_token; } - | PARS_INTEGER_TOKEN { $$ = &pars_int_token; } | PARS_BIGINT_TOKEN { $$ = &pars_bigint_token; } | PARS_CHAR_TOKEN { $$ = &pars_char_token; } | PARS_BINARY_TOKEN { $$ = &pars_binary_token; } diff --git a/storage/innobase/pars/pars0sym.cc b/storage/innobase/pars/pars0sym.cc index ed49500dd94a4..8249af53b391b 100644 --- a/storage/innobase/pars/pars0sym.cc +++ b/storage/innobase/pars/pars0sym.cc @@ -223,25 +223,15 @@ sym_tab_add_bound_lit( switch (blit->type) { case DATA_FIXBINARY: + case DATA_CHAR: + ut_ad(blit->length > 0); len = blit->length; - *lit_type = PARS_FIXBINARY_LIT; - break; - + /* fall through */ case DATA_BLOB: - *lit_type = PARS_BLOB_LIT; - break; - case DATA_VARCHAR: *lit_type = PARS_STR_LIT; break; - case DATA_CHAR: - ut_a(blit->length > 0); - - len = blit->length; - *lit_type = PARS_STR_LIT; - break; - case DATA_INT: ut_a(blit->length > 0); ut_a(blit->length <= 8); diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index cc6117250959d..6d974e7accbb2 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -1871,17 +1871,17 @@ rec_print_old( n = rec_get_n_fields_old(rec); - fprintf(file, "PHYSICAL RECORD: n_fields %lu;" - " %u-byte offsets; info bits %lu\n", - (ulong) n, + fprintf(file, "PHYSICAL RECORD: n_fields " ULINTPF ";" + " %u-byte offsets; info bits " ULINTPF "\n", + n, rec_get_1byte_offs_flag(rec) ? 1 : 2, - (ulong) rec_get_info_bits(rec, FALSE)); + rec_get_info_bits(rec, FALSE)); for (i = 0; i < n; i++) { data = rec_get_nth_field_old(rec, i, &len); - fprintf(file, " %lu:", (ulong) i); + fprintf(file, " " ULINTPF ":", i); if (len != UNIV_SQL_NULL) { if (len <= 30) { @@ -1890,8 +1890,8 @@ rec_print_old( } else { ut_print_buf(file, data, 30); - fprintf(file, " (total %lu bytes)", - (ulong) len); + fprintf(file, " (total " ULINTPF " bytes)", + len); } } else { fprintf(file, " SQL NULL, size " ULINTPF " ", @@ -1924,7 +1924,7 @@ rec_print_comp( data = rec_get_nth_field(rec, offsets, i, &len); - fprintf(file, " %lu:", (ulong) i); + fprintf(file, " " ULINTPF ":", i); if (len != UNIV_SQL_NULL) { if (len <= 30) { @@ -1932,16 +1932,17 @@ rec_print_comp( ut_print_buf(file, data, len); } else if (rec_offs_nth_extern(offsets, i)) { ut_print_buf(file, data, 30); - fprintf(file, " (total %lu bytes, external)", - (ulong) len); + fprintf(file, + " (total " ULINTPF " bytes, external)", + len); ut_print_buf(file, data + len - BTR_EXTERN_FIELD_REF_SIZE, BTR_EXTERN_FIELD_REF_SIZE); } else { ut_print_buf(file, data, 30); - fprintf(file, " (total %lu bytes)", - (ulong) len); + fprintf(file, " (total " ULINTPF " bytes)", + len); } } else { fputs(" SQL NULL", file); @@ -2007,7 +2008,7 @@ rec_print_mbr_old( } } } else { - fprintf(file, " SQL NULL, size %lu ", + fprintf(file, " SQL NULL, size " ULINTPF " ", rec_get_nth_field_size(rec, i)); } @@ -2123,10 +2124,10 @@ rec_print_new( return; } - fprintf(file, "PHYSICAL RECORD: n_fields %lu;" - " compact format; info bits %lu\n", - (ulong) rec_offs_n_fields(offsets), - (ulong) rec_get_info_bits(rec, TRUE)); + fprintf(file, "PHYSICAL RECORD: n_fields " ULINTPF ";" + " compact format; info bits " ULINTPF "\n", + rec_offs_n_fields(offsets), + rec_get_info_bits(rec, TRUE)); rec_print_comp(file, rec, offsets); rec_validate(rec, offsets); @@ -2342,9 +2343,10 @@ wsrep_rec_get_foreign_key( data = rec_get_nth_field(rec, offsets, i, &len); if (key_len + ((len != UNIV_SQL_NULL) ? len + 1 : 1) > *buf_len) { - fprintf (stderr, - "WSREP: FK key len exceeded %lu %lu %lu\n", - key_len, len, *buf_len); + fprintf(stderr, + "WSREP: FK key len exceeded " + ULINTPF " " ULINTPF " " ULINTPF "\n", + key_len, len, *buf_len); goto err_out; } diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index 19e1ba926d044..2adf32b79d988 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2016, MariaDB Corporation. +Copyright (c) 2015, 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 @@ -946,7 +946,7 @@ fts_parallel_tokenization( goto exit; } else if (retried > 10000) { ut_ad(!doc_item); - /* retied too many times and cannot get new record */ + /* retried too many times and cannot get new record */ ib::error() << "FTS parallel sort processed " << num_doc_processed << " records, the sort queue has " @@ -1480,10 +1480,9 @@ row_fts_build_sel_tree_level( int child_left; int child_right; ulint i; - ulint num_item; + ulint num_item = ulint(1) << level; - start = static_cast((1 << level) - 1); - num_item = static_cast(1 << level); + start = num_item - 1; for (i = 0; i < num_item; i++) { child_left = sel_tree[(start + i) * 2 + 1]; @@ -1552,7 +1551,7 @@ row_fts_build_sel_tree( treelevel++; } - start = (1 << treelevel) - 1; + start = (ulint(1) << treelevel) - 1; for (i = 0; i < (int) fts_sort_pll_degree; i++) { sel_tree[i + start] = i; @@ -1673,7 +1672,7 @@ row_fts_merge_insert( } if (fts_enable_diag_print) { - ib::info() << "InnoDB_FTS: to inserted " << count_diag + ib::info() << "InnoDB_FTS: to insert " << count_diag << " records"; } diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index b70a1952f970e..01a55d0dc6142 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -468,16 +468,6 @@ class AbstractCallback : public PageCallback { return(DB_SUCCESS); } - /** - @return true if it is a root page */ - bool is_root_page(const page_t* page) const UNIV_NOTHROW - { - ut_ad(fil_page_index_page_check(page)); - - return(mach_read_from_4(page + FIL_PAGE_NEXT) == FIL_NULL - && mach_read_from_4(page + FIL_PAGE_PREV) == FIL_NULL); - } - /** Check if the page is marked as free in the extent descriptor. @param page_no page number to check in the extent descriptor. @return true if the page is marked as free */ @@ -669,7 +659,7 @@ FetchIndexRootPages::operator() ( err = set_current_xdes(block->page.id.page_no(), page); } else if (fil_page_index_page_check(page) && !is_free(block->page.id.page_no()) - && is_root_page(page)) { + && page_is_root(page)) { index_id_t id = btr_page_get_index_id(page); @@ -1088,10 +1078,9 @@ row_import::match_index_columns( ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, - "Index field count %lu doesn't match" - " tablespace metadata file value %lu", - (ulong) index->n_fields, - (ulong) cfg_index->m_n_fields); + "Index field count %u doesn't match" + " tablespace metadata file value " ULINTPF, + index->n_fields, cfg_index->m_n_fields); return(DB_ERROR); } @@ -1108,8 +1097,8 @@ row_import::match_index_columns( ER_TABLE_SCHEMA_MISMATCH, "Index field name %s doesn't match" " tablespace metadata field name %s" - " for field position %lu", - field->name(), cfg_field->name(), (ulong) i); + " for field position " ULINTPF, + field->name(), cfg_field->name(), i); err = DB_ERROR; } @@ -1117,12 +1106,10 @@ row_import::match_index_columns( if (cfg_field->prefix_len != field->prefix_len) { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, - "Index %s field %s prefix len %lu" - " doesn't match metadata file value" - " %lu", + "Index %s field %s prefix len %u" + " doesn't match metadata file value %u", index->name(), field->name(), - (ulong) field->prefix_len, - (ulong) cfg_field->prefix_len); + field->prefix_len, cfg_field->prefix_len); err = DB_ERROR; } @@ -1130,12 +1117,11 @@ row_import::match_index_columns( if (cfg_field->fixed_len != field->fixed_len) { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, - "Index %s field %s fixed len %lu" - " doesn't match metadata file value" - " %lu", + "Index %s field %s fixed len %u" + " doesn't match metadata file value %u", index->name(), field->name(), - (ulong) field->fixed_len, - (ulong) cfg_field->fixed_len); + field->fixed_len, + cfg_field->fixed_len); err = DB_ERROR; } @@ -1176,12 +1162,11 @@ row_import::match_table_columns( } else if (cfg_col_index != col->ind) { ib_errf(thd, IB_LOG_LEVEL_ERROR, - ER_TABLE_SCHEMA_MISMATCH, - "Column %s ordinal value mismatch, it's at" - " %lu in the table and %lu in the tablespace" - " meta-data file", - col_name, - (ulong) col->ind, (ulong) cfg_col_index); + ER_TABLE_SCHEMA_MISMATCH, + "Column %s ordinal value mismatch, it's at %u" + " in the table and " ULINTPF + " in the tablespace meta-data file", + col_name, col->ind, cfg_col_index); err = DB_ERROR; } else { @@ -1263,19 +1248,19 @@ row_import::match_schema( { /* Do some simple checks. */ - if (m_flags != m_table->flags) { + if ((m_table->flags ^ m_flags) & ~DICT_TF_MASK_DATA_DIR) { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, - "Table flags don't match, server table has 0x%lx" - " and the meta-data file has 0x%lx", - (ulong) m_table->n_cols, (ulong) m_flags); + "Table flags don't match, server table has 0x%x" + " and the meta-data file has 0x" ULINTPFx, + m_table->flags, m_flags); return(DB_ERROR); } else if (m_table->n_cols != m_n_cols) { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, - "Number of columns don't match, table has %lu" - " columns but the tablespace meta-data file has" - " %lu columns", - (ulong) m_table->n_cols, (ulong) m_n_cols); + "Number of columns don't match, table has %u" + " columns but the tablespace meta-data file has " + ULINTPF " columns", + m_table->n_cols, m_n_cols); return(DB_ERROR); } else if (UT_LIST_GET_LEN(m_table->indexes) != m_n_indexes) { @@ -1285,11 +1270,10 @@ row_import::match_schema( table matching the IMPORT definition. */ ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, - "Number of indexes don't match, table has %lu" - " indexes but the tablespace meta-data file has" - " %lu indexes", - (ulong) UT_LIST_GET_LEN(m_table->indexes), - (ulong) m_n_indexes); + "Number of indexes don't match, table has " ULINTPF + " indexes but the tablespace meta-data file has " + ULINTPF " indexes", + UT_LIST_GET_LEN(m_table->indexes), m_n_indexes); return(DB_ERROR); } @@ -1590,9 +1574,10 @@ PageConverter::adjust_cluster_index_blob_column( ib_errf(m_trx->mysql_thd, IB_LOG_LEVEL_ERROR, ER_INNODB_INDEX_CORRUPT, - "Externally stored column(%lu) has a reference" - " length of %lu in the cluster index %s", - (ulong) i, (ulong) len, m_cluster_index->name()); + "Externally stored column(" ULINTPF + ") has a reference length of " ULINTPF + " in the cluster index %s", + i, len, m_cluster_index->name()); return(DB_CORRUPTION); } @@ -1831,12 +1816,28 @@ PageConverter::update_index_page( btr_page_set_index_id( page, m_page_zip_ptr, m_index->m_srv_index->id, 0); - page_set_max_trx_id(block, m_page_zip_ptr, m_trx->id, 0); + if (dict_index_is_clust(m_index->m_srv_index)) { + if (page_is_root(page)) { + /* Preserve the PAGE_ROOT_AUTO_INC. */ + } else { + /* Clear PAGE_MAX_TRX_ID so that it can be + used for other purposes in the future. IMPORT + in MySQL 5.6, 5.7 and MariaDB 10.0 and 10.1 + would set the field to the transaction ID even + on clustered index pages. */ + page_set_max_trx_id(block, m_page_zip_ptr, 0, NULL); + } + } else { + /* Set PAGE_MAX_TRX_ID on secondary index leaf pages, + and clear it on non-leaf pages. */ + page_set_max_trx_id(block, m_page_zip_ptr, + page_is_leaf(page) ? m_trx->id : 0, NULL); + } - if (page_is_empty(block->frame)) { + if (page_is_empty(page)) { /* Only a root page can be empty. */ - if (!is_root_page(block->frame)) { + if (!page_is_root(page)) { // TODO: We should relax this and skip secondary // indexes. Mark them as corrupt because they can // always be rebuilt. @@ -2259,11 +2260,10 @@ row_import_adjust_root_pages_of_secondary_indexes( ib_errf(trx->mysql_thd, IB_LOG_LEVEL_WARN, ER_INNODB_INDEX_CORRUPT, - "Index %s contains %lu entries," - " should be %lu, you should recreate" - " this index.", index->name(), - (ulong) purge.get_n_rows(), - (ulong) n_rows_in_table); + "Index '%s' contains " ULINTPF " entries, " + "should be " ULINTPF ", you should recreate " + "this index.", index->name(), + purge.get_n_rows(), n_rows_in_table); index->type |= DICT_CORRUPT; @@ -2564,10 +2564,10 @@ row_import_read_index_data( char msg[BUFSIZ]; ut_snprintf(msg, sizeof(msg), - "while reading index meta-data, expected" - " to read %lu bytes but read only %lu" - " bytes", - (ulong) sizeof(row), (ulong) n_bytes); + "while reading index meta-data, expected " + "to read " ULINTPF + " bytes but read only " ULINTPF " bytes", + sizeof(row), n_bytes); ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, @@ -2619,8 +2619,8 @@ row_import_read_index_data( if (len > OS_FILE_MAX_PATH) { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_INNODB_INDEX_CORRUPT, - "Index name length (%lu) is too long," - " the meta-data is corrupt", len); + "Index name length (" ULINTPF ") is too long, " + "the meta-data is corrupt", len); return(DB_CORRUPTION); } @@ -2702,8 +2702,8 @@ row_import_read_indexes( } else if (cfg->m_n_indexes > 1024) { // FIXME: What is the upper limit? */ ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - "Number of indexes in meta-data file is too high: %lu", - (ulong) cfg->m_n_indexes); + "Number of indexes in meta-data file is too high: " + ULINTPF, cfg->m_n_indexes); cfg->m_n_indexes = 0; return(DB_CORRUPTION); @@ -2807,8 +2807,8 @@ row_import_read_columns( if (len == 0 || len > 128) { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - "Column name length %lu, is invalid", - (ulong) len); + "Column name length " ULINTPF ", is invalid", + len); return(DB_CORRUPTION); } @@ -3058,8 +3058,8 @@ row_import_read_meta_data( return(row_import_read_v1(file, thd, &cfg)); default: ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - "Unsupported meta-data version number (%lu)," - " file ignored", (ulong) cfg.m_version); + "Unsupported meta-data version number (" ULINTPF "), " + "file ignored", cfg.m_version); } return(DB_ERROR); diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 03d7ac628a781..7d8c1a683e25a 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -1440,7 +1440,7 @@ row_insert_for_mysql( return(DB_TABLESPACE_NOT_FOUND); } else if (prebuilt->table->is_encrypted) { ib_push_warning(trx, DB_DECRYPTION_FAILED, - "Table %s in tablespace %lu encrypted." + "Table %s in tablespace " ULINTPF " encrypted." "However key management plugin or used key_id is not found or" " used encryption algorithm or method does not match.", prebuilt->table->name, prebuilt->table->space); @@ -1866,7 +1866,7 @@ row_update_for_mysql_using_upd_graph( DBUG_RETURN(DB_ERROR); } else if (prebuilt->table->is_encrypted) { ib_push_warning(trx, DB_DECRYPTION_FAILED, - "Table %s in tablespace %lu encrypted." + "Table %s in tablespace " ULINTPF " encrypted." "However key management plugin or used key_id is not found or" " used encryption algorithm or method does not match.", prebuilt->table->name, prebuilt->table->space); diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index 5a3e1a2c93062..f6c388f2dcfb8 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -2,7 +2,7 @@ Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2016, MariaDB Corporation +Copyright (c) 2013, 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 @@ -739,11 +739,11 @@ static monitor_info_t innodb_counter_info[] = MONITOR_DEFAULT_START, MONITOR_OVLD_OS_FSYNC}, {"os_pending_reads", "os", "Number of reads pending", - MONITOR_NONE, + MONITOR_DEFAULT_ON, MONITOR_DEFAULT_START, MONITOR_OS_PENDING_READS}, {"os_pending_writes", "os", "Number of writes pending", - MONITOR_NONE, + MONITOR_DEFAULT_ON, MONITOR_DEFAULT_START, MONITOR_OS_PENDING_WRITES}, {"os_log_bytes_written", "os", diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 26194914fb161..95f17fa68d0fe 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -701,13 +701,12 @@ srv_print_master_thread_info( /*=========================*/ FILE *file) /* in: output stream */ { - fprintf(file, "srv_master_thread loops: %lu srv_active," - " %lu srv_shutdown, %lu srv_idle\n", + fprintf(file, "srv_master_thread loops: " ULINTPF " srv_active, " + ULINTPF " srv_shutdown, " ULINTPF " srv_idle\n" + "srv_master_thread log flush and writes: " ULINTPF "\n", srv_main_active_loops, srv_main_shutdown_loops, - srv_main_idle_loops); - fprintf(file, - "srv_master_thread log flush and writes: " ULINTPF "\n", + srv_main_idle_loops, srv_log_writes_and_flush); } @@ -1376,13 +1375,13 @@ srv_printf_innodb_monitor( srv_conc_get_waiting_threads()); /* This is a dirty read, without holding trx_sys->mutex. */ - fprintf(file, "%lu read views open inside InnoDB\n", + fprintf(file, ULINTPF " read views open inside InnoDB\n", trx_sys->mvcc->size()); n_reserved = fil_space_get_n_reserved_extents(0); if (n_reserved > 0) { fprintf(file, - "%lu tablespace extents now reserved for" + ULINTPF " tablespace extents now reserved for" " B-tree split operations\n", n_reserved); } @@ -1474,10 +1473,10 @@ srv_export_innodb_status(void) mutex_enter(&srv_innodb_monitor_mutex); export_vars.innodb_data_pending_reads = - os_n_pending_reads; + ulint(MONITOR_VALUE(MONITOR_OS_PENDING_READS)); export_vars.innodb_data_pending_writes = - os_n_pending_writes; + ulint(MONITOR_VALUE(MONITOR_OS_PENDING_READS)); export_vars.innodb_data_pending_fsyncs = fil_n_pending_log_flushes @@ -1940,8 +1939,8 @@ DECLARE_THREAD(srv_error_monitor_thread)(void*) "WSREP: avoiding InnoDB self crash due to long " "semaphore wait of > %lu seconds\n" "Server is processing SST donor operation, " - "fatal_cnt now: %lu", - (ulong) srv_fatal_semaphore_wait_threshold, fatal_cnt); + "fatal_cnt now: " ULINTPF, + srv_fatal_semaphore_wait_threshold, fatal_cnt); } #endif /* WITH_WSREP */ if (fatal_cnt > 10) { diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index bcb52fc5bfb57..9e89dfda83335 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -743,7 +743,7 @@ srv_check_undo_redo_logs_exists() ut_snprintf( name, sizeof(name), - "%s%cundo%03lu", + "%s%cundo%03zu", srv_undo_dir, OS_PATH_SEPARATOR, i); @@ -836,7 +836,7 @@ srv_undo_tablespaces_init(bool create_new_db) ut_snprintf( name, sizeof(name), - "%s%cundo%03lu", + "%s%cundo%03zu", srv_undo_dir, OS_PATH_SEPARATOR, i + 1); /* Undo space ids start from 1. */ @@ -872,7 +872,7 @@ srv_undo_tablespaces_init(bool create_new_db) char name[OS_FILE_MAX_PATH]; ut_snprintf(name, sizeof(name), - "%s%cundo%03lu", + "%s%cundo%03zu", srv_undo_dir, OS_PATH_SEPARATOR, undo_tablespace_ids[i]); @@ -913,7 +913,7 @@ srv_undo_tablespaces_init(bool create_new_db) ut_snprintf( name, sizeof(name), - "%s%cundo%03lu", + "%s%cundo%03zu", srv_undo_dir, OS_PATH_SEPARATOR, undo_tablespace_ids[i]); @@ -949,7 +949,7 @@ srv_undo_tablespaces_init(bool create_new_db) ut_snprintf( name, sizeof(name), - "%s%cundo%03lu", srv_undo_dir, OS_PATH_SEPARATOR, i); + "%s%cundo%03zu", srv_undo_dir, OS_PATH_SEPARATOR, i); /* Undo space ids start from 1. */ err = srv_undo_tablespace_open(name, i); @@ -2756,9 +2756,9 @@ innodb_shutdown() logs_empty_and_mark_files_at_shutdown(); - if (srv_conc_get_active_threads() != 0) { + if (ulint n_threads = srv_conc_get_active_threads()) { ib::warn() << "Query counter shows " - << srv_conc_get_active_threads() << " queries still" + << n_threads << " queries still" " inside InnoDB at shutdown"; } diff --git a/storage/innobase/sync/sync0arr.cc b/storage/innobase/sync/sync0arr.cc index 49a8d6db35a03..956511a7f59c1 100644 --- a/storage/innobase/sync/sync0arr.cc +++ b/storage/innobase/sync/sync0arr.cc @@ -587,12 +587,13 @@ sync_array_cell_print( } fprintf(file, - "number of readers %lu, waiters flag %lu," - " lock_word: %lx\n" + "number of readers " ULINTPF + ", waiters flag %u, " + "lock_word: " ULINTPFx "\n" "Last time read locked in file %s line %u\n" "Last time write locked in file %s line %u\n", - (ulint) rw_lock_get_reader_count(rwlock), - (ulint) rwlock->waiters, + rw_lock_get_reader_count(rwlock), + rwlock->waiters, rwlock->lock_word, innobase_basename(rwlock->last_s_file_name), rwlock->last_s_line, @@ -1093,9 +1094,10 @@ sync_array_print_long_waits( now the values of pending calls of these. */ fprintf(stderr, - "InnoDB: Pending preads %lu, pwrites %lu\n", - (ulong) os_n_pending_reads, - (ulong) os_n_pending_writes); + "InnoDB: Pending reads " UINT64PF + ", writes " UINT64PF "\n", + MONITOR_VALUE(MONITOR_OS_PENDING_READS), + MONITOR_VALUE(MONITOR_OS_PENDING_WRITES)); srv_print_innodb_monitor = TRUE; diff --git a/storage/innobase/trx/trx0i_s.cc b/storage/innobase/trx/trx0i_s.cc index 9c5ae4d02dafa..fcc50b8c76d0c 100644 --- a/storage/innobase/trx/trx0i_s.cc +++ b/storage/innobase/trx/trx0i_s.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2007, 2015, 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 @@ -1612,7 +1613,8 @@ trx_i_s_create_lock_id( if (row->lock_space != ULINT_UNDEFINED) { /* record lock */ res_len = ut_snprintf(lock_id, lock_id_size, - TRX_ID_FMT ":%lu:%lu:%lu", + TRX_ID_FMT + ":" ULINTPF ":" ULINTPF ":" ULINTPF, row->lock_trx_id, row->lock_space, row->lock_page, row->lock_rec); } else { diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 24983dcc2a3bc..19d4a228eda3a 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -258,8 +258,8 @@ trx_sys_print_mysql_binlog_offset(void) + TRX_SYS_MYSQL_LOG_OFFSET_LOW); fprintf(stderr, - "InnoDB: Last MySQL binlog file position %lu %lu," - " file name %s\n", + "InnoDB: Last MySQL binlog file position " ULINTPF " " ULINTPF + ", file name %s\n", trx_sys_mysql_bin_log_pos_high, trx_sys_mysql_bin_log_pos_low, sys_header + TRX_SYS_MYSQL_LOG_INFO + TRX_SYS_MYSQL_LOG_NAME); diff --git a/storage/innobase/ut/ut0ut.cc b/storage/innobase/ut/ut0ut.cc index c352323eca90a..2cae865cff224 100644 --- a/storage/innobase/ut/ut0ut.cc +++ b/storage/innobase/ut/ut0ut.cc @@ -1,6 +1,7 @@ /***************************************************************************** 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 @@ -214,14 +215,14 @@ ut_print_timestamp( GetLocalTime(&cal_tm); - fprintf(file, "%d-%02d-%02d %02d:%02d:%02d %#llx", + fprintf(file, "%d-%02d-%02d %02d:%02d:%02d %#zx", (int) cal_tm.wYear, (int) cal_tm.wMonth, (int) cal_tm.wDay, (int) cal_tm.wHour, (int) cal_tm.wMinute, (int) cal_tm.wSecond, - static_cast(thread_id)); + thread_id); #else struct tm* cal_tm_ptr; time_t tm; @@ -230,7 +231,7 @@ ut_print_timestamp( time(&tm); localtime_r(&tm, &cal_tm); cal_tm_ptr = &cal_tm; - fprintf(file, "%d-%02d-%02d %02d:%02d:%02d %#lx", + fprintf(file, "%d-%02d-%02d %02d:%02d:%02d %#zx", cal_tm_ptr->tm_year + 1900, cal_tm_ptr->tm_mon + 1, cal_tm_ptr->tm_mday, @@ -323,7 +324,7 @@ ut_print_buf( fprintf(file, " len " ULINTPF "; hex ", len); for (data = (const byte*) buf, i = 0; i < len; i++) { - fprintf(file, "%02lx", static_cast(*data++)); + fprintf(file, "%02x", *data++); } fputs("; asc ", file);