Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4db4b773
Commit
4db4b773
authored
Jul 31, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.3 into 10.4
parents
70d4500c
a8458a23
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
140 additions
and
1 deletion
+140
-1
mysql-test/main/information_schema.result
mysql-test/main/information_schema.result
+69
-0
mysql-test/main/information_schema.test
mysql-test/main/information_schema.test
+62
-0
mysql-test/suite/innodb/r/truncate_foreign.result
mysql-test/suite/innodb/r/truncate_foreign.result
+1
-0
mysql-test/suite/innodb/t/truncate_foreign.test
mysql-test/suite/innodb/t/truncate_foreign.test
+1
-0
sql/sql_parse.cc
sql/sql_parse.cc
+2
-0
sql/sql_show.cc
sql/sql_show.cc
+4
-1
sql/table.h
sql/table.h
+1
-0
No files found.
mysql-test/main/information_schema.result
View file @
4db4b773
...
@@ -2218,3 +2218,72 @@ SCHEMA_NAME
...
@@ -2218,3 +2218,72 @@ SCHEMA_NAME
#
#
# End of 10.1 tests
# End of 10.1 tests
#
#
#
# MDEV-21201:No records produced in information_schema query,
# depending on projection
#
create table t (i int, constraint a check (i > 0));
select
tc.TABLE_SCHEMA,
tc.TABLE_NAME,
cc.CONSTRAINT_NAME,
cc.CHECK_CLAUSE
from information_schema.TABLE_CONSTRAINTS tc
join information_schema.CHECK_CONSTRAINTS cc
using (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME)
;
TABLE_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
test t a `i` > 0
mysql global_priv Priv json_valid(`Priv`)
select
tc.TABLE_SCHEMA,
tc.TABLE_NAME,
cc.CONSTRAINT_NAME,
cc.CHECK_CLAUSE
from information_schema.CHECK_CONSTRAINTS cc
join information_schema.TABLE_CONSTRAINTS tc
using (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME)
;
TABLE_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
test t a `i` > 0
mysql global_priv Priv json_valid(`Priv`)
select
tc.TABLE_SCHEMA,
tc.TABLE_NAME,
cc.CONSTRAINT_NAME,
cc.CHECK_CLAUSE
from information_schema.TABLE_CONSTRAINTS tc
NATURAL join information_schema.CHECK_CONSTRAINTS cc
;
TABLE_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
test t a `i` > 0
mysql global_priv Priv json_valid(`Priv`)
select
tc.TABLE_SCHEMA,
tc.TABLE_NAME,
cc.CONSTRAINT_NAME,
cc.CHECK_CLAUSE
from information_schema.CHECK_CONSTRAINTS cc
NATURAL join information_schema.TABLE_CONSTRAINTS tc
;
TABLE_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
test t a `i` > 0
mysql global_priv Priv json_valid(`Priv`)
select
tc.TABLE_SCHEMA,
tc.TABLE_NAME,
cc.CONSTRAINT_NAME,
cc.CHECK_CLAUSE,
tc.CONSTRAINT_CATALOG,
tc.CONSTRAINT_SCHEMA
from information_schema.TABLE_CONSTRAINTS tc
join information_schema.CHECK_CONSTRAINTS cc
using (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME)
;
TABLE_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE CONSTRAINT_CATALOG CONSTRAINT_SCHEMA
test t a `i` > 0 def test
mysql global_priv Priv json_valid(`Priv`) def mysql
drop table t;
#
# End of 10.3 tests
#
mysql-test/main/information_schema.test
View file @
4db4b773
...
@@ -1923,3 +1923,65 @@ SELECT SCHEMA_NAME from information_schema.schemata where schema_name=REPEAT('a'
...
@@ -1923,3 +1923,65 @@ SELECT SCHEMA_NAME from information_schema.schemata where schema_name=REPEAT('a'
--
echo
#
--
echo
#
--
echo
# End of 10.1 tests
--
echo
# End of 10.1 tests
--
echo
#
--
echo
#
--
echo
#
--
echo
# MDEV-21201:No records produced in information_schema query,
--
echo
# depending on projection
--
echo
#
create
table
t
(
i
int
,
constraint
a
check
(
i
>
0
));
--
disable_warnings
select
tc
.
TABLE_SCHEMA
,
tc
.
TABLE_NAME
,
cc
.
CONSTRAINT_NAME
,
cc
.
CHECK_CLAUSE
from
information_schema
.
TABLE_CONSTRAINTS
tc
join
information_schema
.
CHECK_CONSTRAINTS
cc
using
(
CONSTRAINT_CATALOG
,
CONSTRAINT_SCHEMA
,
TABLE_NAME
,
CONSTRAINT_NAME
)
;
select
tc
.
TABLE_SCHEMA
,
tc
.
TABLE_NAME
,
cc
.
CONSTRAINT_NAME
,
cc
.
CHECK_CLAUSE
from
information_schema
.
CHECK_CONSTRAINTS
cc
join
information_schema
.
TABLE_CONSTRAINTS
tc
using
(
CONSTRAINT_CATALOG
,
CONSTRAINT_SCHEMA
,
TABLE_NAME
,
CONSTRAINT_NAME
)
;
select
tc
.
TABLE_SCHEMA
,
tc
.
TABLE_NAME
,
cc
.
CONSTRAINT_NAME
,
cc
.
CHECK_CLAUSE
from
information_schema
.
TABLE_CONSTRAINTS
tc
NATURAL
join
information_schema
.
CHECK_CONSTRAINTS
cc
;
select
tc
.
TABLE_SCHEMA
,
tc
.
TABLE_NAME
,
cc
.
CONSTRAINT_NAME
,
cc
.
CHECK_CLAUSE
from
information_schema
.
CHECK_CONSTRAINTS
cc
NATURAL
join
information_schema
.
TABLE_CONSTRAINTS
tc
;
select
tc
.
TABLE_SCHEMA
,
tc
.
TABLE_NAME
,
cc
.
CONSTRAINT_NAME
,
cc
.
CHECK_CLAUSE
,
tc
.
CONSTRAINT_CATALOG
,
tc
.
CONSTRAINT_SCHEMA
from
information_schema
.
TABLE_CONSTRAINTS
tc
join
information_schema
.
CHECK_CONSTRAINTS
cc
using
(
CONSTRAINT_CATALOG
,
CONSTRAINT_SCHEMA
,
TABLE_NAME
,
CONSTRAINT_NAME
)
;
--
enable_warnings
drop
table
t
;
--
echo
#
--
echo
# End of 10.3 tests
--
echo
#
mysql-test/suite/innodb/r/truncate_foreign.result
View file @
4db4b773
...
@@ -29,6 +29,7 @@ SET DEBUG_SYNC='foreign_constraint_check_for_update SIGNAL fk WAIT_FOR go';
...
@@ -29,6 +29,7 @@ SET DEBUG_SYNC='foreign_constraint_check_for_update SIGNAL fk WAIT_FOR go';
DELETE FROM parent;
DELETE FROM parent;
connection default;
connection default;
SET DEBUG_SYNC='now WAIT_FOR fk';
SET DEBUG_SYNC='now WAIT_FOR fk';
SET lock_wait_timeout=1;
TRUNCATE TABLE child;
TRUNCATE TABLE child;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC='now SIGNAL go';
SET DEBUG_SYNC='now SIGNAL go';
...
...
mysql-test/suite/innodb/t/truncate_foreign.test
View file @
4db4b773
...
@@ -37,6 +37,7 @@ send DELETE FROM parent;
...
@@ -37,6 +37,7 @@ send DELETE FROM parent;
connection
default
;
connection
default
;
SET
DEBUG_SYNC
=
'now WAIT_FOR fk'
;
SET
DEBUG_SYNC
=
'now WAIT_FOR fk'
;
SET
lock_wait_timeout
=
1
;
--
error
ER_LOCK_WAIT_TIMEOUT
--
error
ER_LOCK_WAIT_TIMEOUT
TRUNCATE
TABLE
child
;
TRUNCATE
TABLE
child
;
SET
DEBUG_SYNC
=
'now SIGNAL go'
;
SET
DEBUG_SYNC
=
'now SIGNAL go'
;
...
...
sql/sql_parse.cc
View file @
4db4b773
...
@@ -8991,6 +8991,8 @@ void add_join_natural(TABLE_LIST *a, TABLE_LIST *b, List<String> *using_fields,
...
@@ -8991,6 +8991,8 @@ void add_join_natural(TABLE_LIST *a, TABLE_LIST *b, List<String> *using_fields,
SELECT_LEX
*
lex
)
SELECT_LEX
*
lex
)
{
{
b
->
natural_join
=
a
;
b
->
natural_join
=
a
;
a
->
part_of_natural_join
=
TRUE
;
b
->
part_of_natural_join
=
TRUE
;
lex
->
prev_join_using
=
using_fields
;
lex
->
prev_join_using
=
using_fields
;
}
}
...
...
sql/sql_show.cc
View file @
4db4b773
...
@@ -8230,6 +8230,9 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
...
@@ -8230,6 +8230,9 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
else
else
all_items
=
thd
->
free_list
;
all_items
=
thd
->
free_list
;
if
(
table_list
->
part_of_natural_join
)
bitmap_set_all
(
&
bitmap
);
else
mark_all_fields_used_in_query
(
thd
,
fields_info
,
&
bitmap
,
all_items
);
mark_all_fields_used_in_query
(
thd
,
fields_info
,
&
bitmap
,
all_items
);
for
(
field_count
=
0
;
fields_info
->
field_name
;
fields_info
++
)
for
(
field_count
=
0
;
fields_info
->
field_name
;
fields_info
++
)
...
...
sql/table.h
View file @
4db4b773
...
@@ -2267,6 +2267,7 @@ struct TABLE_LIST
...
@@ -2267,6 +2267,7 @@ struct TABLE_LIST
parsing 'this' is a NATURAL/USING join iff (natural_join != NULL).
parsing 'this' is a NATURAL/USING join iff (natural_join != NULL).
*/
*/
TABLE_LIST
*
natural_join
;
TABLE_LIST
*
natural_join
;
bool
part_of_natural_join
;
/*
/*
True if 'this' represents a nested join that is a NATURAL JOIN.
True if 'this' represents a nested join that is a NATURAL JOIN.
For one of the operands of 'this', the member 'natural_join' points
For one of the operands of 'this', the member 'natural_join' points
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment