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
4b8e96d5
Commit
4b8e96d5
authored
Dec 03, 2004
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
eb6c38fe
13649d90
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
6 deletions
+45
-6
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
mysql-test/r/insert_select.result
mysql-test/r/insert_select.result
+9
-0
mysql-test/t/insert_select.test
mysql-test/t/insert_select.test
+13
-0
sql/sql_class.h
sql/sql_class.h
+10
-0
sql/sql_insert.cc
sql/sql_insert.cc
+12
-0
sql/sql_table.cc
sql/sql_table.cc
+0
-6
No files found.
BitKeeper/etc/logging_ok
View file @
4b8e96d5
...
@@ -87,6 +87,7 @@ jcole@mugatu.jcole.us
...
@@ -87,6 +87,7 @@ jcole@mugatu.jcole.us
jcole@mugatu.spaceapes.com
jcole@mugatu.spaceapes.com
jcole@sarvik.tfr.cafe.ee
jcole@sarvik.tfr.cafe.ee
jcole@tetra.spaceapes.com
jcole@tetra.spaceapes.com
jimw@mysql.com
joerg@mysql.com
joerg@mysql.com
joreland@mysql.com
joreland@mysql.com
jorge@linux.jorge.mysql.com
jorge@linux.jorge.mysql.com
...
...
mysql-test/r/insert_select.result
View file @
4b8e96d5
...
@@ -81,6 +81,15 @@ a
...
@@ -81,6 +81,15 @@ a
1
1
2
2
drop table t1, t2;
drop table t1, t2;
create table t1(a int);
insert into t1 values(1),(1);
reset master;
create table t2(unique(a)) select a from t1;
Duplicate entry '1' for key 1
show binlog events;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
drop table t1;
create table t1 (a int not null);
create table t1 (a int not null);
create table t2 (a int not null);
create table t2 (a int not null);
insert into t1 values (1);
insert into t1 values (1);
...
...
mysql-test/t/insert_select.test
View file @
4b8e96d5
...
@@ -89,6 +89,19 @@ show binlog events;
...
@@ -89,6 +89,19 @@ show binlog events;
select
*
from
t1
;
select
*
from
t1
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
# Verify that a partly-completed CREATE TABLE .. SELECT does not
# get into the binlog (Bug #6682)
create
table
t1
(
a
int
);
insert
into
t1
values
(
1
),(
1
);
reset
master
;
--
error
1062
create
table
t2
(
unique
(
a
))
select
a
from
t1
;
# The above should produce an error, *and* not appear in the binlog
let
$VERSION
=
`select version()`
;
--
replace_result
$VERSION
VERSION
show
binlog
events
;
drop
table
t1
;
#
#
# Test of insert ... select from same table
# Test of insert ... select from same table
#
#
...
...
sql/sql_class.h
View file @
4b8e96d5
...
@@ -1092,6 +1092,15 @@ class THD :public ilink,
...
@@ -1092,6 +1092,15 @@ class THD :public ilink,
void
end_statement
();
void
end_statement
();
};
};
# define tmp_disable_binlog(A) \
ulong save_options= (A)->options, save_master_access= (A)->master_access; \
(A)->options&= ~OPTION_BIN_LOG; \
(A)->master_access|= SUPER_ACL;
/* unneeded in 4.1 */
#define reenable_binlog(A) \
(A)->options= save_options; \
(A)->master_access= save_master_access;
/* Flags for the THD::system_thread (bitmap) variable */
/* Flags for the THD::system_thread (bitmap) variable */
#define SYSTEM_THREAD_DELAYED_INSERT 1
#define SYSTEM_THREAD_DELAYED_INSERT 1
#define SYSTEM_THREAD_SLAVE_IO 2
#define SYSTEM_THREAD_SLAVE_IO 2
...
@@ -1263,6 +1272,7 @@ class select_create: public select_insert {
...
@@ -1263,6 +1272,7 @@ class select_create: public select_insert {
{}
{}
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
bool
send_data
(
List
<
Item
>
&
values
);
bool
send_data
(
List
<
Item
>
&
values
);
void
send_error
(
uint
errcode
,
const
char
*
err
);
bool
send_eof
();
bool
send_eof
();
void
abort
();
void
abort
();
};
};
...
...
sql/sql_insert.cc
View file @
4b8e96d5
...
@@ -1667,6 +1667,18 @@ bool select_create::send_data(List<Item> &values)
...
@@ -1667,6 +1667,18 @@ bool select_create::send_data(List<Item> &values)
}
}
void
select_create
::
send_error
(
uint
errcode
,
const
char
*
err
)
{
/*
Disable binlog, because we "roll back" partial inserts in ::abort
by removing the table, even for non-transactional tables.
*/
tmp_disable_binlog
(
thd
);
select_insert
::
send_error
(
errcode
,
err
);
reenable_binlog
(
thd
);
}
bool
select_create
::
send_eof
()
bool
select_create
::
send_eof
()
{
{
bool
tmp
=
select_insert
::
send_eof
();
bool
tmp
=
select_insert
::
send_eof
();
...
...
sql/sql_table.cc
View file @
4b8e96d5
...
@@ -29,12 +29,6 @@
...
@@ -29,12 +29,6 @@
#include <io.h>
#include <io.h>
#endif
#endif
#define tmp_disable_binlog(A) \
ulong save_options= (A)->options; \
(A)->options&= ~OPTION_BIN_LOG;
#define reenable_binlog(A) (A)->options= save_options;
const
char
*
primary_key_name
=
"PRIMARY"
;
const
char
*
primary_key_name
=
"PRIMARY"
;
static
bool
check_if_keyname_exists
(
const
char
*
name
,
KEY
*
start
,
KEY
*
end
);
static
bool
check_if_keyname_exists
(
const
char
*
name
,
KEY
*
start
,
KEY
*
end
);
...
...
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