lists.mariadb.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

commits

Thread Start a new thread
Threads by month
  • ----- 2025 -----
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
commits@lists.mariadb.org

  • 14605 discussions
[Commits] 206aba5: MyRocks: post-merge fixes part #8: make rocksdb.validate_datadic test pass
by psergey@askmonty.org 30 Aug '18

30 Aug '18
revision-id: 206aba59109e899279bd5795769be5d7d47d7708 parent(s): d4f3c5c42ff9b622bf758a298eb9f07a635bccc8 committer: Sergei Petrunia branch nick: 10.2-mariarocks-merge timestamp: 2018-08-30 21:30:40 +0300 message: MyRocks: post-merge fixes part #8: make rocksdb.validate_datadic test pass --- storage/rocksdb/mysql-test/rocksdb/r/validate_datadic.result | 5 +++-- storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/storage/rocksdb/mysql-test/rocksdb/r/validate_datadic.result b/storage/rocksdb/mysql-test/rocksdb/r/validate_datadic.result index b5ab85d..5d9a634 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/validate_datadic.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/validate_datadic.result @@ -2,7 +2,8 @@ call mtr.add_suppression('RocksDB: Schema mismatch'); CREATE TABLE t1 (pk int primary key) ENGINE=ROCKSDB; CREATE TABLE t2 (pk int primary key) ENGINE=ROCKSDB PARTITION BY KEY(pk) PARTITIONS 4; "Expect errors that we are missing two .frm files" -FOUND 2 /Schema mismatch/ in mysqld.1.err +FOUND 1 /RocksDB: Schema mismatch - Table test.t1 is registered in RocksDB but does not have a .frm file/ in validate_datadic.err +FOUND 1 /RocksDB: Schema mismatch - Table test.t2 is registered in RocksDB but does not have a .frm file/ in validate_datadic.err "Expect an error that we have an extra .frm file" -FOUND 3 /Schema mismatch/ in mysqld.1.err +FOUND 1 /Schema mismatch - A .frm file exists for table test.t1_dummy, but that table is not registered in RocksDB/ in validate_datadic.err DROP TABLE t1, t2; diff --git a/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test b/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test index 9f1e28d..ec48dc0 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test @@ -57,8 +57,13 @@ shutdown_server 10; # We should now have an error message --echo "Expect errors that we are missing two .frm files" ---let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err ---let SEARCH_PATTERN=Schema mismatch +#--let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err +#--let SEARCH_PATTERN=Schema mismatch +#--source include/search_pattern_in_file.inc +#--let SEARCH_PATTERN=RocksDB: Schema mismatch - Table test.t2 is registered in RocksDB but does not have a .frm file +#--source include/search_pattern_in_file.inc +--let SEARCH_FILE=$LOG +--let SEARCH_PATTERN=RocksDB: Schema mismatch - Table test.t1 is registered in RocksDB but does not have a .frm file --source include/search_pattern_in_file.inc --let SEARCH_PATTERN=RocksDB: Schema mismatch - Table test.t2 is registered in RocksDB but does not have a .frm file --source include/search_pattern_in_file.inc
1 0
0 0
[Commits] d8b8079: EV-16992 Assertion `table_ref->table || table_ref->view' failed in
by IgorBabaev 30 Aug '18

30 Aug '18
revision-id: d8b8079e421a7d19d3e0c2c4e4adf526853896cb (mariadb-10.3.7-156-gd8b8079) parent(s): 7aa80ba66b042bbcd6f2576522bb87a1fc83a281 author: Igor Babaev committer: Igor Babaev timestamp: 2018-08-30 11:30:28 -0700 message: EV-16992 Assertion `table_ref->table || table_ref->view' failed in Field_iterator_table_ref::set_field_iterator Several functions that processed different prepare statements missed the DT_INIT flag in last parameter of the open_normal_and_derived_tables() calls. It made context analysis of derived tables dependent on the order in which the derived tables were processed by mysql_handle_derived(). This order was induced by the order of SELECTs in all_select_list. In 10.4 the order of SELECTs in all_select_list became different and lack of the DT_INIT flags in some open_normal_and_derived_tables() call became critical as some derived tables were not identified as such. --- mysql-test/main/ps.result | 43 +++++++++++++++++++++++++++++++++++++++++++ mysql-test/main/ps.test | 46 ++++++++++++++++++++++++++++++++++++++++++++++ sql/sql_prepare.cc | 13 +++++++------ 3 files changed, 96 insertions(+), 6 deletions(-) diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result index 682c3e3..34a9600 100644 --- a/mysql-test/main/ps.result +++ b/mysql-test/main/ps.result @@ -5321,5 +5321,48 @@ DROP PROCEDURE p2; DROP PROCEDURE p1; DROP ROLE testrole; # +# MDEV-16992: prepare of CREATE TABLE, CREATE VIEW, DO, SET, CALL +# statements with CTE containing materialized derived +# (the bug is reproducible on 10.4) +# +prepare stmt from +"CREATE TABLE t1 AS + WITH cte(a) AS (SELECT * FROM (SELECT 1) AS t) SELECT * FROM cte;"; +execute stmt; +select * from t1; +a +1 +prepare stmt from +"CREATE VIEW v1 AS + WITH cte(a) AS (SELECT * FROM (SELECT 1) AS t) SELECT * FROM cte;"; +execute stmt; +select * from v1; +a +1 +prepare stmt from +"DO (SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS tt);"; +execute stmt; +prepare stmt from +"SET @a = (SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS t);"; +execute stmt; +create procedure p (i int) insert into t1 values(i); +prepare stmt from +"CALL p + ((SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS tt));"; +execute stmt; +select * from t1; +a +1 +1 +drop procedure p; +drop view v1; +drop table t1; +# # End of 10.2 tests # diff --git a/mysql-test/main/ps.test b/mysql-test/main/ps.test index 79c08d6..2b8a050 100644 --- a/mysql-test/main/ps.test +++ b/mysql-test/main/ps.test @@ -4785,5 +4785,51 @@ DROP PROCEDURE p1; DROP ROLE testrole; --echo # +--echo # MDEV-16992: prepare of CREATE TABLE, CREATE VIEW, DO, SET, CALL +--echo # statements with CTE containing materialized derived +--echo # (the bug is reproducible on 10.4) +--echo # + +--enable_result_log + +prepare stmt from +"CREATE TABLE t1 AS + WITH cte(a) AS (SELECT * FROM (SELECT 1) AS t) SELECT * FROM cte;"; +execute stmt; +select * from t1; + +prepare stmt from +"CREATE VIEW v1 AS + WITH cte(a) AS (SELECT * FROM (SELECT 1) AS t) SELECT * FROM cte;"; +execute stmt; +select * from v1; + +prepare stmt from +"DO (SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS tt);"; +execute stmt; + +prepare stmt from +"SET @a = (SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS t);"; +execute stmt; + +create procedure p (i int) insert into t1 values(i); + +prepare stmt from +"CALL p + ((SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS tt));"; +execute stmt; +select * from t1; + +drop procedure p; +drop view v1; +drop table t1; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index fd526f9..2ffecba 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1582,7 +1582,7 @@ static bool mysql_test_do_fields(Prepared_statement *stmt, DBUG_RETURN(TRUE); if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE | DT_CREATE)) + DT_INIT | DT_PREPARE | DT_CREATE)) DBUG_RETURN(TRUE); DBUG_RETURN(setup_fields(thd, Ref_ptr_array(), *values, COLUMNS_READ, 0, NULL, 0)); @@ -1614,7 +1614,7 @@ static bool mysql_test_set_fields(Prepared_statement *stmt, if ((tables && check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE)) || open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE | DT_CREATE)) + DT_INIT | DT_PREPARE | DT_CREATE)) goto error; while ((var= it++)) @@ -1651,7 +1651,8 @@ static bool mysql_test_call_fields(Prepared_statement *stmt, if ((tables && check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE)) || - open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, DT_PREPARE)) + open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, + DT_INIT | DT_PREPARE)) goto err; while ((item= it++)) @@ -1777,7 +1778,7 @@ static bool mysql_test_create_table(Prepared_statement *stmt) if (open_normal_and_derived_tables(stmt->thd, lex->query_tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE | DT_CREATE)) + DT_INIT | DT_PREPARE | DT_CREATE)) DBUG_RETURN(TRUE); select_lex->context.resolve_in_select_list= TRUE; @@ -1798,7 +1799,7 @@ static bool mysql_test_create_table(Prepared_statement *stmt) */ if (open_normal_and_derived_tables(stmt->thd, lex->query_tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE)) + DT_INIT | DT_PREPARE)) DBUG_RETURN(TRUE); } @@ -2025,7 +2026,7 @@ static bool mysql_test_create_view(Prepared_statement *stmt) lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VIEW; if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE)) + DT_INIT | DT_PREPARE)) goto err; res= select_like_stmt_test(stmt, 0, 0);
1 0
0 0
[Commits] 42afeef: EV-16992 Assertion `table_ref->table || table_ref->view' failed in
by IgorBabaev 30 Aug '18

30 Aug '18
revision-id: 42afeef78eb5ae602c0892caac40300ea96ffd81 (mariadb-10.3.7-156-g42afeef) parent(s): 7aa80ba66b042bbcd6f2576522bb87a1fc83a281 author: Igor Babaev committer: Igor Babaev timestamp: 2018-08-30 11:23:08 -0700 message: EV-16992 Assertion `table_ref->table || table_ref->view' failed in Field_iterator_table_ref::set_field_iterator Several functions that processed different prepare statements missed the DT_INIT flag in last parameter of the open_normal_and_derived_tables() calls. It made context analysis of derived tables dependent on the order in which the derived tables were processed by mysql_handle_derived(). This order was induced by the order of SELECTs in all_select_list. In 10.4 the order of SELECTs in all_select_list became different and lack of the DT_INIT flags in some open_normal_and_derived_tables() call became critical as some derived tables were not identified as such. --- sql/sql_prepare.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index fd526f9..2ffecba 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1582,7 +1582,7 @@ static bool mysql_test_do_fields(Prepared_statement *stmt, DBUG_RETURN(TRUE); if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE | DT_CREATE)) + DT_INIT | DT_PREPARE | DT_CREATE)) DBUG_RETURN(TRUE); DBUG_RETURN(setup_fields(thd, Ref_ptr_array(), *values, COLUMNS_READ, 0, NULL, 0)); @@ -1614,7 +1614,7 @@ static bool mysql_test_set_fields(Prepared_statement *stmt, if ((tables && check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE)) || open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE | DT_CREATE)) + DT_INIT | DT_PREPARE | DT_CREATE)) goto error; while ((var= it++)) @@ -1651,7 +1651,8 @@ static bool mysql_test_call_fields(Prepared_statement *stmt, if ((tables && check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE)) || - open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, DT_PREPARE)) + open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, + DT_INIT | DT_PREPARE)) goto err; while ((item= it++)) @@ -1777,7 +1778,7 @@ static bool mysql_test_create_table(Prepared_statement *stmt) if (open_normal_and_derived_tables(stmt->thd, lex->query_tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE | DT_CREATE)) + DT_INIT | DT_PREPARE | DT_CREATE)) DBUG_RETURN(TRUE); select_lex->context.resolve_in_select_list= TRUE; @@ -1798,7 +1799,7 @@ static bool mysql_test_create_table(Prepared_statement *stmt) */ if (open_normal_and_derived_tables(stmt->thd, lex->query_tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE)) + DT_INIT | DT_PREPARE)) DBUG_RETURN(TRUE); } @@ -2025,7 +2026,7 @@ static bool mysql_test_create_view(Prepared_statement *stmt) lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VIEW; if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE)) + DT_INIT | DT_PREPARE)) goto err; res= select_like_stmt_test(stmt, 0, 0);
1 0
0 0
[Commits] d4f3c5c: MyRocks: post-merge fixes part #7: make rocksdb.check_ignore_unknown_options test pass
by psergey@askmonty.org 30 Aug '18

