Skip to content

Commit

Permalink
MDEV-7635: Renamed standards_compliant_cte to standard_compliant_cte
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirbhay Choubey committed Feb 10, 2017
1 parent 25f6d1d commit 185d140
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions mysql-test/r/cte_recursive.result
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ where folks.id = ma.id and (mother not in (select id from ancestor_ids))
select generation, name from ancestor_ids a, folks
where a.id = folks.id;
ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'ancestor_ids'
set standards_compliant_cte=0;
set standard_compliant_cte=0;
with recursive
ancestor_ids (id, generation)
as
Expand Down Expand Up @@ -999,7 +999,7 @@ generation name
2 Grandma Sally
2 Grandpa Ben
3 Grandgrandma Martha
set standards_compliant_cte=1;
set standard_compliant_cte=1;
with recursive
coupled_ancestor_ids (id)
as
Expand All @@ -1023,7 +1023,7 @@ n.father is not null and n.mother is not null
select p.* from coupled_ancestor_ids a, folks p
where a.id = p.id;
ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'coupled_ancestor_ids'
set statement standards_compliant_cte=0 for
set statement standard_compliant_cte=0 for
with recursive
coupled_ancestor_ids (id)
as
Expand Down Expand Up @@ -1073,7 +1073,7 @@ where p.id = a.id
)
select * from ancestors;
ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'ancestor_ids'
set statement standards_compliant_cte=0 for
set statement standard_compliant_cte=0 for
with recursive
ancestor_ids (id)
as
Expand Down Expand Up @@ -1156,7 +1156,7 @@ where p.id = a.id
)
select * from ancestors;
ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'ancestor_ids'
set statement standards_compliant_cte=0 for
set statement standard_compliant_cte=0 for
with recursive
ancestor_ids (id, generation)
as
Expand Down
8 changes: 4 additions & 4 deletions mysql-test/r/mysqld--help.result
Original file line number Diff line number Diff line change
Expand Up @@ -1068,9 +1068,9 @@ The following options may be given as the first argument:
NO_ENGINE_SUBSTITUTION, PAD_CHAR_TO_FULL_LENGTH
--stack-trace Print a symbolic stack trace on failure
(Defaults to on; use --skip-stack-trace to disable.)
--standards-compliant-cte
Allow only standards compiant CTE
(Defaults to on; use --skip-standards-compliant-cte to disable.)
--standard-compliant-cte
Allow only CTEs compliant to SQL standard
(Defaults to on; use --skip-standard-compliant-cte to disable.)
--stored-program-cache=#
The soft upper limit for number of cached stored routines
for one connection.
Expand Down Expand Up @@ -1470,7 +1470,7 @@ slow-query-log FALSE
sort-buffer-size 2097152
sql-mode NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
stack-trace TRUE
standards-compliant-cte TRUE
standard-compliant-cte TRUE
stored-program-cache 256
strict-password-validation TRUE
symbolic-links FALSE
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
Original file line number Diff line number Diff line change
Expand Up @@ -3803,14 +3803,14 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME STANDARDS_COMPLIANT_CTE
VARIABLE_NAME STANDARD_COMPLIANT_CTE
SESSION_VALUE ON
GLOBAL_VALUE ON
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE ON
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Allow only standards compiant CTE
VARIABLE_COMMENT Allow only CTEs compliant to SQL standard
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
Original file line number Diff line number Diff line change
Expand Up @@ -4559,14 +4559,14 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME STANDARDS_COMPLIANT_CTE
VARIABLE_NAME STANDARD_COMPLIANT_CTE
SESSION_VALUE ON
GLOBAL_VALUE ON
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE ON
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Allow only standards compiant CTE
VARIABLE_COMMENT Allow only CTEs compliant to SQL standard
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
Expand Down
18 changes: 9 additions & 9 deletions mysql-test/t/cte_recursive.test
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ as
select * from ancestors;


--ERROR ER_NOT_STANDARDS_COMPLIANT_RECURSIVE
--ERROR ER_NOT_STANDARD_COMPLIANT_RECURSIVE
with recursive
ancestor_ids (id, generation)
as
Expand All @@ -805,7 +805,7 @@ as
select generation, name from ancestor_ids a, folks
where a.id = folks.id;

set standards_compliant_cte=0;
set standard_compliant_cte=0;

--ERROR ER_WITH_COL_WRONG_LIST
with recursive
Expand Down Expand Up @@ -844,9 +844,9 @@ as
select generation, name from ancestor_ids a, folks
where a.id = folks.id;

set standards_compliant_cte=1;
set standard_compliant_cte=1;

--ERROR ER_NOT_STANDARDS_COMPLIANT_RECURSIVE
--ERROR ER_NOT_STANDARD_COMPLIANT_RECURSIVE
with recursive
coupled_ancestor_ids (id)
as
Expand All @@ -870,7 +870,7 @@ as
select p.* from coupled_ancestor_ids a, folks p
where a.id = p.id;

