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
e1afce06
Commit
e1afce06
authored
Apr 03, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-multi-5.0
parents
b978c663
690ebd81
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
1 deletion
+52
-1
mysql-test/r/trigger.result
mysql-test/r/trigger.result
+16
-0
mysql-test/t/trigger.test
mysql-test/t/trigger.test
+20
-0
sql/handler.cc
sql/handler.cc
+1
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_table.cc
sql/sql_table.cc
+12
-0
sql/sql_trigger.cc
sql/sql_trigger.cc
+2
-1
No files found.
mysql-test/r/trigger.result
View file @
e1afce06
drop table if exists t1, t2;
drop view if exists v1;
drop database if exists mysqltest;
create table t1 (i int);
create trigger trg before insert on t1 for each row set @a:=1;
set @a:=0;
...
...
@@ -190,3 +191,18 @@ select @del_before, @del_after;
drop trigger t1.trg1;
drop trigger t1.trg2;
drop table t1;
create table t1 (a int);
create trigger trg1 before insert on t1 for each row set new.a= 10;
drop table t1;
create table t1 (a int);
insert into t1 values ();
select * from t1;
a
NULL
drop table t1;
create database mysqltest;
use mysqltest;
create table t1 (i int);
create trigger trg1 before insert on t1 for each row set @a:= 1;
drop database mysqltest;
use test;
mysql-test/t/trigger.test
View file @
e1afce06
...
...
@@ -5,6 +5,7 @@
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
drop
view
if
exists
v1
;
drop
database
if
exists
mysqltest
;
--
enable_warnings
create
table
t1
(
i
int
);
...
...
@@ -229,3 +230,22 @@ select @del_before, @del_after;
drop
trigger
t1
.
trg1
;
drop
trigger
t1
.
trg2
;
drop
table
t1
;
# Test for bug #5859 "DROP TABLE does not drop triggers". Trigger should not
# magically reappear when we recreate dropped table.
create
table
t1
(
a
int
);
create
trigger
trg1
before
insert
on
t1
for
each
row
set
new
.
a
=
10
;
drop
table
t1
;
create
table
t1
(
a
int
);
insert
into
t1
values
();
select
*
from
t1
;
drop
table
t1
;
# Test for bug #6559 "DROP DATABASE forgets to drop triggers".
create
database
mysqltest
;
use
mysqltest
;
create
table
t1
(
i
int
);
create
trigger
trg1
before
insert
on
t1
for
each
row
set
@
a
:=
1
;
# This should succeed
drop
database
mysqltest
;
use
test
;
sql/handler.cc
View file @
e1afce06
...
...
@@ -2367,6 +2367,7 @@ TYPELIB *ha_known_exts(void)
known_extensions_id
=
mysys_usage_id
;
found_exts
.
push_back
((
char
*
)
".db"
);
found_exts
.
push_back
((
char
*
)
triggers_file_ext
);
for
(
types
=
sys_table_types
;
types
->
type
;
types
++
)
{
if
(
*
types
->
value
==
SHOW_OPTION_YES
)
...
...
sql/mysql_priv.h
View file @
e1afce06
...
...
@@ -1044,6 +1044,7 @@ extern const char *first_keyword, *my_localhost, *delayed_user, *binary_keyword;
extern
const
char
**
errmesg
;
/* Error messages */
extern
const
char
*
myisam_recover_options_str
;
extern
const
char
*
in_left_expr_name
,
*
in_additional_cond
;
extern
const
char
*
const
triggers_file_ext
;
extern
Eq_creator
eq_creator
;
extern
Ne_creator
ne_creator
;
extern
Gt_creator
gt_creator
;
...
...
sql/sql_table.cc
View file @
e1afce06
...
...
@@ -257,7 +257,19 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
/* Delete the table definition file */
strmov
(
end
,
reg_ext
);
if
(
!
(
new_error
=
my_delete
(
path
,
MYF
(
MY_WME
))))
{
some_tables_deleted
=
1
;
/*
Destroy triggers for this table if there are any.
We won't need this as soon as we will have new .FRM format,
in which we will store trigger definitions in the same .FRM
files as table descriptions.
*/
strmov
(
end
,
triggers_file_ext
);
if
(
!
access
(
path
,
F_OK
))
new_error
=
my_delete
(
path
,
MYF
(
MY_WME
));
}
error
|=
new_error
;
}
}
...
...
sql/sql_trigger.cc
View file @
e1afce06
...
...
@@ -4,7 +4,8 @@
#include "parse_file.h"
static
const
LEX_STRING
triggers_file_type
=
{(
char
*
)
"TRIGGERS"
,
8
};
static
const
char
*
const
triggers_file_ext
=
".TRG"
;
const
char
*
const
triggers_file_ext
=
".TRG"
;
/*
Table of .TRG file field descriptors.
...
...
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