Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Console View


Categories: connectors experimental galera main
Legend:   Passed Failed Warnings Failed Again Running Exception Offline No data

connectors experimental galera main
Sergei Golubchik
fix --path to work

complex object sysvars (plugins, time zone, path) cannot be
set by my_getopt, they have to use NO_CMD_LINE and special
code in mysqld.cc
Sergei Golubchik
reserve PATH_SYM in the same way as NAMES_SYM
Oleg Smirnov
WIP
Nikita Malyavin
MDEV-38151 GTT: missing FUNCTION support

open_temporary_table[s] defaulted to searching only local temporary
tables (Tmp_table_kind::TMP). When in function, a temporary table was
"carefully re-opened": it was closed and then opened again, with
open_temporary_table. This resulted in "table not found".

The correct key in most cases is Tmp_table_kind::ANY.
In some cases it should be Tmp_table_kind::TMP:
* When operation is not supported for GTT (ANALYZE/REPAIR)
* When a global handle should be opened (CREATE VIEW)
* If it's a re-open

Apart from this bug, it caused a global temporary table to be always
opened through open_tables, meaning that tdc was queried first. This
means that the earlier code never relied on pre-opening
temporary tables.

This means that all the commands that follow the default
open_temporary_tables path in mysql_execute_command (the standard
temporary tables pre-opening) should be able to handle child GTT share.

This wasn't so for TRUNCATE, hence the changes in sql_truncate.cc.

Also, this broke the lookup order: first a local temporary table should
be looked up. If it doesn't exist, only then a global temporary table
should be looked up.
To fix the latter -- push back global temporary tables' local shares and
push front local temporary tables.

To support push_front, All_tmp_tables_list declaration is changed. It
should use I_P_List_fast_push_back adapter, which adds T **m_last to the
list body.
Oleg Smirnov
WIP: parsing
bsrikanth-mariadb
MDEV-36523: Load basic stats from trace into optimizer

This task loads the stats of the tables that are used in a query,
from the trace into the optimizer. This feature is controlled
by optimizer_replay_context, and points to an user defined variable name,
that has the context information.
The stats such as num_of_records present in the table, indexes if present,
their names, along with the average number of records_per_key
with in each index, cost of reading an index are loaded from the trace.
Additionally, stats from range analysis i.e. ranges, and the
corresponding number of records, along with their costs are also
loaded from the trace.

The trace context which is in JSON format is firstly set into the
user defined session variable, and this variable name is set to
optimizer_replay_context system variable.
Later, when a user issues a query, the contents of the json context is
parsed and an in memory representation is built using the class
Optimizer_context_replay. This class is then used by the optimizer
to update and save original values of the tables, indexes, and range stats
in the methods "set_statistics_for_table()" of sql_statistics.cc, and
"check_quick_select()" of opt_range.cc.
After the query gets finished, the statistics that were updated
in the optimizer are restored back to the saved original values.

The entry point for parsing the json structure is in
"mysql_execute_command()" of sql_parse.cc, and similarly exit point
i.e. to restore the saved stats of the optimizer is at the end
of the same method.

Two new warning/error messages are introduced:
ER_JSON_OPTIMIZER_REPLAY_CONTEXT_PARSE_FAILED, and
ER_JSON_OPTIMIZER_REPLAY_CONTEXT_MATCH_FAILED
Sergei Golubchik
mysql.proc.path DEFAULT 'CURRENT_SCHEMA' NOT NULL
Rex Johnston
MDEV-38258 No error thrown when CTE columns updated in updates set clause

CTE's are read only i.e It cannot have their columns updated in updates
set clause. Attempting to do so , should throw error
ERROR 1288 (HY000): The target table cte of the UPDATE is not updatable

with cte as (select * from t1 where c < 5)
  update cte set cte.a =(select a from cte);
