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
b8adcb3b
Commit
b8adcb3b
authored
Feb 22, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #7476: crash on SELECT * FROM INFORMATION_SCHEMA.TABLES(after review)
parent
17cca96e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+5
-0
mysql-test/t/information_schema.test
mysql-test/t/information_schema.test
+27
-0
sql/sql_show.cc
sql/sql_show.cc
+6
-2
No files found.
mysql-test/r/information_schema.result
View file @
b8adcb3b
...
...
@@ -610,3 +610,8 @@ create view v1 as select * from t1, t2;
set @got_val= (select count(*) from information_schema.columns);
drop view v1;
drop table t1, t2;
CREATE TABLE t_crashme ( f1 BIGINT);
CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;
CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;
drop view a2, a1;
drop table t_crashme;
mysql-test/t/information_schema.test
View file @
b8adcb3b
...
...
@@ -363,3 +363,30 @@ create view v1 as select * from t1, t2;
set
@
got_val
=
(
select
count
(
*
)
from
information_schema
.
columns
);
drop
view
v1
;
drop
table
t1
,
t2
;
#
# Bug #7476: crash on SELECT * FROM INFORMATION_SCHEMA.TABLES
#
CREATE
TABLE
t_crashme
(
f1
BIGINT
);
CREATE
VIEW
a1
(
t_CRASHME
)
AS
SELECT
f1
FROM
t_crashme
GROUP
BY
f1
;
CREATE
VIEW
a2
AS
SELECT
t_CRASHME
FROM
a1
;
let
$tab_count
=
65
;
--
disable_query_log
while
(
$tab_count
)
{
EVAL
CREATE
TABLE
t_
$tab_count
(
f1
BIGINT
);
dec
$tab_count
;
}
--
disable_result_log
SELECT
TABLE_NAME
FROM
INFORMATION_SCHEMA
.
TABLES
;
--
enable_result_log
let
$tab_count
=
65
;
while
(
$tab_count
)
{
EVAL
DROP
TABLE
t_
$tab_count
;
dec
$tab_count
;
}
--
enable_query_log
drop
view
a2
,
a1
;
drop
table
t_crashme
;
sql/sql_show.cc
View file @
b8adcb3b
...
...
@@ -1778,6 +1778,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
LEX
*
lex
=
thd
->
lex
;
TABLE
*
table
=
tables
->
table
;
SELECT_LEX
*
select_lex
=
&
lex
->
select_lex
;
SELECT_LEX
*
old_all_select_lex
=
lex
->
all_selects_list
;
SELECT_LEX
*
lsel
=
tables
->
schema_select_lex
;
ST_SCHEMA_TABLE
*
schema_table
=
tables
->
schema_table
;
SELECT_LEX
sel
;
...
...
@@ -1790,6 +1791,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
List
<
char
>
bases
;
List_iterator_fast
<
char
>
it
(
bases
);
COND
*
partial_cond
;
uint
derived_tables
=
lex
->
derived_tables
;
int
error
=
1
;
DBUG_ENTER
(
"get_all_tables"
);
...
...
@@ -1814,7 +1816,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
goto
err
;
}
lex
->
all_selects_list
=
&
sel
;
schema_table_idx
=
get_schema_table_idx
(
schema_table
);
lock_type
=
TL_UNLOCK
;
...
...
@@ -1911,6 +1912,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
goto
err
;
TABLE_LIST
*
show_table_list
=
(
TABLE_LIST
*
)
sel
.
table_list
.
first
;
show_table_list
->
lock_type
=
lock_type
;
lex
->
all_selects_list
=
&
sel
;
lex
->
derived_tables
=
0
;
res
=
open_and_lock_tables
(
thd
,
show_table_list
);
if
(
schema_table
->
process_table
(
thd
,
show_table_list
,
table
,
res
,
base_name
,
...
...
@@ -1930,7 +1933,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
error
=
0
;
err:
lex
->
all_selects_list
=
select_lex
;
lex
->
derived_tables
=
derived_tables
;
lex
->
all_selects_list
=
old_all_select_lex
;
DBUG_RETURN
(
error
);
}
...
...
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