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
11f34156
Commit
11f34156
authored
Nov 08, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use IGNORE by default in INSERT ... SELECT
parent
dd43f32d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
3 deletions
+18
-3
Docs/manual.texi
Docs/manual.texi
+6
-0
mysql-test/r/insert_select.result
mysql-test/r/insert_select.result
+2
-0
mysql-test/t/insert_select.test
mysql-test/t/insert_select.test
+2
-0
sql/sql_parse.cc
sql/sql_parse.cc
+1
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+7
-1
No files found.
Docs/manual.texi
View file @
11f34156
...
...
@@ -9686,6 +9686,10 @@ version 4.0;
@itemize @bullet
@item
@code{INSERT INTO ... SELECT} had in 3.23 always @code{IGNORE} enabled.
In 4.0.1 MySQL will stop (and possible rollback) in case of an error if you
don't specify @code{IGNORE}.
@item
@file{safe_mysqld} is renamed to @file{mysqld_safe}.
@item
The old C API functions @code{mysql_drop_db}, @code{mysql_create_db} and
...
...
@@ -48867,6 +48871,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
Changed @code{INSERT INTO .. SELECT} to by default stop on errors.
@item
Ignore @code{DATA DIRECTORY} and @code{INDEX DIRECTORY} directives on windows.
@item
Added boolean fulltext search code. It should be considered early alpha.
mysql-test/r/insert_select.result
View file @
11f34156
...
...
@@ -4,6 +4,8 @@ insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,
create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY);
insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1;
insert into t2 (payoutID) SELECT payoutID+10 FROM t1;
Duplicate entry '16' for key 1
insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1;
select * from t2;
payoutID
1
...
...
mysql-test/t/insert_select.test
View file @
11f34156
...
...
@@ -7,7 +7,9 @@ create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLI
insert
into
t1
(
bandID
,
payoutID
)
VALUES
(
1
,
6
),(
2
,
6
),(
3
,
4
),(
4
,
9
),(
5
,
10
),(
6
,
1
),(
7
,
12
),(
8
,
12
);
create
table
t2
(
payoutID
SMALLINT
UNSIGNED
NOT
NULL
PRIMARY
KEY
);
insert
into
t2
(
payoutID
)
SELECT
DISTINCT
payoutID
FROM
t1
;
--
error
1062
insert
into
t2
(
payoutID
)
SELECT
payoutID
+
10
FROM
t1
;
insert
ignore
into
t2
(
payoutID
)
SELECT
payoutID
+
10
FROM
t1
;
select
*
from
t2
;
drop
table
t1
,
t2
;
#
...
...
sql/sql_parse.cc
View file @
11f34156
...
...
@@ -1626,8 +1626,7 @@ mysql_execute_command(void)
if
(
!
(
res
=
open_and_lock_tables
(
thd
,
tables
)))
{
if
((
result
=
new
select_insert
(
tables
->
table
,
&
lex
->
field_list
,
lex
->
sql_command
==
SQLCOM_REPLACE_SELECT
?
DUP_REPLACE
:
DUP_IGNORE
)))
lex
->
duplicates
)))
res
=
handle_select
(
thd
,
lex
,
result
);
}
else
...
...
sql/sql_yacc.yy
View file @
11f34156
...
...
@@ -2188,7 +2188,13 @@ insert:
INSERT { Lex->sql_command = SQLCOM_INSERT; } insert_lock_option opt_ignore insert2 insert_field_spec
replace:
REPLACE { Lex->sql_command = SQLCOM_REPLACE; } replace_lock_option insert2 insert_field_spec
REPLACE
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_REPLACE;
lex->duplicates= DUP_REPLACE;
}
replace_lock_option insert2 insert_field_spec
insert_lock_option:
/* empty */ { Lex->lock_option= TL_WRITE_CONCURRENT_INSERT; }
...
...
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