30 Aug '18
revision-id: d4f3c5c42ff9b622bf758a298eb9f07a635bccc8 parent(s): 290368e74065bcdf9e5cb3d5836bf3783080dea1 committer: Sergei Petrunia branch nick: 10.2-mariarocks-merge timestamp: 2018-08-30 21:18:53 +0300 message: MyRocks: post-merge fixes part #7: make rocksdb.check_ignore_unknown_options test pass --- .../rocksdb/mysql-test/rocksdb/t/check_ignore_unknown_options.test | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/storage/rocksdb/mysql-test/rocksdb/t/check_ignore_unknown_options.test b/storage/rocksdb/mysql-test/rocksdb/t/check_ignore_unknown_options.test index 53bfba3..b39c022 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/check_ignore_unknown_options.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/check_ignore_unknown_options.test @@ -8,9 +8,8 @@ let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err; select variable_name, variable_value from information_schema.global_variables where variable_name="rocksdb_ignore_unknown_options"; ---exec find $MYSQLD_DATADIR/#rocksdb/OPTIONS* | sort -n | tail -1 | xargs -0 -I {} -t sh -c "echo hello=world>>{}" -# --exec find $MYSQLD_DATADIR/.rocksdb/OPTIONS* | sort -t- -k 2 -n | tail -1 | xargs -0 -I {} -t sh -c "sed -i 's/rocksdb_version=.*/rocksdb_version=99.9.9/' {}" -# --exec find $MYSQLD_DATADIR/.rocksdb/OPTIONS* | sort -t- -k 2 -n | tail -1 | xargs -0 -I {} -t sh -c "echo hello=world>>{}" +--exec find $MYSQLD_DATADIR/#rocksdb/OPTIONS* | sort -t- -k 2 -n | tail -1 | xargs -0 -I {} -t sh -c "sed -i 's/rocksdb_version=.*/rocksdb_version=99.9.9/' {}" +--exec find $MYSQLD_DATADIR/#rocksdb/OPTIONS* | sort -t- -k 2 -n | tail -1 | xargs -0 -I {} -t sh -c "echo hello=world>>{}" --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect @@ -22,8 +21,8 @@ select variable_name, variable_value from information_schema.global_variables wh let SEARCH_FILE= $error_log; let SEARCH_PATTERN= RocksDB: Compatibility check against existing database options failed; --source include/search_pattern_in_file.inc +--remove_file $error_log --enable_reconnect --exec echo "restart" > $restart_file --source include/wait_until_connected_again.inc ---exec find $MYSQLD_DATADIR/#rocksdb/OPTIONS* | sort -n | tail -1 | xargs -0 -I {} -t sh -c "sed -i'' -e '/hello=world/d' {}" select variable_name, variable_value from information_schema.global_variables where variable_name="rocksdb_ignore_unknown_options";
1 0
0 0
[Commits] 10edeb4d029: MDEV-16957: Server crashes in Field_iterator_natural_join::next upon 2nd execution of SP
by Oleksandr Byelkin 30 Aug '18

