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
ef5cafdf
Commit
ef5cafdf
authored
Aug 16, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.0
into lmy004.wdf.sap.corp:/work/mysql-5.0-clean
parents
5082c41b
1566ec35
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
6 deletions
+69
-6
mysql-test/r/show_check.result
mysql-test/r/show_check.result
+43
-0
mysql-test/t/show_check.test
mysql-test/t/show_check.test
+18
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-1
sql/sql_base.cc
sql/sql_base.cc
+5
-4
sql/sql_show.cc
sql/sql_show.cc
+2
-1
No files found.
mysql-test/r/show_check.result
View file @
ef5cafdf
...
...
@@ -512,3 +512,46 @@ t1 CREATE TABLE `t1` (
KEY `c2` USING BTREE (`c2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE txt1(a int);
CREATE TABLE tyt2(a int);
CREATE TABLE urkunde(a int);
FLUSH TABLES;
SELECT 1 FROM mysql.db, mysql.proc, mysql.user, mysql.time_zone, mysql.time_zone_name, txt1, tyt2, urkunde LIMIT 0;
1
SHOW OPEN TABLES;
Database Table In_use Name_locked
mysql db 0 0
test urkunde 0 0
mysql time_zone 0 0
mysql user 0 0
test txt1 0 0
mysql proc 0 0
test tyt2 0 0
mysql time_zone_name 0 0
SHOW OPEN TABLES FROM mysql;
Database Table In_use Name_locked
mysql db 0 0
mysql time_zone 0 0
mysql user 0 0
mysql proc 0 0
mysql time_zone_name 0 0
SHOW OPEN TABLES FROM mysql LIKE 'u%';
Database Table In_use Name_locked
mysql user 0 0
SHOW OPEN TABLES LIKE 't%';
Database Table In_use Name_locked
mysql time_zone 0 0
test txt1 0 0
test tyt2 0 0
mysql time_zone_name 0 0
SHOW OPEN TABLES LIKE '%o%';
Database Table In_use Name_locked
mysql time_zone 0 0
mysql proc 0 0
mysql time_zone_name 0 0
FLUSH TABLES;
SHOW OPEN TABLES;
Database Table In_use Name_locked
DROP TABLE txt1;
DROP TABLE tyt2;
DROP TABLE urkunde;
mysql-test/t/show_check.test
View file @
ef5cafdf
...
...
@@ -387,3 +387,21 @@ SHOW CREATE TABLE t1;
DROP
TABLE
t1
;
# End of 4.1 tests
#
# BUG 12183 - SHOW OPEN TABLES behavior doesn't match grammar
# First we close all open tables with FLUSH tables and then we open some.
CREATE
TABLE
txt1
(
a
int
);
CREATE
TABLE
tyt2
(
a
int
);
CREATE
TABLE
urkunde
(
a
int
);
FLUSH
TABLES
;
SELECT
1
FROM
mysql
.
db
,
mysql
.
proc
,
mysql
.
user
,
mysql
.
time_zone
,
mysql
.
time_zone_name
,
txt1
,
tyt2
,
urkunde
LIMIT
0
;
SHOW
OPEN
TABLES
;
SHOW
OPEN
TABLES
FROM
mysql
;
SHOW
OPEN
TABLES
FROM
mysql
LIKE
'u%'
;
SHOW
OPEN
TABLES
LIKE
't%'
;
SHOW
OPEN
TABLES
LIKE
'%o%'
;
FLUSH
TABLES
;
SHOW
OPEN
TABLES
;
DROP
TABLE
txt1
;
DROP
TABLE
tyt2
;
DROP
TABLE
urkunde
;
sql/mysql_priv.h
View file @
ef5cafdf
...
...
@@ -981,7 +981,7 @@ bool fill_record_n_invoke_before_triggers(THD *thd, Field **field,
bool
ignore_errors
,
Table_triggers_list
*
triggers
,
enum
trg_event_type
event
);
OPEN_TABLE_LIST
*
list_open_tables
(
THD
*
thd
,
const
char
*
wild
);
OPEN_TABLE_LIST
*
list_open_tables
(
THD
*
thd
,
const
char
*
db
,
const
char
*
wild
);
inline
TABLE_LIST
*
find_table_in_global_list
(
TABLE_LIST
*
table
,
const
char
*
db_name
,
...
...
sql/sql_base.cc
View file @
ef5cafdf
...
...
@@ -129,12 +129,11 @@ static void check_unused(void)
# Pointer to list of names of open tables.
*/
OPEN_TABLE_LIST
*
list_open_tables
(
THD
*
thd
,
const
char
*
wild
)
OPEN_TABLE_LIST
*
list_open_tables
(
THD
*
thd
,
const
char
*
db
,
const
char
*
wild
)
{
int
result
=
0
;
OPEN_TABLE_LIST
**
start_list
,
*
open_list
;
TABLE_LIST
table_list
;
char
name
[
NAME_LEN
*
2
];
DBUG_ENTER
(
"list_open_tables"
);
VOID
(
pthread_mutex_lock
(
&
LOCK_open
));
...
...
@@ -151,10 +150,12 @@ OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *wild)
DBUG_ASSERT
(
share
->
table_name
!=
0
);
if
((
!
share
->
table_name
))
// To be removed
continue
;
// Shouldn't happen
if
(
db
&&
my_strcasecmp
(
system_charset_info
,
db
,
share
->
table_cache_key
))
continue
;
if
(
wild
)
{
strxmov
(
name
,
share
->
table_cache_key
,
"."
,
share
->
table_name
,
NullS
);
if
(
wild_compare
(
name
,
wild
,
0
))
if
(
wild_compare
(
share
->
table_name
,
wild
,
0
))
continue
;
}
...
...
sql/sql_show.cc
View file @
ef5cafdf
...
...
@@ -3189,7 +3189,8 @@ int fill_open_tables(THD *thd, TABLE_LIST *tables, COND *cond)
TABLE
*
table
=
tables
->
table
;
CHARSET_INFO
*
cs
=
system_charset_info
;
OPEN_TABLE_LIST
*
open_list
;
if
(
!
(
open_list
=
list_open_tables
(
thd
,
wild
))
&&
thd
->
is_fatal_error
)
if
(
!
(
open_list
=
list_open_tables
(
thd
,
thd
->
lex
->
select_lex
.
db
,
wild
))
&&
thd
->
is_fatal_error
)
DBUG_RETURN
(
1
);
for
(;
open_list
;
open_list
=
open_list
->
next
)
...
...
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