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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
74438f31
Commit
74438f31
authored
Jul 22, 2006
by
igor@olga.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into olga.mysql.com:/home/igor/mysql-5.0-opt
parents
3cd67802
66ecb7df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
0 deletions
+96
-0
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+62
-0
mysql-test/t/information_schema.test
mysql-test/t/information_schema.test
+33
-0
sql/sql_show.cc
sql/sql_show.cc
+1
-0
No files found.
mysql-test/r/information_schema.result
View file @
74438f31
...
@@ -1170,3 +1170,65 @@ f1()
...
@@ -1170,3 +1170,65 @@ f1()
DROP FUNCTION f1;
DROP FUNCTION f1;
DROP PROCEDURE p1;
DROP PROCEDURE p1;
DROP USER mysql_bug20230@localhost;
DROP USER mysql_bug20230@localhost;
SELECT t.table_name, c1.column_name
FROM information_schema.tables t
INNER JOIN
information_schema.columns c1
ON t.table_schema = c1.table_schema AND
t.table_name = c1.table_name
WHERE t.table_schema = 'information_schema' AND
c1.ordinal_position =
( SELECT COALESCE(MIN(c2.ordinal_position),1)
FROM information_schema.columns c2
WHERE c2.table_schema = t.table_schema AND
c2.table_name = t.table_name AND
c2.column_name LIKE '%SCHEMA%'
);
table_name column_name
CHARACTER_SETS CHARACTER_SET_NAME
COLLATIONS COLLATION_NAME
COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
COLUMNS TABLE_SCHEMA
COLUMN_PRIVILEGES TABLE_SCHEMA
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
ROUTINES ROUTINE_SCHEMA
SCHEMATA SCHEMA_NAME
SCHEMA_PRIVILEGES TABLE_SCHEMA
STATISTICS TABLE_SCHEMA
TABLES TABLE_SCHEMA
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
TABLE_PRIVILEGES TABLE_SCHEMA
TRIGGERS TRIGGER_SCHEMA
USER_PRIVILEGES GRANTEE
VIEWS TABLE_SCHEMA
SELECT t.table_name, c1.column_name
FROM information_schema.tables t
INNER JOIN
information_schema.columns c1
ON t.table_schema = c1.table_schema AND
t.table_name = c1.table_name
WHERE t.table_schema = 'information_schema' AND
c1.ordinal_position =
( SELECT COALESCE(MIN(c2.ordinal_position),1)
FROM information_schema.columns c2
WHERE c2.table_schema = 'information_schema' AND
c2.table_name = t.table_name AND
c2.column_name LIKE '%SCHEMA%'
);
table_name column_name
CHARACTER_SETS CHARACTER_SET_NAME
COLLATIONS COLLATION_NAME
COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
COLUMNS TABLE_SCHEMA
COLUMN_PRIVILEGES TABLE_SCHEMA
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
ROUTINES ROUTINE_SCHEMA
SCHEMATA SCHEMA_NAME
SCHEMA_PRIVILEGES TABLE_SCHEMA
STATISTICS TABLE_SCHEMA
TABLES TABLE_SCHEMA
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
TABLE_PRIVILEGES TABLE_SCHEMA
TRIGGERS TRIGGER_SCHEMA
USER_PRIVILEGES GRANTEE
VIEWS TABLE_SCHEMA
mysql-test/t/information_schema.test
View file @
74438f31
...
@@ -887,4 +887,37 @@ DROP FUNCTION f1;
...
@@ -887,4 +887,37 @@ DROP FUNCTION f1;
DROP
PROCEDURE
p1
;
DROP
PROCEDURE
p1
;
DROP
USER
mysql_bug20230
@
localhost
;
DROP
USER
mysql_bug20230
@
localhost
;
#
# Bug#18925: subqueries with MIN/MAX functions on INFORMARTION_SCHEMA
#
SELECT
t
.
table_name
,
c1
.
column_name
FROM
information_schema
.
tables
t
INNER
JOIN
information_schema
.
columns
c1
ON
t
.
table_schema
=
c1
.
table_schema
AND
t
.
table_name
=
c1
.
table_name
WHERE
t
.
table_schema
=
'information_schema'
AND
c1
.
ordinal_position
=
(
SELECT
COALESCE
(
MIN
(
c2
.
ordinal_position
),
1
)
FROM
information_schema
.
columns
c2
WHERE
c2
.
table_schema
=
t
.
table_schema
AND
c2
.
table_name
=
t
.
table_name
AND
c2
.
column_name
LIKE
'%SCHEMA%'
);
SELECT
t
.
table_name
,
c1
.
column_name
FROM
information_schema
.
tables
t
INNER
JOIN
information_schema
.
columns
c1
ON
t
.
table_schema
=
c1
.
table_schema
AND
t
.
table_name
=
c1
.
table_name
WHERE
t
.
table_schema
=
'information_schema'
AND
c1
.
ordinal_position
=
(
SELECT
COALESCE
(
MIN
(
c2
.
ordinal_position
),
1
)
FROM
information_schema
.
columns
c2
WHERE
c2
.
table_schema
=
'information_schema'
AND
c2
.
table_name
=
t
.
table_name
AND
c2
.
column_name
LIKE
'%SCHEMA%'
);
# End of 5.0 tests.
# End of 5.0 tests.
sql/sql_show.cc
View file @
74438f31
...
@@ -3963,6 +3963,7 @@ bool get_schema_tables_result(JOIN *join)
...
@@ -3963,6 +3963,7 @@ bool get_schema_tables_result(JOIN *join)
table_list
->
table
->
file
->
delete_all_rows
();
table_list
->
table
->
file
->
delete_all_rows
();
free_io_cache
(
table_list
->
table
);
free_io_cache
(
table_list
->
table
);
filesort_free_buffers
(
table_list
->
table
);
filesort_free_buffers
(
table_list
->
table
);
table_list
->
table
->
null_row
=
0
;
}
}
else
else
table_list
->
table
->
file
->
records
=
0
;
table_list
->
table
->
file
->
records
=
0
;
...
...
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