mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Fix for Bug#34337: Server crash when Altering a view using
a table name. The problem was that fill_defined_view_parts() did not return an error if a table is going to be altered. That happened if the table was already in the table cache. In that case, open_table() returned non-NULL value (valid TABLE-instance from the cache). The fix is to ensure that an error is thrown even if the table is in the cache. (This is a backport of the original patch for 5.1) mysql-test/r/view.result: Fix result file. mysql-test/r/view_grant.result: Fix result file. mysql-test/t/view.test: Add a test case for Bug#34337: Server crash when Altering a view using a table name. mysql-test/t/view_grant.test: Fix order-dependency. sql/sql_view.cc: Report an error if we're going to work with a table.
This commit is contained in:
parent
d34f8384b3
commit
fa08b28085
5 changed files with 83 additions and 5 deletions
|
|
@ -3470,5 +3470,39 @@ insert into v1 values(1);
|
|||
set @@sql_mode=@old_mode;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
###########################################################################
|
||||
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo # -- Bug#34337: Server crash when Altering a view using a table name.
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
|
||||
CREATE TABLE t1(c1 INT);
|
||||
|
||||
--echo
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
--error ER_WRONG_OBJECT
|
||||
ALTER ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW t1 (c2) AS SELECT (1);
|
||||
|
||||
--echo
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo
|
||||
--echo # -- End of test case for Bug#34337.
|
||||
--echo
|
||||
|
||||
###########################################################################
|
||||
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo # -- End of 5.0 tests.
|
||||
--echo # -----------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue