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
dde57f08
Commit
dde57f08
authored
Aug 25, 2005
by
andrey@lmy004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for bug #12533 (crash on DESCRIBE <view> after renaming base table column)
parent
a5ecf5f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
7 deletions
+39
-7
mysql-test/r/view.result
mysql-test/r/view.result
+12
-0
mysql-test/t/view.test
mysql-test/t/view.test
+17
-0
sql/sql_show.cc
sql/sql_show.cc
+10
-7
No files found.
mysql-test/r/view.result
View file @
dde57f08
...
@@ -2115,3 +2115,15 @@ CREATE VIEW v1 AS SELECT f1();
...
@@ -2115,3 +2115,15 @@ CREATE VIEW v1 AS SELECT f1();
ERROR HY000: View's SELECT refers to a temporary table 't1'
ERROR HY000: View's SELECT refers to a temporary table 't1'
DROP FUNCTION f1;
DROP FUNCTION f1;
DROP TABLE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
CREATE TABLE t1 (f4 CHAR(5));
CREATE VIEW v1 AS SELECT * FROM t1;
DESCRIBE v1;
Field Type Null Key Default Extra
f4 char(5) YES NULL
ALTER TABLE t1 CHANGE COLUMN f4 f4x CHAR(5);
DESCRIBE v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
DROP TABLE t1;
DROP VIEW v1;
mysql-test/t/view.test
View file @
dde57f08
...
@@ -1966,3 +1966,20 @@ CREATE VIEW v1 AS SELECT f1();
...
@@ -1966,3 +1966,20 @@ CREATE VIEW v1 AS SELECT f1();
DROP
FUNCTION
f1
;
DROP
FUNCTION
f1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# BUG #12533 (crash on DESCRIBE <view> after renaming base table column)
#
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
DROP
VIEW
IF
EXISTS
v1
;
--
enable_warnings
CREATE
TABLE
t1
(
f4
CHAR
(
5
));
CREATE
VIEW
v1
AS
SELECT
*
FROM
t1
;
DESCRIBE
v1
;
ALTER
TABLE
t1
CHANGE
COLUMN
f4
f4x
CHAR
(
5
);
--
error
1356
DESCRIBE
v1
;
DROP
TABLE
t1
;
DROP
VIEW
v1
;
sql/sql_show.cc
View file @
dde57f08
...
@@ -1985,13 +1985,15 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
...
@@ -1985,13 +1985,15 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
lex
->
all_selects_list
=
lsel
;
lex
->
all_selects_list
=
lsel
;
res
=
open_normal_and_derived_tables
(
thd
,
show_table_list
,
res
=
open_normal_and_derived_tables
(
thd
,
show_table_list
,
MYSQL_LOCK_IGNORE_FLUSH
);
MYSQL_LOCK_IGNORE_FLUSH
);
if
(
schema_table
->
process_table
(
thd
,
show_table_list
,
/*
get_all_tables() returns 1 on failure and 0 on success thus
return only these and not the result code of ::process_table()
*/
error
=
test
(
schema_table
->
process_table
(
thd
,
show_table_list
,
table
,
res
,
show_table_list
->
db
,
table
,
res
,
show_table_list
->
db
,
show_table_list
->
alias
))
show_table_list
->
alias
));
goto
err
;
close_thread_tables
(
thd
);
close_thread_tables
(
thd
);
show_table_list
->
table
=
0
;
show_table_list
->
table
=
0
;
error
=
0
;
goto
err
;
goto
err
;
}
}
...
@@ -2090,11 +2092,12 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
...
@@ -2090,11 +2092,12 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
lex
->
derived_tables
=
0
;
lex
->
derived_tables
=
0
;
res
=
open_normal_and_derived_tables
(
thd
,
show_table_list
,
res
=
open_normal_and_derived_tables
(
thd
,
show_table_list
,
MYSQL_LOCK_IGNORE_FLUSH
);
MYSQL_LOCK_IGNORE_FLUSH
);
if
(
schema_table
->
process_table
(
thd
,
show_table_list
,
table
,
res
=
schema_table
->
process_table
(
thd
,
show_table_list
,
table
,
res
,
base_name
,
res
,
base_name
,
show_table_list
->
alias
))
show_table_list
->
alias
);
goto
err
;
close_thread_tables
(
thd
);
close_thread_tables
(
thd
);
if
(
res
)
goto
err
;
}
}
}
}
}
}
...
...
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