30 Aug '18
revision-id: 10edeb4d0292d52e06e66dbe19e6a80ea903a64a (mariadb-5.5.61-10-g10edeb4d029) parent(s): e560f2f342aeb2d72937e9c6f5a4fcbfecc1c35e author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2018-08-30 16:29:42 +0200 message: MDEV-16957: Server crashes in Field_iterator_natural_join::next upon 2nd execution of SP The problem was that join_columns creation was not finished due to error of notfound column in USING, but next execution tried to use join_columns lists. Solution is cleanup the lists on error. It can eat memory in statement MEM_ROOT but it is an error and error will be fixed or statement/procedure removed/altered. --- mysql-test/r/join.result | 6 ++++-- mysql-test/r/sp.result | 17 +++++++++++++++++ mysql-test/t/join.test | 3 ++- mysql-test/t/sp.test | 21 +++++++++++++++++++++ sql/sql_base.cc | 14 +++++++++++++- sql/table.h | 10 ++++++++++ 6 files changed, 67 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 7b0e7807e39..2e5ee30b54e 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1514,11 +1514,13 @@ ERROR 42S22: Unknown column 'f' in 'from clause' DROP TABLE t; CREATE TABLE t (f INT); CALL p; -ERROR 42S22: Unknown column 'f' in 'from clause' +f DROP TABLE t; CREATE TABLE t (i INT); CALL p; -ERROR 42S22: Unknown column 'f' in 'from clause' +ERROR 42S22: Unknown column 't1.f' in 'field list' +CALL p; +ERROR 42S22: Unknown column 't1.f' in 'field list' DROP PROCEDURE p; DROP TABLE t; CREATE TABLE t1 (a INT, b INT); diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 823c6f78cee..4535056242a 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -8055,4 +8055,21 @@ SET S.CLOSE_YN = '' where 1=1; drop function if exists f1; drop table t1,t2; +# +# MDEV-16957: Server crashes in Field_iterator_natural_join::next +# upon 2nd execution of SP +# +CREATE TABLE t1 (a INT, b VARCHAR(32)); +CREATE PROCEDURE sp() SELECT * FROM t1 AS t1x JOIN t1 AS t1y USING (c); +CALL sp; +ERROR 42S22: Unknown column 'c' in 'from clause' +CALL sp; +ERROR 42S22: Unknown column 'c' in 'from clause' +CALL sp; +ERROR 42S22: Unknown column 'c' in 'from clause' +alter table t1 add column c int; +CALL sp; +c a b a b +DROP PROCEDURE sp; +DROP TABLE t1; # End of 5.5 test diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index feafac57a7e..5a29fe72049 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -1185,12 +1185,13 @@ CREATE TABLE t (f INT); # # The following shouldn't fail as the table is now matching the using # ---error ER_BAD_FIELD_ERROR CALL p; DROP TABLE t; CREATE TABLE t (i INT); --error ER_BAD_FIELD_ERROR CALL p; +--error ER_BAD_FIELD_ERROR +CALL p; DROP PROCEDURE p; DROP TABLE t; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 0e42bf3c831..cb93cd31442 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -9353,4 +9353,25 @@ where 1=1; drop function if exists f1; drop table t1,t2; +--echo # +--echo # MDEV-16957: Server crashes in Field_iterator_natural_join::next +--echo # upon 2nd execution of SP +--echo # + +CREATE TABLE t1 (a INT, b VARCHAR(32)); +CREATE PROCEDURE sp() SELECT * FROM t1 AS t1x JOIN t1 AS t1y USING (c); +--error ER_BAD_FIELD_ERROR +CALL sp; +--error ER_BAD_FIELD_ERROR +CALL sp; +--error ER_BAD_FIELD_ERROR +CALL sp; +alter table t1 add column c int; +CALL sp; + +# Cleanup +DROP PROCEDURE sp; +DROP TABLE t1; + + --echo # End of 5.5 test diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 8ffb7bc118b..eeb7845fe17 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7764,10 +7764,22 @@ store_natural_using_join_columns(THD *thd, TABLE_LIST *natural_using_join, result= FALSE; -err: if (arena) thd->restore_active_arena(arena, &backup); DBUG_RETURN(result); + +err: + /* + Actually we failed to build join columns list, so we have to + clear it to avoid problems with half-build join on next run. + The list was created in mark_common_columns(). + */ + table_ref_1->remove_join_columns(); + table_ref_2->remove_join_columns(); + + if (arena) + thd->restore_active_arena(arena, &backup); + DBUG_RETURN(FALSE); } diff --git a/sql/table.h b/sql/table.h index 1d4a1d9a2d2..4725eb96432 100644 --- a/sql/table.h +++ b/sql/table.h @@ -2184,6 +2184,16 @@ struct TABLE_LIST } void set_lock_type(THD* thd, enum thr_lock_type lock); + void remove_join_columns() + { + if (join_columns) + { + join_columns->empty(); + join_columns= NULL; + is_join_columns_complete= FALSE; + } + } + private: bool prep_check_option(THD *thd, uint8 check_opt_type); bool prep_where(THD *thd, Item **conds, bool no_where_clause);
1 0
0 0
[Commits] 1e40186998b: MDEV-16957: Server crashes in Field_iterator_natural_join::next upon 2nd execution of SP
by Oleksandr Byelkin 30 Aug '18