Here, conversion from a single table to a multi table update bypasses
the normal check by setting the TABLE_LIST object representing cte
to be merge derived.  This is incorrect, so we prohibit this conversion
in TABLE_LIST::init_derived.
Oleg Smirnov
MDEV-38045: Implement implicit query block names for optimizer hints

This patch implements support for implicit query block (QB) names in
optimizer hints, allowing hints to reference query blocks and tables
within derived tables, views and CTEs without requiring explicit
QB_NAME hints.

Examples.
-- Addressing a table inside a derived table using implicit QB name
select /*+ no_index(t1@dt) */ *
  from (select * from t1 where a > 10) as DT;
-- this is an equivalent to:
select /*+ no_index(t1@dt) */ * from
  (select /*+ qb_name(dt)*/ * from t1 where a > 10) as DT;
-- Addressing a query block corresponding to the derived table
select /*+ no_bnl(@dt) */ *
  from (select * from t1, t2 where t.1.a > t2.a) as DT;

-- View
create view v1 as select * from t1 where a > 10 and b > 100;
-- referencing a table inside a view by implicit QB name:
select /*+ index_merge(t1@v1 idx_a, idx_b) */ *
  from v1, t2 where v1.a = t2.a;
-- equivalent to:
create view v1 as select /*+ qb_name(qb_v1) */ *
  from t1 where a > 10 and b > 100;
select /*+ index_merge(t1@qb_v1 idx_a, idx_b) */ *
  from v1, t2 where v1.a = t2.a;

-- CTE
with aless100 as (select a from t1 where b <100)
  select /*+ index(t1@aless100) */ * from aless100;
-- equivalent to:
with aless100 as (select /*+ qb_name(aless100) */ a from t1 where b <100)
  select /*+ index(t1@aless100) */ * from aless100;

Key changes:

1. Two-stage hint resolution
  - Introduced hint_resolution_stage enum (EARLY/LATE) to control
    when different hint types are resolved:
    - EARLY stage: before opening tables (QB_NAME, MERGE hints)
    - LATE stage: after opening tables (all other hints)

2. Implicit QB name support
  - Derived table/view/CTE aliases can now be used as implicit query
    block names in hint syntax: @alias, table@alias
  - Derived tables inside views can be addressed from outer queries
    using their aliases
Lawrin Novitsky
ODBC-482 Problems with SQLSetPos on block cursor with NULL values.

If position was changed, SQLGetData would still read if value is NULL
from first row in the block cursor. That could lead to different issues
and even crash on SQL_DELETE or in SQLGetData() after SQL_POSITION.
Part of fix is also in the part that has been moved to c/c++ repo -
get() method returned true, i.e. error on NULL field value. Plus
resultset method isNull has been made public.
Sergei Golubchik
small cleanup
Sergei Golubchik
more tests for duplicate values in path
Sergei Golubchik
allocate Sql_path in one memory chunk, not one per schema

because it's always allocated and freed as a whole, there is
no operation "replace one name in the middle of the path"

this needed a reworked parser to create the whole list
of names, not append one name at a time.

Fixed a bug where Sql_path::from_text() pretended it can take
a string in any charset, but was always implicitly
assuming it's in my_charset_utf8mb3_general_ci.
Sergei Golubchik
remove always-false agument
Andrei Elkin
MDEV-38212 MDEV-37686 Breaks Parallel Replication

Instead of `NULL`ifying of this member a finer approach is taken to
screen the replicated temporary tables from the slave applier
when it runs within `start_new_trans` context.

For that *all* access critical `THD::{has,lock,unlock}_temporary_tables`
functions are made to check possible `start_new_trans` condition.
This measure forces `start_new_trans` executing slave thread to always take
the normal thread access path to a temporary table repository.

This commit also unifies with sql/temporary_tables.cc checking of the
current thread is slave with usage of THD::rgi_slave instead of
THD::slave_thread (last time chosen by MDEV-33426).

Tested with rpl.create_or_replace_mix2 of GTT feature branch.
Sergei Golubchik
disallow SET PATH in sf or trg while parsing

