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
d08053b2
Commit
d08053b2
authored
Dec 03, 2004
by
joreland@mysql.com
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
6a9b2453
2cf8e250
Changes
2
Hide 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 @
d08053b2
...
@@ -1235,6 +1235,7 @@ class select_insert :public select_result_interceptor {
...
@@ -1235,6 +1235,7 @@ class select_insert :public select_result_interceptor {
~
select_insert
();
~
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
>
&
items
);
bool
send_data
(
List
<
Item
>
&
items
);
virtual
void
store_values
(
List
<
Item
>
&
values
);
void
send_error
(
uint
errcode
,
const
char
*
err
);
void
send_error
(
uint
errcode
,
const
char
*
err
);
bool
send_eof
();
bool
send_eof
();
/* not implemented: select_insert is never re-used in prepared statements */
/* not implemented: select_insert is never re-used in prepared statements */
...
@@ -1262,7 +1263,7 @@ public:
...
@@ -1262,7 +1263,7 @@ public:
create_info
(
create_info_par
),
lock
(
0
)
create_info
(
create_info_par
),
lock
(
0
)
{}
{}
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
bool
send_data
(
List
<
Item
>
&
values
);
void
store_values
(
List
<
Item
>
&
values
);
bool
send_eof
();
bool
send_eof
();
void
abort
();
void
abort
();
};
};
...
...
sql/sql_insert.cc
View file @
d08053b2
...
@@ -1457,7 +1457,6 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
...
@@ -1457,7 +1457,6 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
restore_record
(
table
,
default_values
);
// Get empty record
restore_record
(
table
,
default_values
);
// Get empty record
table
->
next_number_field
=
table
->
found_next_number_field
;
table
->
next_number_field
=
table
->
found_next_number_field
;
thd
->
count_cuted_fields
=
CHECK_FIELD_WARN
;
// calc cuted fields
thd
->
cuted_fields
=
0
;
thd
->
cuted_fields
=
0
;
if
(
info
.
handle_duplicates
==
DUP_IGNORE
||
if
(
info
.
handle_duplicates
==
DUP_IGNORE
||
info
.
handle_duplicates
==
DUP_REPLACE
)
info
.
handle_duplicates
==
DUP_REPLACE
)
...
@@ -1487,27 +1486,34 @@ select_insert::~select_insert()
...
@@ -1487,27 +1486,34 @@ select_insert::~select_insert()
bool
select_insert
::
send_data
(
List
<
Item
>
&
values
)
bool
select_insert
::
send_data
(
List
<
Item
>
&
values
)
{
{
DBUG_ENTER
(
"select_insert::send_data"
);
DBUG_ENTER
(
"select_insert::send_data"
);
bool
error
=
0
;
if
(
unit
->
offset_limit_cnt
)
if
(
unit
->
offset_limit_cnt
)
{
// using limit offset,count
{
// using limit offset,count
unit
->
offset_limit_cnt
--
;
unit
->
offset_limit_cnt
--
;
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
if
(
fields
->
elements
)
thd
->
count_cuted_fields
=
CHECK_FIELD_WARN
;
// calc cuted fields
fill_record
(
*
fields
,
values
,
1
);
store_values
(
values
);
else
error
=
thd
->
net
.
report_error
||
write_record
(
table
,
&
info
);
fill_record
(
table
->
field
,
values
,
1
);
thd
->
count_cuted_fields
=
CHECK_FIELD_IGNORE
;
if
(
thd
->
net
.
report_error
||
write_record
(
table
,
&
info
))
if
(
!
error
&&
table
->
next_number_field
)
// Clear for next record
DBUG_RETURN
(
1
);
if
(
table
->
next_number_field
)
// Clear for next record
{
{
table
->
next_number_field
->
reset
();
table
->
next_number_field
->
reset
();
if
(
!
last_insert_id
&&
thd
->
insert_id_used
)
if
(
!
last_insert_id
&&
thd
->
insert_id_used
)
last_insert_id
=
thd
->
insert_id
();
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
)
void
select_insert
::
send_error
(
uint
errcode
,
const
char
*
err
)
{
{
DBUG_ENTER
(
"select_insert::send_error"
);
DBUG_ENTER
(
"select_insert::send_error"
);
...
@@ -1637,7 +1643,6 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
...
@@ -1637,7 +1643,6 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
table
->
next_number_field
=
table
->
found_next_number_field
;
table
->
next_number_field
=
table
->
found_next_number_field
;
restore_record
(
table
,
default_values
);
// Get empty record
restore_record
(
table
,
default_values
);
// Get empty record
thd
->
count_cuted_fields
=
CHECK_FIELD_WARN
;
// count warnings
thd
->
cuted_fields
=
0
;
thd
->
cuted_fields
=
0
;
if
(
info
.
handle_duplicates
==
DUP_IGNORE
||
if
(
info
.
handle_duplicates
==
DUP_IGNORE
||
info
.
handle_duplicates
==
DUP_REPLACE
)
info
.
handle_duplicates
==
DUP_REPLACE
)
...
@@ -1647,23 +1652,9 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
...
@@ -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
);
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
;
}
}
...
@@ -1711,7 +1702,7 @@ void select_create::abort()
...
@@ -1711,7 +1702,7 @@ void select_create::abort()
enum
db_type
table_type
=
table
->
db_type
;
enum
db_type
table_type
=
table
->
db_type
;
if
(
!
table
->
tmp_table
)
if
(
!
table
->
tmp_table
)
{
{
ulong
version
=
table
->
version
;
ulong
version
=
table
->
version
;
hash_delete
(
&
open_cache
,(
byte
*
)
table
);
hash_delete
(
&
open_cache
,(
byte
*
)
table
);
if
(
!
create_info
->
table_existed
)
if
(
!
create_info
->
table_existed
)
quick_rm_table
(
table_type
,
db
,
name
);
quick_rm_table
(
table_type
,
db
,
name
);
...
...
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