30 Aug '18
revision-id: 1e40186998b1c609059f8840f05af031f68b6647 (mariadb-5.5.61-10-g1e40186998b) parent(s): e560f2f342aeb2d72937e9c6f5a4fcbfecc1c35e author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2018-08-30 15:18:35 +0200 message: MDEV-16957: Server crashes in Field_iterator_natural_join::next upon 2nd execution of SP The problem was that join_columns creation was not finished due to error of notfound column in USING, but next execution tried to use join_columns lists. Solution is cleanup the lists on error. It can eat memory in statement MEM_ROOT but it is an error and error will be fixed or statement/procedure removed/altered. --- mysql-test/r/join.result | 6 ++++-- mysql-test/r/sp.result | 17 +++++++++++++++++ mysql-test/t/join.test | 3 ++- mysql-test/t/sp.test | 21 +++++++++++++++++++++ sql/sql_base.cc | 8 ++++++++ sql/table.h | 10 ++++++++++ 6 files changed, 62 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 7b0e7807e39..2e5ee30b54e 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1514,11 +1514,13 @@ ERROR 42S22: Unknown column 'f' in 'from clause' DROP TABLE t; CREATE TABLE t (f INT); CALL p; -ERROR 42S22: Unknown column 'f' in 'from clause' +f DROP TABLE t; CREATE TABLE t (i INT); CALL p; -ERROR 42S22: Unknown column 'f' in 'from clause' +ERROR 42S22: Unknown column 't1.f' in 'field list' +CALL p; +ERROR 42S22: Unknown column 't1.f' in 'field list' DROP PROCEDURE p; DROP TABLE t; CREATE TABLE t1 (a INT, b INT); diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 823c6f78cee..4535056242a 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -8055,4 +8055,21 @@ SET S.CLOSE_YN = '' where 1=1; drop function if exists f1; drop table t1,t2; +# +# MDEV-16957: Server crashes in Field_iterator_natural_join::next +# upon 2nd execution of SP +# +CREATE TABLE t1 (a INT, b VARCHAR(32)); +CREATE PROCEDURE sp() SELECT * FROM t1 AS t1x JOIN t1 AS t1y USING (c); +CALL sp; +ERROR 42S22: Unknown column 'c' in 'from clause' +CALL sp; +ERROR 42S22: Unknown column 'c' in 'from clause' +CALL sp; +ERROR 42S22: Unknown column 'c' in 'from clause' +alter table t1 add column c int; +CALL sp; +c a b a b +DROP PROCEDURE sp; +DROP TABLE t1; # End of 5.5 test diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index feafac57a7e..5a29fe72049 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -1185,12 +1185,13 @@ CREATE TABLE t (f INT); # # The following shouldn't fail as the table is now matching the using # ---error ER_BAD_FIELD_ERROR CALL p; DROP TABLE t; CREATE TABLE t (i INT); --error ER_BAD_FIELD_ERROR CALL p; +--error ER_BAD_FIELD_ERROR +CALL p; DROP PROCEDURE p; DROP TABLE t; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 0e42bf3c831..cb93cd31442 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -9353,4 +9353,25 @@ where 1=1; drop function if exists f1; drop table t1,t2; +--echo # +--echo # MDEV-16957: Server crashes in Field_iterator_natural_join::next +--echo # upon 2nd execution of SP +--echo # + +CREATE TABLE t1 (a INT, b VARCHAR(32)); +CREATE PROCEDURE sp() SELECT * FROM t1 AS t1x JOIN t1 AS t1y USING (c); +--error ER_BAD_FIELD_ERROR +CALL sp; +--error ER_BAD_FIELD_ERROR +CALL sp; +--error ER_BAD_FIELD_ERROR +CALL sp; +alter table t1 add column c int; +CALL sp; + +# Cleanup +DROP PROCEDURE sp; +DROP TABLE t1; + + --echo # End of 5.5 test diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 8ffb7bc118b..b0f6c191334 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7765,6 +7765,14 @@ store_natural_using_join_columns(THD *thd, TABLE_LIST *natural_using_join, result= FALSE; err: + /* + Actually we failed to build join columns list, so we have to + clear it to avoid problems with half-build join on next run. + The list was created in mark_common_columns(). + */ + table_ref_1->remove_join_columns(); + table_ref_2->remove_join_columns(); + if (arena) thd->restore_active_arena(arena, &backup); DBUG_RETURN(result); diff --git a/sql/table.h b/sql/table.h index 1d4a1d9a2d2..4725eb96432 100644 --- a/sql/table.h +++ b/sql/table.h @@ -2184,6 +2184,16 @@ struct TABLE_LIST } void set_lock_type(THD* thd, enum thr_lock_type lock); + void remove_join_columns() + { + if (join_columns) + { + join_columns->empty(); + join_columns= NULL; + is_join_columns_complete= FALSE; + } + } + private: bool prep_check_option(THD *thd, uint8 check_opt_type); bool prep_where(THD *thd, Item **conds, bool no_where_clause);
1 0
0 0
[Commits] c933970: MDEV-16665 ed25519 describes itself as 1.0-alpha even though it's not alpha.
by holyfoot@askmonty.org 30 Aug '18

