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
86882cc8
Commit
86882cc8
authored
Sep 14, 2005
by
elliot@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/emurphy/src/work/mysql-5.0-bug-12870
into mysql.com:/home/emurphy/src/bk-clean/mysql-5.0
parents
a42b5000
8e7e1716
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
243 additions
and
1 deletion
+243
-1
mysql-test/r/rpl_ddl.result
mysql-test/r/rpl_ddl.result
+182
-0
mysql-test/t/rpl_ddl.test
mysql-test/t/rpl_ddl.test
+52
-1
sql/sql_parse.cc
sql/sql_parse.cc
+9
-0
No files found.
mysql-test/r/rpl_ddl.result
View file @
86882cc8
...
...
@@ -1072,6 +1072,188 @@ Database (mysqltest3)
mysqltest3
-------- switch to master -------
######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1" ########
-------- switch to master -------
INSERT INTO t1 SET f1= 15 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
16
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
15
-------- switch to master -------
CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
SELECT MAX(f1) FROM t1;
MAX(f1)
16
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
16
-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
16
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
16
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master -------
SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1
Name p1
Type PROCEDURE
Definer root@localhost
Modified #
Created #
Security_type DEFINER
Comment
-------- switch to slave -------
SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1
Name p1
Type PROCEDURE
Definer @
Modified #
Created #
Security_type DEFINER
Comment
######## ALTER PROCEDURE p1 COMMENT "I have been altered" ########
-------- switch to master -------
INSERT INTO t1 SET f1= 16 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
17
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
16
-------- switch to master -------
ALTER PROCEDURE p1 COMMENT "I have been altered";
SELECT MAX(f1) FROM t1;
MAX(f1)
17
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
17
-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
17
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
17
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master -------
SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1
Name p1
Type PROCEDURE
Definer root@localhost
Modified #
Created #
Security_type DEFINER
Comment I have been altered
-------- switch to slave -------
SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1
Name p1
Type PROCEDURE
Definer @
Modified #
Created #
Security_type DEFINER
Comment I have been altered
######## DROP PROCEDURE p1 ########
-------- switch to master -------
INSERT INTO t1 SET f1= 17 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
18
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
17
-------- switch to master -------
DROP PROCEDURE p1;
SELECT MAX(f1) FROM t1;
MAX(f1)
18
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
18
-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
18
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
18
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-------- switch to master -------
flush logs;
-------- switch to slave --------
flush logs;
-------- switch to master -------
SHOW PROCEDURE STATUS LIKE 'p1';
-------- switch to slave -------
SHOW PROCEDURE STATUS LIKE 'p1';
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
mysql-test/t/rpl_ddl.test
View file @
86882cc8
...
...
@@ -340,6 +340,57 @@ connection master;
SELECT
'-------- switch to master -------'
as
""
;
--
enable_query_log
# End of 4.1 tests
###############################################################
# Cases with stored procedures
###############################################################
let
$my_stmt
=
CREATE
PROCEDURE
p1
()
READS
SQL
DATA
SELECT
"this is p1"
;
let
$my_master_commit
=
true
;
let
$my_slave_commit
=
true
;
--
source
include
/
rpl_stmt_seq
.
inc
--
vertical_results
--
replace_column
5
# 6 #
SHOW
PROCEDURE
STATUS
LIKE
'p1'
;
--
disable_query_log
SELECT
'-------- switch to slave -------'
as
""
;
--
enable_query_log
connection
slave
;
--
replace_column
5
# 6 #
SHOW
PROCEDURE
STATUS
LIKE
'p1'
;
connection
master
;
--
horizontal_results
let
$my_stmt
=
ALTER
PROCEDURE
p1
COMMENT
"I have been altered"
;
let
$my_master_commit
=
true
;
let
$my_slave_commit
=
true
;
--
source
include
/
rpl_stmt_seq
.
inc
--
vertical_results
--
replace_column
5
# 6 #
SHOW
PROCEDURE
STATUS
LIKE
'p1'
;
--
disable_query_log
SELECT
'-------- switch to slave -------'
as
""
;
--
enable_query_log
connection
slave
;
--
replace_column
5
# 6 #
SHOW
PROCEDURE
STATUS
LIKE
'p1'
;
connection
master
;
--
horizontal_results
let
$my_stmt
=
DROP
PROCEDURE
p1
;
let
$my_master_commit
=
true
;
let
$my_slave_commit
=
true
;
--
source
include
/
rpl_stmt_seq
.
inc
--
vertical_results
SHOW
PROCEDURE
STATUS
LIKE
'p1'
;
--
disable_query_log
SELECT
'-------- switch to slave -------'
as
""
;
--
enable_query_log
connection
slave
;
SHOW
PROCEDURE
STATUS
LIKE
'p1'
;
connection
master
;
--
horizontal_results
###############################################################
# Cleanup
###############################################################
...
...
@@ -349,4 +400,4 @@ DROP DATABASE IF EXISTS mysqltest2;
DROP
DATABASE
IF
EXISTS
mysqltest3
;
--
enable_warnings
# End of 4.1 tests
sql/sql_parse.cc
View file @
86882cc8
...
...
@@ -4029,6 +4029,9 @@ end_with_restore_list:
goto
error
;
}
if
(
end_active_trans
(
thd
))
goto
error
;
if
(
!
lex
->
sphead
->
m_db
.
str
||
!
lex
->
sphead
->
m_db
.
str
[
0
])
{
lex
->
sphead
->
m_db
.
length
=
strlen
(
thd
->
db
);
...
...
@@ -4283,6 +4286,9 @@ end_with_restore_list:
sp
->
m_name
.
str
,
lex
->
sql_command
==
SQLCOM_ALTER_PROCEDURE
,
0
))
goto
error
;
if
(
end_active_trans
(
thd
))
goto
error
;
memcpy
(
&
lex
->
sp_chistics
,
&
chistics
,
sizeof
(
lex
->
sp_chistics
));
if
(
!
trust_routine_creators
&&
mysql_bin_log
.
is_open
()
&&
!
sp
->
m_chistics
->
detistic
&&
...
...
@@ -4342,6 +4348,9 @@ end_with_restore_list:
if
(
check_routine_access
(
thd
,
ALTER_PROC_ACL
,
db
,
name
,
lex
->
sql_command
==
SQLCOM_DROP_PROCEDURE
,
0
))
goto
error
;
if
(
end_active_trans
(
thd
))
goto
error
;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if
(
sp_automatic_privileges
&&
!
opt_noacl
&&
sp_revoke_privileges
(
thd
,
db
,
name
,
...
...
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