set statement standards_compliant_cte=0 for
set statement standard_compliant_cte=0 for
with recursive
coupled_ancestor_ids (id)
as
Expand All @@ -894,7 +894,7 @@ as
select p.* from coupled_ancestor_ids a, folks p
where a.id = p.id;

--ERROR ER_NOT_STANDARDS_COMPLIANT_RECURSIVE
--ERROR ER_NOT_STANDARD_COMPLIANT_RECURSIVE
with recursive
ancestor_ids (id)
as
Expand All @@ -915,7 +915,7 @@ as
)
select * from ancestors;

set statement standards_compliant_cte=0 for
set statement standard_compliant_cte=0 for
with recursive
ancestor_ids (id)
as
Expand Down Expand Up @@ -958,7 +958,7 @@ as
)
select * from ancestors;

--ERROR ER_NOT_STANDARDS_COMPLIANT_RECURSIVE
--ERROR ER_NOT_STANDARD_COMPLIANT_RECURSIVE
with recursive
ancestor_ids (id, generation)
as
Expand All @@ -983,7 +983,7 @@ as
)
select * from ancestors;

set statement standards_compliant_cte=0 for
set statement standard_compliant_cte=0 for
with recursive
ancestor_ids (id, generation)
as
Expand Down
2 changes: 1 addition & 1 deletion sql/share/errmsg-utf8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7355,7 +7355,7 @@ ER_UNACCEPTABLE_MUTUAL_RECURSION
eng "Unacceptable mutual recursion with anchored table '%s'"
ER_REF_TO_RECURSIVE_WITH_TABLE_IN_DERIVED
eng "Reference to recursive WITH table '%s' in materialized derived"
ER_NOT_STANDARDS_COMPLIANT_RECURSIVE
ER_NOT_STANDARD_COMPLIANT_RECURSIVE
eng "Restrictions imposed on recursive definitions are violated for table '%s'"R_WRONG_WINDOW_SPEC_NAME
ER_WRONG_WINDOW_SPEC_NAME
eng "Window specification with name '%s' is not defined"
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ typedef struct system_variables
my_bool old_alter_table;
my_bool old_passwords;
my_bool big_tables;
my_bool only_standards_compliant_cte;
my_bool only_standard_compliant_cte;
my_bool query_cache_strip_comments;
my_bool sql_log_slow;
my_bool sql_log_bin;
Expand Down
6 changes: 3 additions & 3 deletions sql/sql_cte.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ bool TABLE_LIST::is_with_table_recursive_reference()
false otherwise
*/

bool st_select_lex::check_unrestricted_recursive(bool only_standards_compliant)
bool st_select_lex::check_unrestricted_recursive(bool only_standard_compliant)
{
With_element *with_elem= get_with_element();
if (!with_elem ||!with_elem->is_recursive)
Expand Down Expand Up @@ -1077,9 +1077,9 @@ bool st_select_lex::check_unrestricted_recursive(bool only_standards_compliant)
with_elem->get_mutually_recursive());

/* Report an error on unrestricted specification if this is required */
if (only_standards_compliant && with_elem->is_unrestricted())
if (only_standard_compliant && with_elem->is_unrestricted())
{
my_error(ER_NOT_STANDARDS_COMPLIANT_RECURSIVE,
my_error(ER_NOT_STANDARD_COMPLIANT_RECURSIVE,
MYF(0), with_elem->query_name->str);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_lex.h
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ class st_select_lex: public st_select_lex_node
return master_unit()->with_element;
}
With_element *find_table_def_in_with_clauses(TABLE_LIST *table);
bool check_unrestricted_recursive(bool only_standards_compliant);
bool check_unrestricted_recursive(bool only_standard_compliant);
bool check_subqueries_with_recursive_references();
void collect_grouping_fields(THD *thd);
void check_cond_extraction_for_grouping_fields(Item *cond,
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ JOIN::prepare(TABLE_LIST *tables_init,
With_element *with_elem= select_lex->get_with_element();
if (with_elem &&
select_lex->check_unrestricted_recursive(
thd->variables.only_standards_compliant_cte))
thd->variables.only_standard_compliant_cte))
DBUG_RETURN(-1);
select_lex->check_subqueries_with_recursive_references();

Expand Down
8 changes: 4 additions & 4 deletions sql/sys_vars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3186,10 +3186,10 @@ static Sys_var_charptr Sys_ssl_crlpath(
READ_ONLY GLOBAL_VAR(opt_ssl_crlpath), SSL_OPT(OPT_SSL_CRLPATH),
IN_FS_CHARSET, DEFAULT(0));

static Sys_var_mybool Sys_standards_compliant_cte(
"standards_compliant_cte",
"Allow only standards compiant CTE",
SESSION_VAR(only_standards_compliant_cte), CMD_LINE(OPT_ARG),
static Sys_var_mybool Sys_standard_compliant_cte(
"standard_compliant_cte",
"Allow only CTEs compliant to SQL standard",
SESSION_VAR(only_standard_compliant_cte), CMD_LINE(OPT_ARG),
DEFAULT(TRUE));


Expand Down

0 comments on commit 185d140

Please sign in to comment.