30 Aug '18
revision-id: c933970974bd5a30fb824c1df64c68f1bc403389 (mariadb-10.1.35-19-gc933970) parent(s): 2ad51a0bd8380fba3d03a4cebd43860329b7fbaa committer: Alexey Botchkov timestamp: 2018-08-30 15:57:22 +0400 message: MDEV-16665 ed25519 describes itself as 1.0-alpha even though it's not alpha. Plugin version name fixed. --- mysql-test/suite/plugins/r/auth_ed25519.result | 2 +- plugin/auth_ed25519/server_ed25519.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/plugins/r/auth_ed25519.result b/mysql-test/suite/plugins/r/auth_ed25519.result index 371d20b..240e226 100644 --- a/mysql-test/suite/plugins/r/auth_ed25519.result +++ b/mysql-test/suite/plugins/r/auth_ed25519.result @@ -33,7 +33,7 @@ PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication PLUGIN_LICENSE GPL LOAD_OPTION ON PLUGIN_MATURITY Stable -PLUGIN_AUTH_VERSION 1.0-alpha +PLUGIN_AUTH_VERSION 1.0 create user test1@localhost identified via ed25519 using 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'; show grants for test1@localhost; Grants for test1@localhost diff --git a/plugin/auth_ed25519/server_ed25519.c b/plugin/auth_ed25519/server_ed25519.c index 7720a0a..8e442e5 100644 --- a/plugin/auth_ed25519/server_ed25519.c +++ b/plugin/auth_ed25519/server_ed25519.c @@ -101,7 +101,7 @@ maria_declare_plugin(ed25519) 0x0100, NULL, NULL, - "1.0-alpha", + "1.0", MariaDB_PLUGIN_MATURITY_STABLE } maria_declare_plugin_end;
1 0
0 0
[Commits] 2ad51a0: MDEV-17095 pam_user_map module throws syntax error if group name contains backslash.
by holyfoot@askmonty.org 30 Aug '18