but also when executing, of course
Sergei Golubchik
do NOT prefer itself in seemingly recursive calls, follow the path
Oleg Smirnov
WIP
Sergei Golubchik
fix name resolution of name1.name2()

only search in thd->db if the path includes CURRENT_SCHEMA

Also, fix a bug with recursive function calls.
Sergei Golubchik
remove LEX::make_sp_name_sql_path()

it confusingly didn't have anything to do with sql path,
so merged into LEX::make_sp_name()
Nikita Malyavin
MDEV-38266 Infinite loop after LOCK+REPAIR

Case:
1. Two tables are locked, one of them is GTT
2. Invoke REPAIR on the last table in the list (not GTT)
3. SELECT from gtt

How the bug works:
1. REPAIR sets tdc->flushed=true
2. LOCK TABLE will prevent eviction
3. In SELECT, open_table will go by locked_tables_mode path
4. GTT is found, goto get_new_table (bug!).
5. This is true: thd->open_tables && thd->open_tables->s->tdc->flushed
6. ot_ctx->request_backoff_action
7. open_table retry (infinite).

Fix:
Straighten the flow.
We shouldn't check thd->open_tables->s->tdc->flushed in LTM, but
actually we should do none under get_new_table label right until
open_global_temporary_table.

get_new_table would access tdc and search for TABLE_SHARE, but actually
we already have it. We also shouldn't configure it from scratch - it's
already done. Overall, we can jump directly to opening GTT, with setting
a few variables.

Because TABLE_SHARE will not be opened through tdc (where acquire would
happen), we shouldn't release it in open_global_temporary_table under
locked_tables_mode+MYSQL_OPEN_GET_NEW_TABLE.
Rex Johnston
MDEV-38258 No error thrown when CTE columns updated in updates set clause

CTE's are read only i.e It cannot have their columns updated in updates
set clause. Attempting to do so , should throw error
ERROR 1288 (HY000): The target table cte of the UPDATE is not updatable

with cte as (select * from t1 where c < 5)
  update cte set cte.a =(select a from cte);
Here, conversion from a single table to a multi table update bypasses
the normal check by setting the TABLE_LIST object representing cte
to be merge derived.  This is incorrect, so we prohibit this conversion
in TABLE_LIST::init_derived.
Marko Mäkelä
squash! baff127a9ecbaee9ccd266e92508ca0908a25e60

log_t::set_archive(my_bool): Implement SET GLOBAL innodb_log_archive.
An error will be returned if non-archived SET GLOBAL innodb_log_file_size
(log file resizing) is in progress.
FIXME: Rename and update the current log file.

innodb_log_archive_start: The initial value of the status variable
innodb_lsn_archived, or 0 to autodetect from the log files.
Sergei Golubchik
consistency in error message naming
Rex Johnston
MDEV-38258 No error thrown when CTE columns updated in updates set clause

CTE's are read only i.e It cannot have their columns updated in updates
set clause. Attempting to do so , should throw error
ERROR 1288 (HY000): The target table cte of the UPDATE is not updatable

with cte as (select * from t1 where c < 5)
  update cte set cte.a =(select a from cte);
Here, conversion from a single table to a multi table update bypasses
the normal check by setting the TABLE_LIST object representing cte
to be merge derived.  This is incorrect, so we prohibit this conversion
in TABLE_LIST::init_derived.
Lawrin Novitsky
get methods returned true for the NULL value - i.e. error. That is

incorrect.
Made isNull method public.
Rex Johnston
MDEV-37220  Allow UPDATE/DELETE to read from a CTE

We extend from the SQL standard to match the functionality of other
databases that allow the inclusion of a CTE definition prior to update
and delete statements.

These CTEs are currently read only, like other derived tables, so
cannot have their columns updated in updates set clause, nor have rows
removed in the delete statement.

