mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.11' into 11.4
This commit is contained in:
124
sql/sql_base.cc
124
sql/sql_base.cc
@@ -7522,77 +7522,75 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2,
|
|||||||
clause (if present), mark them as common fields, and add a new
|
clause (if present), mark them as common fields, and add a new
|
||||||
equi-join condition to the ON clause.
|
equi-join condition to the ON clause.
|
||||||
*/
|
*/
|
||||||
if (nj_col_2)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
Create non-fixed fully qualified field and let fix_fields to
|
|
||||||
resolve it.
|
|
||||||
*/
|
|
||||||
Item *item_1= nj_col_1->create_item(thd);
|
|
||||||
Item *item_2= nj_col_2->create_item(thd);
|
|
||||||
Item_ident *item_ident_1, *item_ident_2;
|
|
||||||
Item_func_eq *eq_cond;
|
|
||||||
|
|
||||||
if (!item_1 || !item_2)
|
/*
|
||||||
goto err; // out of memory
|
Create non-fixed fully qualified field and let fix_fields to
|
||||||
|
resolve it.
|
||||||
|
*/
|
||||||
|
Item *item_1= nj_col_1->create_item(thd);
|
||||||
|
Item *item_2= nj_col_2->create_item(thd);
|
||||||
|
Item_ident *item_ident_1, *item_ident_2;
|
||||||
|
Item_func_eq *eq_cond;
|
||||||
|
|
||||||
/*
|
if (!item_1 || !item_2)
|
||||||
The following assert checks that the two created items are of
|
goto err; // out of memory
|
||||||
type Item_ident.
|
|
||||||
*/
|
|
||||||
DBUG_ASSERT(!thd->lex->current_select->no_wrap_view_item);
|
|
||||||
/*
|
|
||||||
In the case of no_wrap_view_item == 0, the created items must be
|
|
||||||
of sub-classes of Item_ident.
|
|
||||||
*/
|
|
||||||
DBUG_ASSERT(item_1->type() == Item::FIELD_ITEM ||
|
|
||||||
item_1->type() == Item::REF_ITEM);
|
|
||||||
DBUG_ASSERT(item_2->type() == Item::FIELD_ITEM ||
|
|
||||||
item_2->type() == Item::REF_ITEM);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We need to cast item_1,2 to Item_ident, because we need to hook name
|
The following assert checks that the two created items are of
|
||||||
resolution contexts specific to each item.
|
type Item_ident.
|
||||||
*/
|
*/
|
||||||
item_ident_1= (Item_ident*) item_1;
|
DBUG_ASSERT(!thd->lex->current_select->no_wrap_view_item);
|
||||||
item_ident_2= (Item_ident*) item_2;
|
/*
|
||||||
/*
|
In the case of no_wrap_view_item == 0, the created items must be
|
||||||
Create and hook special name resolution contexts to each item in the
|
of sub-classes of Item_ident.
|
||||||
new join condition . We need this to both speed-up subsequent name
|
*/
|
||||||
resolution of these items, and to enable proper name resolution of
|
DBUG_ASSERT(item_1->type() == Item::FIELD_ITEM ||
|
||||||
the items during the execute phase of PS.
|
item_1->type() == Item::REF_ITEM);
|
||||||
*/
|
DBUG_ASSERT(item_2->type() == Item::FIELD_ITEM ||
|
||||||
if (set_new_item_local_context(thd, item_ident_1, nj_col_1->table_ref) ||
|
item_2->type() == Item::REF_ITEM);
|
||||||
set_new_item_local_context(thd, item_ident_2, nj_col_2->table_ref))
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
if (!(eq_cond= new (thd->mem_root) Item_func_eq(thd, item_ident_1, item_ident_2)))
|
/*
|
||||||
goto err; /* Out of memory. */
|
We need to cast item_1,2 to Item_ident, because we need to hook name
|
||||||
|
resolution contexts specific to each item.
|
||||||
|
*/
|
||||||
|
item_ident_1= (Item_ident*) item_1;
|
||||||
|
item_ident_2= (Item_ident*) item_2;
|
||||||
|
/*
|
||||||
|
Create and hook special name resolution contexts to each item in the
|
||||||
|
new join condition . We need this to both speed-up subsequent name
|
||||||
|
resolution of these items, and to enable proper name resolution of
|
||||||
|
the items during the execute phase of PS.
|
||||||
|
*/
|
||||||
|
if (set_new_item_local_context(thd, item_ident_1, nj_col_1->table_ref) ||
|
||||||
|
set_new_item_local_context(thd, item_ident_2, nj_col_2->table_ref))
|
||||||
|
goto err;
|
||||||
|
|
||||||
/*
|
if (!(eq_cond= new (thd->mem_root) Item_func_eq(thd, item_ident_1, item_ident_2)))
|
||||||
Add the new equi-join condition to the ON clause. Notice that
|
goto err; /* Out of memory. */
|
||||||
fix_fields() is applied to all ON conditions in setup_conds()
|
|
||||||
so we don't do it here.
|
|
||||||
*/
|
|
||||||
add_join_on(thd, (table_ref_1->outer_join & JOIN_TYPE_RIGHT ?
|
|
||||||
table_ref_1 : table_ref_2),
|
|
||||||
eq_cond);
|
|
||||||
|
|
||||||
nj_col_1->is_common= nj_col_2->is_common= TRUE;
|
/*
|
||||||
DBUG_PRINT ("info", ("%s.%s and %s.%s are common",
|
Add the new equi-join condition to the ON clause. Notice that
|
||||||
nj_col_1->safe_table_name(),
|
fix_fields() is applied to all ON conditions in setup_conds()
|
||||||
nj_col_1->name()->str,
|
so we don't do it here.
|
||||||
nj_col_2->safe_table_name(),
|
*/
|
||||||
nj_col_2->name()->str));
|
add_join_on(thd, (table_ref_1->outer_join & JOIN_TYPE_RIGHT ?
|
||||||
|
table_ref_1 : table_ref_2),
|
||||||
|
eq_cond);
|
||||||
|
|
||||||
if (field_1)
|
nj_col_1->is_common= nj_col_2->is_common= TRUE;
|
||||||
update_field_dependencies(thd, field_1, field_1->table);
|
DBUG_PRINT ("info", ("%s.%s and %s.%s are common",
|
||||||
if (field_2)
|
nj_col_1->safe_table_name(),
|
||||||
update_field_dependencies(thd, field_2, field_2->table);
|
nj_col_1->name()->str,
|
||||||
|
nj_col_2->safe_table_name(),
|
||||||
|
nj_col_2->name()->str));
|
||||||
|
|
||||||
if (using_fields != NULL)
|
if (field_1)
|
||||||
++(*found_using_fields);
|
update_field_dependencies(thd, field_1, field_1->table);
|
||||||
}
|
if (field_2)
|
||||||
|
update_field_dependencies(thd, field_2, field_2->table);
|
||||||
|
|
||||||
|
if (using_fields != NULL)
|
||||||
|
++(*found_using_fields);
|
||||||
}
|
}
|
||||||
if (leaf_1)
|
if (leaf_1)
|
||||||
leaf_1->is_join_columns_complete= TRUE;
|
leaf_1->is_join_columns_complete= TRUE;
|
||||||
|
@@ -1250,7 +1250,7 @@ static MYSQL_SYSVAR_UINT(
|
|||||||
"Statistics Level for RocksDB. Default is 0 (kExceptHistogramOrTimers)",
|
"Statistics Level for RocksDB. Default is 0 (kExceptHistogramOrTimers)",
|
||||||
nullptr, rocksdb_set_rocksdb_stats_level,
|
nullptr, rocksdb_set_rocksdb_stats_level,
|
||||||
/* default */ (uint)rocksdb::StatsLevel::kExceptHistogramOrTimers,
|
/* default */ (uint)rocksdb::StatsLevel::kExceptHistogramOrTimers,
|
||||||
/* min */ (uint)rocksdb::StatsLevel::kExceptHistogramOrTimers,
|
/* min */ (uint)rocksdb::StatsLevel::kDisableAll,
|
||||||
/* max */ (uint)rocksdb::StatsLevel::kAll, 0);
|
/* max */ (uint)rocksdb::StatsLevel::kAll, 0);
|
||||||
|
|
||||||
static MYSQL_SYSVAR_SIZE_T(compaction_readahead_size,
|
static MYSQL_SYSVAR_SIZE_T(compaction_readahead_size,
|
||||||
|
@@ -11,7 +11,7 @@ INSERT INTO invalid_values VALUES('\'484436\'');
|
|||||||
SET @start_global_value = @@global.ROCKSDB_STATS_LEVEL;
|
SET @start_global_value = @@global.ROCKSDB_STATS_LEVEL;
|
||||||
SELECT @start_global_value;
|
SELECT @start_global_value;
|
||||||
@start_global_value
|
@start_global_value
|
||||||
0
|
1
|
||||||
'# Setting to valid values in global scope#'
|
'# Setting to valid values in global scope#'
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 0"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 0"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = 0;
|
SET @@global.ROCKSDB_STATS_LEVEL = 0;
|
||||||
@@ -22,7 +22,7 @@ SELECT @@global.ROCKSDB_STATS_LEVEL;
|
|||||||
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
0
|
1
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 4"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 4"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = 4;
|
SET @@global.ROCKSDB_STATS_LEVEL = 4;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@ -32,7 +32,7 @@ SELECT @@global.ROCKSDB_STATS_LEVEL;
|
|||||||
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
0
|
1
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 2"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 2"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = 2;
|
SET @@global.ROCKSDB_STATS_LEVEL = 2;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@ -42,7 +42,7 @@ SELECT @@global.ROCKSDB_STATS_LEVEL;
|
|||||||
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
SET @@global.ROCKSDB_STATS_LEVEL = DEFAULT;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
0
|
1
|
||||||
"Trying to set variable @@session.ROCKSDB_STATS_LEVEL to 444. It should fail because it is not session."
|
"Trying to set variable @@session.ROCKSDB_STATS_LEVEL to 444. It should fail because it is not session."
|
||||||
SET @@session.ROCKSDB_STATS_LEVEL = 444;
|
SET @@session.ROCKSDB_STATS_LEVEL = 444;
|
||||||
ERROR HY000: Variable 'rocksdb_stats_level' is a GLOBAL variable and should be set with SET GLOBAL
|
ERROR HY000: Variable 'rocksdb_stats_level' is a GLOBAL variable and should be set with SET GLOBAL
|
||||||
@@ -52,34 +52,34 @@ SET @@global.ROCKSDB_STATS_LEVEL = 'aaa';
|
|||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
0
|
1
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 'bbb'"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to 'bbb'"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = 'bbb';
|
SET @@global.ROCKSDB_STATS_LEVEL = 'bbb';
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
0
|
1
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '-1'"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '-1'"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = '-1';
|
SET @@global.ROCKSDB_STATS_LEVEL = '-1';
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
0
|
1
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '101'"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '101'"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = '101';
|
SET @@global.ROCKSDB_STATS_LEVEL = '101';
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
0
|
1
|
||||||
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '484436'"
|
"Trying to set variable @@global.ROCKSDB_STATS_LEVEL to '484436'"
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = '484436';
|
SET @@global.ROCKSDB_STATS_LEVEL = '484436';
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
0
|
1
|
||||||
SET @@global.ROCKSDB_STATS_LEVEL = @start_global_value;
|
SET @@global.ROCKSDB_STATS_LEVEL = @start_global_value;
|
||||||
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
SELECT @@global.ROCKSDB_STATS_LEVEL;
|
||||||
@@global.ROCKSDB_STATS_LEVEL
|
@@global.ROCKSDB_STATS_LEVEL
|
||||||
0
|
1
|
||||||
DROP TABLE valid_values;
|
DROP TABLE valid_values;
|
||||||
DROP TABLE invalid_values;
|
DROP TABLE invalid_values;
|
||||||
|
Reference in New Issue
Block a user