30 Aug '18
revision-id: 2ad51a0bd8380fba3d03a4cebd43860329b7fbaa (mariadb-10.1.35-18-g2ad51a0) parent(s): 104089e182f31524d85409bd59f1889e36d4636a committer: Alexey Botchkov timestamp: 2018-08-30 14:51:15 +0400 message: MDEV-17095 pam_user_map module throws syntax error if group name contains backslash. Let '\\' and '/' symbols to be part of a group name. --- plugin/auth_pam/mapper/pam_user_map.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/auth_pam/mapper/pam_user_map.c b/plugin/auth_pam/mapper/pam_user_map.c index c03ea12..e1d11aca 100644 --- a/plugin/auth_pam/mapper/pam_user_map.c +++ b/plugin/auth_pam/mapper/pam_user_map.c @@ -189,13 +189,15 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, s++; } from= s; - skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') || (*s == '$')); + skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') || + (*s == '$') || (*s == '\\') || (*s == '/')); end_from= s; skip(isspace(*s)); if (end_from == from || *s++ != ':') goto syntax_error; skip(isspace(*s)); to= s; - skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') || (*s == '$')); + skip(isalnum(*s) || (*s == '_') || (*s == '.') || (*s == '-') || + (*s == '$')); end_to= s; if (end_to == to) goto syntax_error;
1 0
0 0
[Commits] 290368e: MyRocks: post-merge fixes part #6: make rocksdb.allow_no_primary_key test pass
by psergey@askmonty.org 30 Aug '18

