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
4b51032f
Commit
4b51032f
authored
Oct 03, 2006
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.1
into neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
parents
23777921
62c79bee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
1 deletion
+38
-1
mysql-test/extra/rpl_tests/rpl_insert_id.test
mysql-test/extra/rpl_tests/rpl_insert_id.test
+17
-0
mysql-test/r/rpl_insert_id.result
mysql-test/r/rpl_insert_id.result
+18
-0
sql/sql_class.cc
sql/sql_class.cc
+3
-1
No files found.
mysql-test/extra/rpl_tests/rpl_insert_id.test
View file @
4b51032f
...
...
@@ -337,6 +337,7 @@ DROP TABLE t1, t2;
DROP
PROCEDURE
IF
EXISTS
p1
;
DROP
FUNCTION
IF
EXISTS
f1
;
DROP
FUNCTION
IF
EXISTS
f2
;
DROP
FUNCTION
IF
EXISTS
f3
;
DROP
TABLE
IF
EXISTS
t1
,
t2
;
--
enable_warnings
...
...
@@ -366,6 +367,12 @@ END |
CREATE
FUNCTION
f2
()
RETURNS
INT
NOT
DETERMINISTIC
RETURN
LAST_INSERT_ID
()
|
CREATE
FUNCTION
f3
()
RETURNS
INT
MODIFIES
SQL
DATA
BEGIN
INSERT
INTO
t2
(
i
)
VALUES
(
LAST_INSERT_ID
());
RETURN
0
;
END
|
delimiter
;
|
INSERT
INTO
t1
VALUES
(
NULL
,
-
1
);
...
...
@@ -380,6 +387,15 @@ INSERT INTO t1 VALUES (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID(5)),
INSERT
INTO
t1
VALUES
(
NULL
,
0
),
(
NULL
,
LAST_INSERT_ID
());
UPDATE
t1
SET
j
=
-
1
WHERE
i
IS
NULL
;
# Test statement-based replication of function calls.
INSERT
INTO
t1
(
i
)
VALUES
(
NULL
);
connection
master1
;
INSERT
INTO
t1
(
i
)
VALUES
(
NULL
);
connection
master
;
SELECT
f3
();
SELECT
*
FROM
t1
;
SELECT
*
FROM
t2
;
...
...
@@ -391,6 +407,7 @@ connection master;
DROP
PROCEDURE
p1
;
DROP
FUNCTION
f1
;
DROP
FUNCTION
f2
;
DROP
FUNCTION
f3
;
DROP
TABLE
t1
,
t2
;
...
...
mysql-test/r/rpl_insert_id.result
View file @
4b51032f
...
...
@@ -301,6 +301,7 @@ DROP TABLE t1, t2;
DROP PROCEDURE IF EXISTS p1;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
DROP FUNCTION IF EXISTS f3;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
i INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
...
...
@@ -324,6 +325,11 @@ RETURN 0;
END |
CREATE FUNCTION f2() RETURNS INT NOT DETERMINISTIC
RETURN LAST_INSERT_ID() |
CREATE FUNCTION f3() RETURNS INT MODIFIES SQL DATA
BEGIN
INSERT INTO t2 (i) VALUES (LAST_INSERT_ID());
RETURN 0;
END |
INSERT INTO t1 VALUES (NULL, -1);
CALL p1();
SELECT f1();
...
...
@@ -336,6 +342,11 @@ INSERT INTO t1 VALUES (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID(5)),
(NULL, @@LAST_INSERT_ID);
INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());
UPDATE t1 SET j= -1 WHERE i IS NULL;
INSERT INTO t1 (i) VALUES (NULL);
INSERT INTO t1 (i) VALUES (NULL);
SELECT f3();
f3()
0
SELECT * FROM t1;
i j
1 -1
...
...
@@ -356,12 +367,15 @@ i j
16 13
17 -1
18 14
19 0
20 0
SELECT * FROM t2;
i
2
3
5
6
19
SELECT * FROM t1;
i j
1 -1
...
...
@@ -382,15 +396,19 @@ i j
16 13
17 -1
18 14
19 0
20 0
SELECT * FROM t2;
i
2
3
5
6
19
DROP PROCEDURE p1;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
DROP TABLE t1, t2;
#
# End of 5.0 tests
...
...
sql/sql_class.cc
View file @
4b51032f
...
...
@@ -637,7 +637,7 @@ bool THD::store_globals()
THD::cleanup_after_query()
DESCRIPTION
This function is used to reset thread data to it
'
s default state.
This function is used to reset thread data to its default state.
NOTE
This function is not suitable for setting thread data to some
...
...
@@ -645,6 +645,7 @@ bool THD::store_globals()
different master threads may overwrite data of each other on
slave.
*/
void
THD
::
cleanup_after_query
()
{
if
(
!
in_sub_stmt
)
/* stored functions and triggers are a special case */
...
...
@@ -668,6 +669,7 @@ void THD::cleanup_after_query()
where
=
THD
::
DEFAULT_WHERE
;
}
/*
Convert a string to another character set
...
...
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