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
Sergei Golubchik
remove Sql_path_stack and Sql_path_push

don't create a permanent stack of paths on the heap and in THD.

Do it on the stack like for sql_mode, sctx, abort_on_warning, and
other THD properties that often need to be changed temporarily.

Fix Sql_path constructor.
Oleg Smirnov
WIP: parsing
Sergei Golubchik
don't backtick-quote CURRENT_SCHEMA
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
Sergei Golubchik
PATH is not a chistic, it's like sql_mode, remembered implicitly per routine
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()
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()
Sergei Golubchik
disallow SET PATH DEFAULT in stored routines and triggers

also fix Sys_var_charset_collation_map where this bug was copied from
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.
Andrei Elkin
Revert "MDEV-37686 rpl.create_or_replace_mix2 fails in MDEV-35915 branch"

This reverts commit 3241798214b066d62ba3274ba5dc29549349ca65.
Due to MDEV-38212.
Sergei Golubchik
relax assert to account for recursive RETURNS TEXT functions
Sergei Golubchik
clarify the test for triggers with different paths
Sergei Golubchik
use standard SET PATH syntax in tests
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
Sergei Golubchik
cache routines during path resolution
Alexander Barkov
FETCH anchored_cursor_with_return INTO var1,var2,var3