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
f1389ad0
Commit
f1389ad0
authored
Mar 16, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk@192.168.21.1:mysql-5.1-opt
into mysql.com:/home/hf/work/mrg/mysql-5.1-opt
parents
01fde8e1
3f379546
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
mysql-test/r/insert_update.result
mysql-test/r/insert_update.result
+11
-0
mysql-test/t/insert_update.test
mysql-test/t/insert_update.test
+12
-0
No files found.
mysql-test/r/insert_update.result
View file @
f1389ad0
...
...
@@ -236,3 +236,14 @@ INSERT INTO t2 VALUES (1), (3);
INSERT INTO t1 SELECT 1, COUNT(*) FROM t2 ON DUPLICATE KEY UPDATE j= a;
ERROR 42S22: Unknown column 'a' in 'field list'
DROP TABLE t1,t2;
CREATE TABLE t1 (f1 INT AUTO_INCREMENT PRIMARY KEY,
f2 VARCHAR(5) NOT NULL UNIQUE);
INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
1
INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
1
DROP TABLE t1;
mysql-test/t/insert_update.test
View file @
f1389ad0
...
...
@@ -162,3 +162,15 @@ INSERT INTO t2 VALUES (1), (3);
--
error
ER_BAD_FIELD_ERROR
INSERT
INTO
t1
SELECT
1
,
COUNT
(
*
)
FROM
t2
ON
DUPLICATE
KEY
UPDATE
j
=
a
;
DROP
TABLE
t1
,
t2
;
#
# Bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were
# touched but not actually changed.
#
CREATE
TABLE
t1
(
f1
INT
AUTO_INCREMENT
PRIMARY
KEY
,
f2
VARCHAR
(
5
)
NOT
NULL
UNIQUE
);
INSERT
t1
(
f2
)
VALUES
(
'test'
)
ON
DUPLICATE
KEY
UPDATE
f1
=
LAST_INSERT_ID
(
f1
);
SELECT
LAST_INSERT_ID
();
INSERT
t1
(
f2
)
VALUES
(
'test'
)
ON
DUPLICATE
KEY
UPDATE
f1
=
LAST_INSERT_ID
(
f1
);
SELECT
LAST_INSERT_ID
();
DROP
TABLE
t1
;
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