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
0288cc9d
Commit
0288cc9d
authored
Nov 19, 2007
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into moonbone.local:/work/30384-bug-5.0-opt-mysql
parents
fedeec6c
da7470af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
15 deletions
+7
-15
sql/sql_class.h
sql/sql_class.h
+2
-2
sql/sql_insert.cc
sql/sql_insert.cc
+5
-13
No files found.
sql/sql_class.h
View file @
0288cc9d
...
...
@@ -2051,14 +2051,13 @@ class select_insert :public select_result_interceptor {
ulonglong
last_insert_id
;
COPY_INFO
info
;
bool
insert_into_view
;
bool
is_bulk_insert_mode
;
select_insert
(
TABLE_LIST
*
table_list_par
,
TABLE
*
table_par
,
List
<
Item
>
*
fields_par
,
List
<
Item
>
*
update_fields
,
List
<
Item
>
*
update_values
,
enum_duplicates
duplic
,
bool
ignore
);
~
select_insert
();
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
int
prepare2
(
void
);
virtual
int
prepare2
(
void
);
bool
send_data
(
List
<
Item
>
&
items
);
virtual
void
store_values
(
List
<
Item
>
&
values
);
void
send_error
(
uint
errcode
,
const
char
*
err
);
...
...
@@ -2093,6 +2092,7 @@ class select_create: public select_insert {
void
send_error
(
uint
errcode
,
const
char
*
err
);
bool
send_eof
();
void
abort
();
int
prepare2
(
void
)
{
return
0
;
}
};
#include <myisam.h>
...
...
sql/sql_insert.cc
View file @
0288cc9d
...
...
@@ -2645,8 +2645,7 @@ select_insert::select_insert(TABLE_LIST *table_list_par, TABLE *table_par,
bool
ignore_check_option_errors
)
:
table_list
(
table_list_par
),
table
(
table_par
),
fields
(
fields_par
),
last_insert_id
(
0
),
insert_into_view
(
table_list_par
&&
table_list_par
->
view
!=
0
),
is_bulk_insert_mode
(
FALSE
)
insert_into_view
(
table_list_par
&&
table_list_par
->
view
!=
0
)
{
bzero
((
char
*
)
&
info
,
sizeof
(
info
));
info
.
handle_duplicates
=
duplic
;
...
...
@@ -2755,14 +2754,14 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
Is table which we are changing used somewhere in other parts of
query
*/
if
(
!
(
lex
->
current_select
->
options
&
OPTION_BUFFER_RESULT
)
&&
unique_table
(
thd
,
table_list
,
table_list
->
next_global
,
0
))
if
(
unique_table
(
thd
,
table_list
,
table_list
->
next_global
,
0
))
{
/* Using same table for INSERT and SELECT */
lex
->
current_select
->
options
|=
OPTION_BUFFER_RESULT
;
lex
->
current_select
->
join
->
select_options
|=
OPTION_BUFFER_RESULT
;
}
else
if
(
!
thd
->
prelocked_mode
)
else
if
(
!
(
lex
->
current_select
->
options
&
OPTION_BUFFER_RESULT
)
&&
!
thd
->
prelocked_mode
)
{
/*
We must not yet prepare the result table if it is the same as one of the
...
...
@@ -2831,11 +2830,8 @@ int select_insert::prepare2(void)
{
DBUG_ENTER
(
"select_insert::prepare2"
);
if
(
thd
->
lex
->
current_select
->
options
&
OPTION_BUFFER_RESULT
&&
!
thd
->
prelocked_mode
&&
!
is_bulk_insert_mode
)
{
!
thd
->
prelocked_mode
)
table
->
file
->
start_bulk_insert
((
ha_rows
)
0
);
is_bulk_insert_mode
=
TRUE
;
}
DBUG_RETURN
(
0
);
}
...
...
@@ -2941,7 +2937,6 @@ bool select_insert::send_eof()
DBUG_ENTER
(
"select_insert::send_eof"
);
error
=
(
!
thd
->
prelocked_mode
)
?
table
->
file
->
end_bulk_insert
()
:
0
;
is_bulk_insert_mode
=
FALSE
;
table
->
file
->
extra
(
HA_EXTRA_NO_IGNORE_DUP_KEY
);
table
->
file
->
extra
(
HA_EXTRA_WRITE_CANNOT_REPLACE
);
...
...
@@ -3277,10 +3272,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
if
(
info
.
handle_duplicates
==
DUP_UPDATE
)
table
->
file
->
extra
(
HA_EXTRA_INSERT_WITH_UPDATE
);
if
(
!
thd
->
prelocked_mode
)
{
table
->
file
->
start_bulk_insert
((
ha_rows
)
0
);
is_bulk_insert_mode
=
TRUE
;
}
thd
->
abort_on_warning
=
(
!
info
.
ignore
&&
(
thd
->
variables
.
sql_mode
&
(
MODE_STRICT_TRANS_TABLES
|
...
...
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