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
1b6e66fa
Commit
1b6e66fa
authored
Aug 07, 2013
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing tests for GET DIAGNOSTICS.
parent
a3d79f2e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1758 additions
and
0 deletions
+1758
-0
mysql-test/r/get_diagnostics.result
mysql-test/r/get_diagnostics.result
+802
-0
mysql-test/suite/rpl/r/rpl_stm_user_variables.result
mysql-test/suite/rpl/r/rpl_stm_user_variables.result
+48
-0
mysql-test/suite/rpl/t/rpl_stm_user_variables.test
mysql-test/suite/rpl/t/rpl_stm_user_variables.test
+39
-0
mysql-test/t/get_diagnostics.test
mysql-test/t/get_diagnostics.test
+869
-0
No files found.
mysql-test/r/get_diagnostics.result
0 → 100644
View file @
1b6e66fa
This diff is collapsed.
Click to expand it.
mysql-test/suite/rpl/r/rpl_stm_user_variables.result
View file @
1b6e66fa
...
...
@@ -213,4 +213,52 @@ ERROR 23000: Duplicate entry '2147483647' for key 'PRIMARY'
include/diff_tables.inc [master:t1,slave:t1]
DROP TRIGGER tr1;
DROP TABLE t1;
# The GET DIAGNOSTICS itself is not replicated, but it can set
# variables which can be used in statements that are replicated.
include/rpl_reset.inc
CREATE TABLE t1 (a INT, b INT);
GET DIAGNOSTICS @var1 = NUMBER;
INSERT INTO t1 VALUES (@var1, 0), (@var1, 0);
CREATE PROCEDURE p1()
LANGUAGE SQL
BEGIN
DECLARE count INT;
UPDATE t1 SET b = 2 WHERE a = 0;
GET DIAGNOSTICS count = ROW_COUNT;
INSERT INTO t1 VALUES (1, count);
END|
CALL p1();
# On slave, check if the statement was replicated.
SELECT * FROM t1 ORDER BY a;
a b
0 2
0 2
1 2
# Show events and cleanup
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b INT)
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # User var # # @`var1`=0
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (@var1, 0), (@var1, 0)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
BEGIN
DECLARE count INT;
UPDATE t1 SET b = 2 WHERE a = 0;
GET DIAGNOSTICS count = ROW_COUNT;
INSERT INTO t1 VALUES (1, count);
END
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; UPDATE t1 SET b = 2 WHERE a = 0
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1, NAME_CONST('count',2))
master-bin.000001 # Query # # COMMIT
DROP TABLE t1;
DROP PROCEDURE p1;
include/rpl_end.inc
mysql-test/suite/rpl/t/rpl_stm_user_variables.test
View file @
1b6e66fa
...
...
@@ -167,4 +167,43 @@ DROP TABLE t1;
--
sync_slave_with_master
--
echo
--
echo
# The GET DIAGNOSTICS itself is not replicated, but it can set
--
echo
# variables which can be used in statements that are replicated.
--
echo
--
source
include
/
rpl_reset
.
inc
connection
master
;
CREATE
TABLE
t1
(
a
INT
,
b
INT
);
GET
DIAGNOSTICS
@
var1
=
NUMBER
;
INSERT
INTO
t1
VALUES
(
@
var1
,
0
),
(
@
var1
,
0
);
DELIMITER
|
;
CREATE
PROCEDURE
p1
()
LANGUAGE
SQL
BEGIN
DECLARE
count
INT
;
UPDATE
t1
SET
b
=
2
WHERE
a
=
0
;
GET
DIAGNOSTICS
count
=
ROW_COUNT
;
INSERT
INTO
t1
VALUES
(
1
,
count
);
END
|
DELIMITER
;
|
CALL
p1
();
--
sync_slave_with_master
connection
slave
;
--
echo
# On slave, check if the statement was replicated.
SELECT
*
FROM
t1
ORDER
BY
a
;
connection
master
;
--
echo
# Show events and cleanup
--
source
include
/
show_binlog_events
.
inc
DROP
TABLE
t1
;
DROP
PROCEDURE
p1
;
--
sync_slave_with_master
--
source
include
/
rpl_end
.
inc
mysql-test/t/get_diagnostics.test
0 → 100644
View file @
1b6e66fa
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