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
e0a4867f
Commit
e0a4867f
authored
Dec 03, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1
parents
ac2f6c49
1278adbd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
27 deletions
+19
-27
sql/sql_class.h
sql/sql_class.h
+2
-1
sql/sql_insert.cc
sql/sql_insert.cc
+17
-26
No files found.
sql/sql_class.h
View file @
e0a4867f
...
...
@@ -1235,6 +1235,7 @@ class select_insert :public select_result_interceptor {
~
select_insert
();
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
bool
send_data
(
List
<
Item
>
&
items
);
virtual
void
store_values
(
List
<
Item
>
&
values
);
void
send_error
(
uint
errcode
,
const
char
*
err
);
bool
send_eof
();
/* not implemented: select_insert is never re-used in prepared statements */
...
...
@@ -1262,7 +1263,7 @@ class select_create: public select_insert {
create_info
(
create_info_par
),
lock
(
0
)
{}
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
bool
send_data
(
List
<
Item
>
&
values
);
void
store_values
(
List
<
Item
>
&
values
);
bool
send_eof
();
void
abort
();
};
...
...
sql/sql_insert.cc
View file @
e0a4867f
...
...
@@ -1457,7 +1457,6 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
restore_record
(
table
,
default_values
);
// Get empty record
table
->
next_number_field
=
table
->
found_next_number_field
;
thd
->
count_cuted_fields
=
CHECK_FIELD_WARN
;
// calc cuted fields
thd
->
cuted_fields
=
0
;
if
(
info
.
handle_duplicates
==
DUP_IGNORE
||
info
.
handle_duplicates
==
DUP_REPLACE
)
...
...
@@ -1487,27 +1486,34 @@ select_insert::~select_insert()
bool
select_insert
::
send_data
(
List
<
Item
>
&
values
)
{
DBUG_ENTER
(
"select_insert::send_data"
);
bool
error
=
0
;
if
(
unit
->
offset_limit_cnt
)
{
// using limit offset,count
unit
->
offset_limit_cnt
--
;
DBUG_RETURN
(
0
);
}
if
(
fields
->
elements
)
fill_record
(
*
fields
,
values
,
1
);
else
fill_record
(
table
->
field
,
values
,
1
);
if
(
thd
->
net
.
report_error
||
write_record
(
table
,
&
info
))
DBUG_RETURN
(
1
);
if
(
table
->
next_number_field
)
// Clear for next record
thd
->
count_cuted_fields
=
CHECK_FIELD_WARN
;
// calc cuted fields
store_values
(
values
);
error
=
thd
->
net
.
report_error
||
write_record
(
table
,
&
info
);
thd
->
count_cuted_fields
=
CHECK_FIELD_IGNORE
;
if
(
!
error
&&
table
->
next_number_field
)
// Clear for next record
{
table
->
next_number_field
->
reset
();
if
(
!
last_insert_id
&&
thd
->
insert_id_used
)
last_insert_id
=
thd
->
insert_id
();
}
DBUG_RETURN
(
0
);
DBUG_RETURN
(
error
);
}
void
select_insert
::
store_values
(
List
<
Item
>
&
values
)
{
if
(
fields
->
elements
)
fill_record
(
*
fields
,
values
,
1
);
else
fill_record
(
table
->
field
,
values
,
1
);
}
void
select_insert
::
send_error
(
uint
errcode
,
const
char
*
err
)
{
DBUG_ENTER
(
"select_insert::send_error"
);
...
...
@@ -1637,7 +1643,6 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
table
->
next_number_field
=
table
->
found_next_number_field
;
restore_record
(
table
,
default_values
);
// Get empty record
thd
->
count_cuted_fields
=
CHECK_FIELD_WARN
;
// count warnings
thd
->
cuted_fields
=
0
;
if
(
info
.
handle_duplicates
==
DUP_IGNORE
||
info
.
handle_duplicates
==
DUP_REPLACE
)
...
...
@@ -1647,23 +1652,9 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
}
bool
select_create
::
send_data
(
List
<
Item
>
&
values
)
void
select_create
::
store_values
(
List
<
Item
>
&
values
)
{
if
(
unit
->
offset_limit_cnt
)
{
// using limit offset,count
unit
->
offset_limit_cnt
--
;
return
0
;
}
fill_record
(
field
,
values
,
1
);
if
(
thd
->
net
.
report_error
||
write_record
(
table
,
&
info
))
return
1
;
if
(
table
->
next_number_field
)
// Clear for next record
{
table
->
next_number_field
->
reset
();
if
(
!
last_insert_id
&&
thd
->
insert_id_used
)
last_insert_id
=
thd
->
insert_id
();
}
return
0
;
}
...
...
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