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
154908d8
Commit
154908d8
authored
Jul 16, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge damien-katzs-computer.local:/Users/dkatz/mysql51
into damien-katzs-computer.local:/Users/dkatz/51
parents
d430edc9
fcc51efc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
8 deletions
+54
-8
sql/sql_class.h
sql/sql_class.h
+16
-4
sql/sql_insert.cc
sql/sql_insert.cc
+5
-4
tests/mysql_client_test.c
tests/mysql_client_test.c
+33
-0
No files found.
sql/sql_class.h
View file @
154908d8
...
...
@@ -65,11 +65,23 @@ typedef struct st_user_var_events
#define RP_LOCK_LOG_IS_ALREADY_LOCKED 1
#define RP_FORCE_ROTATE 2
/*
The COPY_INFO structure is used by INSERT/REPLACE code.
The schema of the row counting by the INSERT/INSERT ... ON DUPLICATE KEY
UPDATE code:
If a row is inserted then the copied variable is incremented.
If a row is updated by the INSERT ... ON DUPLICATE KEY UPDATE and the
new data differs from the old one then the copied and the updated
variables are incremented.
The touched variable is incremented if a row was touched by the update part
of the INSERT ... ON DUPLICATE KEY UPDATE no matter whether the row
was actually changed or not.
*/
typedef
struct
st_copy_info
{
ha_rows
records
;
ha_rows
deleted
;
ha_rows
updated
;
ha_rows
copied
;
ha_rows
records
;
/* Number of processed records */
ha_rows
deleted
;
/* Number of deleted records */
ha_rows
updated
;
/* Number of updated records */
ha_rows
copied
;
/* Number of copied records */
ha_rows
error_count
;
ha_rows
touched
;
/* Number of touched records */
enum
enum_duplicates
handle_duplicates
;
...
...
sql/sql_insert.cc
View file @
154908d8
...
...
@@ -661,7 +661,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
/*
Fill in the given fields and dump it to the table file
*/
info
.
records
=
info
.
deleted
=
info
.
copied
=
info
.
updated
=
0
;
bzero
((
char
*
)
&
info
,
sizeof
(
info
))
;
info
.
ignore
=
ignore
;
info
.
handle_duplicates
=
duplic
;
info
.
update_fields
=
&
update_fields
;
...
...
@@ -1421,6 +1421,10 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
goto
before_trg_err
;
table
->
file
->
restore_auto_increment
(
prev_insert_id
);
if
(
table
->
next_number_field
)
table
->
file
->
adjust_next_insert_id_after_explicit_value
(
table
->
next_number_field
->
val_int
());
info
->
touched
++
;
if
((
table
->
file
->
ha_table_flags
()
&
HA_PARTIAL_COLUMN_READ
)
||
compare_record
(
table
))
{
...
...
@@ -1448,9 +1452,6 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
handled separately by THD::arg_of_last_insert_id_function.
*/
insert_id_for_cur_row
=
table
->
file
->
insert_id_for_cur_row
=
0
;
if
(
table
->
next_number_field
)
table
->
file
->
adjust_next_insert_id_after_explicit_value
(
table
->
next_number_field
->
val_int
());
trg_error
=
(
table
->
triggers
&&
table
->
triggers
->
process_triggers
(
thd
,
TRG_EVENT_UPDATE
,
TRG_ACTION_AFTER
,
TRUE
));
...
...
tests/mysql_client_test.c
View file @
154908d8
...
...
@@ -16271,6 +16271,38 @@ static void test_bug27592()
}
/*
Bug #29692 Single row inserts can incorrectly report a huge number of
row insertions
*/
static
void
test_bug29692
()
{
MYSQL
*
conn
;
if
(
!
(
conn
=
mysql_init
(
NULL
)))
{
myerror
(
"test_bug29692 init failed"
);
exit
(
1
);
}
if
(
!
(
mysql_real_connect
(
conn
,
opt_host
,
opt_user
,
opt_password
,
opt_db
?
opt_db
:
"test"
,
opt_port
,
opt_unix_socket
,
CLIENT_FOUND_ROWS
)))
{
myerror
(
"test_bug29692 connection failed"
);
mysql_close
(
mysql
);
exit
(
1
);
}
myquery
(
mysql_query
(
conn
,
"drop table if exists t1"
));
myquery
(
mysql_query
(
conn
,
"create table t1(f1 int)"
));
myquery
(
mysql_query
(
conn
,
"insert into t1 values(1)"
));
DIE_UNLESS
(
1
==
mysql_affected_rows
(
conn
));
myquery
(
mysql_query
(
conn
,
"drop table t1"
));
mysql_close
(
conn
);
}
/*
Read and parse arguments and MySQL options from my.cnf
*/
...
...
@@ -16560,6 +16592,7 @@ static struct my_tests_st my_tests[]= {
{
"test_bug28505"
,
test_bug28505
},
{
"test_bug28934"
,
test_bug28934
},
{
"test_bug27592"
,
test_bug27592
},
{
"test_bug29692"
,
test_bug29692
},
{
0
,
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