Approved by: Oleksandr Byelkin ([email protected])
Sergei Golubchik
free Sql_path in the destructor, perform cleanup in cleanup()
Andrei Elkin
MDEV-38212 MDEV-37686 Breaks Parallel Replication

Re-fixing MDEV-37686.

NULLifying `THD::rgi_slave` pointer in `start_new_trans` ctor harmed
the parallel slave conflict detection.
Now instead of `NULL`ifying of this member a finer approach is taken to
optionally screen `THD::rgi_slave` when it is attempted to be accessed
within `start_new_trans` context, that is when such out-of-band
transaction is run by a slave thread.

The start_new_trans is allowed of course to access server local
non-replicated temporary tables, should it ever need that.

The original MDEV-37686 aspect is tested with 12.3 branch's
rpl.create_or_replace_mix2.
Any possible side effects to temporary table replication is controlled
by existing rpl suite tests.
There is no need for a specific mtr test to prove the parallel slave
side is back to normal, as `THD::rgi_slave` is again available to concurrent
transactions.
Sergei Golubchik
disallow SET PATH DEFAULT in stored routines and triggers

also fix Sys_var_charset_collation_map where this bug was copied from
Nikita Malyavin
MDEV-37871 SIGSEGV in I_P_List_iterator on DROP DATABASE test

Happens on dropping the database on a newly created conneciton.

temporary_tables can be NULL in THD::global_tmp_drop_database.
Hemant Dangi
MDL BF-BF conflict on ALTER and INSERT with multi-level foreign key parents

Issue:
On galera write node INSERT statements does not acquire MDL locks on it's all child
tables and thereby wsrep certification keys are also added for limited tables, but
on applier nodes it does acquire MDL locks for all child tables. This can result
into MDL BF-BF conflict on applier node when transactions referring to parent and
child tables are executed concurrently. For example:

Tables with foreign keys: t1<-t2<-t3<-t4
Conflicting transactions: INSERT t1 and DROP TABLE t4

Wsrep certification keys taken on write node:
- for INSERT t1: t1 and t2
- for DROP TABLE t4: t4

On applier node MDL BF-BF conflict happened between two transaction because
MDL locks on t1, t2, t3 and t4 were taken for INSERT t1, which conflicted
with MDL lock on t4 taken by DROP TABLE t4.
The Wsrep certification keys helps in resolving this MDL BF-BF conflict by
prioritizing and scheduling concurrent transactions. But to generate Wsrep
certification keys it needs to open and take MDL locks on all the child tables.

On applier nodes Write_rows event is implicitly a REPLACE, deleting all conflicting
rows which can cause cascading FK actions and locks on foreign key children tables.

Solution:
For Galera applier nodes the Write_rows event is considered pure INSERT
which will never cause cascading FK actions and locks on foreign key children tables.
Sergei Golubchik
MDEV-38242 crash when first COM_STMT_EXECUTE doesn't send types

all params are initialized to use Type_handler_null.
NULL params do not have a value to read from the packet buffer,
so their Item_param_set_param_func() should do nothing.

Type_handler_null inherits from Type_handler_string_result,
that is, Type_handler_null *must* override parent's
Item_param_set_param_func().
Andrei Elkin
Revert "MDEV-37686 rpl.create_or_replace_mix2 fails in MDEV-35915 branch"

This reverts commit 3241798214b066d62ba3274ba5dc29549349ca65.
Due to MDEV-38212.
Nikita Malyavin
cleanup: register global_temporary_tp handlerton only ON COMMIT DELETE
Sergei Golubchik
clarify the test for triggers with different paths
Sergei Golubchik
bug: `current_schema` is not current_schema

quoted `current_schema` is literally a schema name and must
but treated as such. because Sql_path stores all names unquoted
let's store the current_schema as an empty name, length=0.
No valid schema name can be empty.
Oleksandr Byelkin
MDEV-38126:fix the version of server_audit plugin taking into account its feature set
Alexander Barkov
FETCH anchored_cursor_with_return INTO var1,var2,var3