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
b879a401
Commit
b879a401
authored
Mar 16, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write binlog before commit when doing INSERT ... SELECT
parent
968e9a73
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
7 deletions
+27
-7
mysql-test/r/create.result
mysql-test/r/create.result
+7
-0
sql/sql_insert.cc
sql/sql_insert.cc
+8
-6
sql/sql_update.cc
sql/sql_update.cc
+12
-1
No files found.
mysql-test/r/create.result
View file @
b879a401
...
...
@@ -58,6 +58,13 @@ a$1 $b c$
create table test_$1.test2$ (a int);
drop table test_$1.test2$;
drop database test_$1;
create table `` (a int);
Incorrect table name ''
drop table if exists ``;
Incorrect table name ''
create table t1 (`` int);
Incorrect column name ''
drop table if exists t1;
create table t1 (a int auto_increment not null primary key, B CHAR(20));
insert into t1 (b) values ("hello"),("my"),("world");
create table t2 (key (b)) select * from t1;
...
...
sql/sql_insert.cc
View file @
b879a401
...
...
@@ -1361,6 +1361,14 @@ bool select_insert::send_eof()
if
(
!
(
error
=
table
->
file
->
extra
(
HA_EXTRA_NO_CACHE
)))
error
=
table
->
file
->
activate_all_index
(
thd
);
table
->
file
->
extra
(
HA_EXTRA_NO_IGNORE_DUP_KEY
);
/* Write to binlog before commiting transaction */
if
(
mysql_bin_log
.
is_open
())
{
Query_log_event
qinfo
(
thd
,
thd
->
query
,
thd
->
query_length
,
table
->
file
->
has_transactions
());
mysql_bin_log
.
write
(
&
qinfo
);
}
if
((
error2
=
ha_autocommit_or_rollback
(
thd
,
error
))
&&
!
error
)
error
=
error2
;
if
(
info
.
copied
||
info
.
deleted
)
...
...
@@ -1386,12 +1394,6 @@ bool select_insert::send_eof()
thd
->
insert_id
(
last_insert_id
);
// For update log
::
send_ok
(
&
thd
->
net
,
info
.
copied
,
last_insert_id
,
buff
);
mysql_update_log
.
write
(
thd
,
thd
->
query
,
thd
->
query_length
);
if
(
mysql_bin_log
.
is_open
())
{
Query_log_event
qinfo
(
thd
,
thd
->
query
,
thd
->
query_length
,
table
->
file
->
has_transactions
());
mysql_bin_log
.
write
(
&
qinfo
);
}
return
0
;
}
}
...
...
sql/sql_update.cc
View file @
b879a401
...
...
@@ -618,7 +618,18 @@ bool multi_update::send_data(List<Item> ¬_used_values)
for
(
cur_table
=
update_tables
;
cur_table
;
cur_table
=
cur_table
->
next
)
{
TABLE
*
table
=
cur_table
->
table
;
/* Check if we are using outer join and we didn't find the row */
/*
Check if we are using outer join and we didn't find the row
or if we have already updated this row in the previous call to this
function.
The same row may be presented here several times in a join of type
UPDATE t1 FROM t1,t2 SET t1.a=t2.a
In this case we will do the update for the first found row combination.
The join algorithm guarantees that we will not find the a row in
t1 several times.
*/
if
(
table
->
status
&
(
STATUS_NULL_ROW
|
STATUS_UPDATED
))
continue
;
...
...
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