30 Aug '18
revision-id: 290368e74065bcdf9e5cb3d5836bf3783080dea1 parent(s): 5e4f3af9b7b7ad46dae09d5020f9147cadffc14e committer: Sergei Petrunia branch nick: 10.2-mariarocks-merge timestamp: 2018-08-30 12:55:03 +0300 message: MyRocks: post-merge fixes part #6: make rocksdb.allow_no_primary_key test pass --- storage/rocksdb/mysql-test/rocksdb/r/allow_no_primary_key.result | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/rocksdb/mysql-test/rocksdb/r/allow_no_primary_key.result b/storage/rocksdb/mysql-test/rocksdb/r/allow_no_primary_key.result index de8a1fb..a8d5c07 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/allow_no_primary_key.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/allow_no_primary_key.result @@ -276,10 +276,10 @@ a 10 20 30 +connect con1,localhost,root,,; +connection con1; alter table t1 force; -select * from t1; -a -insert into t1 values (100); +connection default; select * from t1; a connection con1;
1 0
0 0
[Commits] b245023: MDEV-16992 Assertion `table_ref->table || table_ref->view' failed in
by IgorBabaev 30 Aug '18

30 Aug '18
revision-id: b245023fe0bc6fa0bd6e2dfa9352b30b71d0d27d (mariadb-10.2.16-109-gb245023) parent(s): a8bf27c7157374e3c1c4fa1b300ed6df195dda7b author: Igor Babaev committer: Igor Babaev timestamp: 2018-08-30 00:51:39 -0700 message: MDEV-16992 Assertion `table_ref->table || table_ref->view' failed in Field_iterator_table_ref::set_field_iterator Several functions that processed different prepare statements missed the DT_INIT flag in last parameter of the open_normal_and_derived_tables() calls. It made context analysis of derived tables dependent on the order in which the derived tables were processed by mysql_handle_derived(). This order was induced by the order of SELECTs in all_select_list. In 10.4 the order of SELECTs in all_select_list became different and lack of the DT_INIT flags in some open_normal_and_derived_tables() call became critical as some derived tables were not identified as such. --- mysql-test/r/ps.result | 43 +++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/ps.test | 46 ++++++++++++++++++++++++++++++++++++++++++++++ sql/sql_prepare.cc | 13 +++++++------ 3 files changed, 96 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 4a1922e..2431e5d 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -5244,5 +5244,48 @@ DROP PROCEDURE p2; DROP PROCEDURE p1; DROP ROLE testrole; # +# MDEV-16992: prepare of CREATE TABLE, CREATE VIEW, DO, SET, CALL +# statements with CTE containing materialized derived +# (the bug is reproducible on 10.4) +# +prepare stmt from +"CREATE TABLE t1 AS + WITH cte(a) AS (SELECT * FROM (SELECT 1) AS t) SELECT * FROM cte;"; +execute stmt; +select * from t1; +a +1 +prepare stmt from +"CREATE VIEW v1 AS + WITH cte(a) AS (SELECT * FROM (SELECT 1) AS t) SELECT * FROM cte;"; +execute stmt; +select * from v1; +a +1 +prepare stmt from +"DO (SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS tt);"; +execute stmt; +prepare stmt from +"SET @a = (SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS t);"; +execute stmt; +create procedure p (i int) insert into t1 values(i); +prepare stmt from +"CALL p + ((SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS tt));"; +execute stmt; +select * from t1; +a +1 +1 +drop procedure p; +drop view v1; +drop table t1; +# # End of 10.2 tests # diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index c826bff..9acae10 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -4748,5 +4748,51 @@ DROP PROCEDURE p1; DROP ROLE testrole; --echo # +--echo # MDEV-16992: prepare of CREATE TABLE, CREATE VIEW, DO, SET, CALL +--echo # statements with CTE containing materialized derived +--echo # (the bug is reproducible on 10.4) +--echo # + +--enable_result_log + +prepare stmt from +"CREATE TABLE t1 AS + WITH cte(a) AS (SELECT * FROM (SELECT 1) AS t) SELECT * FROM cte;"; +execute stmt; +select * from t1; + +prepare stmt from +"CREATE VIEW v1 AS + WITH cte(a) AS (SELECT * FROM (SELECT 1) AS t) SELECT * FROM cte;"; +execute stmt; +select * from v1; + +prepare stmt from +"DO (SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS tt);"; +execute stmt; + +prepare stmt from +"SET @a = (SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS t);"; +execute stmt; + +create procedure p (i int) insert into t1 values(i); + +prepare stmt from +"CALL p + ((SELECT 1 + FROM (WITH cte AS (SELECT * FROM (SELECT 1) AS t) + SELECT * FROM cte) AS tt));"; +execute stmt; +select * from t1; + +drop procedure p; +drop view v1; +drop table t1; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index d209707..0d7b043 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1637,7 +1637,7 @@ static bool mysql_test_do_fields(Prepared_statement *stmt, DBUG_RETURN(TRUE); if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE | DT_CREATE)) + DT_INIT | DT_PREPARE | DT_CREATE)) DBUG_RETURN(TRUE); DBUG_RETURN(setup_fields(thd, Ref_ptr_array(), *values, MARK_COLUMNS_NONE, 0, NULL, 0)); @@ -1669,7 +1669,7 @@ static bool mysql_test_set_fields(Prepared_statement *stmt, if ((tables && check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE)) || open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE | DT_CREATE)) + DT_INIT | DT_PREPARE | DT_CREATE)) goto error; while ((var= it++)) @@ -1706,7 +1706,8 @@ static bool mysql_test_call_fields(Prepared_statement *stmt, if ((tables && check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE)) || - open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, DT_PREPARE)) + open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, + DT_INIT | DT_PREPARE)) goto err; while ((item= it++)) @@ -1833,7 +1834,7 @@ static bool mysql_test_create_table(Prepared_statement *stmt) if (open_normal_and_derived_tables(stmt->thd, lex->query_tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE | DT_CREATE)) + DT_INIT | DT_PREPARE | DT_CREATE)) DBUG_RETURN(TRUE); select_lex->context.resolve_in_select_list= TRUE; @@ -1854,7 +1855,7 @@ static bool mysql_test_create_table(Prepared_statement *stmt) */ if (open_normal_and_derived_tables(stmt->thd, lex->query_tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE)) + DT_INIT | DT_PREPARE)) DBUG_RETURN(TRUE); } @@ -2081,7 +2082,7 @@ static bool mysql_test_create_view(Prepared_statement *stmt) lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VIEW; if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE)) + DT_INIT | DT_PREPARE)) goto err; res= select_like_stmt_test(stmt, 0, 0);
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • ...
  • 1461
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.