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
9bcb24b6
Commit
9bcb24b6
authored
18 years ago
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0-runtime
into mysql.com:/home/jimw/my/mysql-5.0-18005
parents
73eb784b
5d2c0de5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
1 deletion
+46
-1
mysql-test/r/trigger.result
mysql-test/r/trigger.result
+12
-0
mysql-test/t/trigger.test
mysql-test/t/trigger.test
+23
-1
sql/share/errmsg.txt
sql/share/errmsg.txt
+2
-0
sql/sql_trigger.cc
sql/sql_trigger.cc
+9
-0
No files found.
mysql-test/r/trigger.result
View file @
9bcb24b6
...
...
@@ -1078,3 +1078,15 @@ i1
43
51
DROP TABLE t1;
create trigger wont_work after update on mysql.user for each row
begin
set @a:= 1;
end|
ERROR HY000: Triggers can not be created on system tables
use mysql|
create trigger wont_work after update on event for each row
begin
set @a:= 1;
end|
ERROR HY000: Triggers can not be created on system tables
End of 5.0 tests
This diff is collapsed.
Click to expand it.
mysql-test/t/trigger.test
View file @
9bcb24b6
...
...
@@ -1281,4 +1281,26 @@ SELECT * FROM t1;
DROP
TABLE
t1
;
# End of 5.0 tests
#
# Bug #18005: Creating a trigger on mysql.event leads to server crash on
# scheduler startup
#
# Bug #18361: Triggers on mysql.user table cause server crash
#
# We don't allow triggers on the mysql schema
delimiter
|
;
--
error
ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA
create
trigger
wont_work
after
update
on
mysql
.
user
for
each
row
begin
set
@
a
:=
1
;
end
|
# Try when we're already using the mysql schema
use
mysql
|
--error ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA
create trigger wont_work after update on event for each row
begin
set @a:= 1
;
end
|
delimiter
;
|
--
echo
End
of
5.0
tests
This diff is collapsed.
Click to expand it.
sql/share/errmsg.txt
View file @
9bcb24b6
...
...
@@ -5619,3 +5619,5 @@ ER_NON_GROUPING_FIELD_USED 42000
eng "non-grouping field '%-.64s' is used in %-.64s clause"
ER_TABLE_CANT_HANDLE_SPKEYS
eng "The used table type doesn't support SPATIAL indexes"
ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA
eng "Triggers can not be created on system tables"
This diff is collapsed.
Click to expand it.
sql/sql_trigger.cc
View file @
9bcb24b6
...
...
@@ -183,6 +183,15 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
!
(
tables
=
add_table_for_trigger
(
thd
,
thd
->
lex
->
spname
)))
DBUG_RETURN
(
TRUE
);
/*
We don't allow creating triggers on tables in the 'mysql' schema
*/
if
(
create
&&
!
my_strcasecmp
(
system_charset_info
,
"mysql"
,
tables
->
db
))
{
my_error
(
ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
/* We should have only one table in table list. */
DBUG_ASSERT
(
tables
->
next_global
==
0
);
...
...
This diff is collapsed.
Click to expand it.
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