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
77eb6e50
Commit
77eb6e50
authored
Mar 12, 2003
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better fix for "Halloween" effect ...
parent
51e5344d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
sql/ha_innodb.h
sql/ha_innodb.h
+2
-1
sql/handler.h
sql/handler.h
+1
-0
sql/sql_class.h
sql/sql_class.h
+2
-2
sql/sql_update.cc
sql/sql_update.cc
+6
-8
No files found.
sql/ha_innodb.h
View file @
77eb6e50
...
@@ -82,7 +82,8 @@ class ha_innobase: public handler
...
@@ -82,7 +82,8 @@ class ha_innobase: public handler
HA_PRIMARY_KEY_IN_READ_INDEX
|
HA_PRIMARY_KEY_IN_READ_INDEX
|
HA_DROP_BEFORE_CREATE
|
HA_DROP_BEFORE_CREATE
|
HA_NO_PREFIX_CHAR_KEYS
|
HA_NO_PREFIX_CHAR_KEYS
|
HA_TABLE_SCAN_ON_INDEX
),
HA_TABLE_SCAN_ON_INDEX
|
HA_NOT_MULTI_UPDATE
),
last_dup_key
((
uint
)
-
1
),
last_dup_key
((
uint
)
-
1
),
start_of_scan
(
0
)
start_of_scan
(
0
)
{
{
...
...
sql/handler.h
View file @
77eb6e50
...
@@ -67,6 +67,7 @@
...
@@ -67,6 +67,7 @@
#define HA_CAN_FULLTEXT (HA_NO_PREFIX_CHAR_KEYS*2)
#define HA_CAN_FULLTEXT (HA_NO_PREFIX_CHAR_KEYS*2)
#define HA_CAN_SQL_HANDLER (HA_CAN_FULLTEXT*2)
#define HA_CAN_SQL_HANDLER (HA_CAN_FULLTEXT*2)
#define HA_NO_AUTO_INCREMENT (HA_CAN_SQL_HANDLER*2)
#define HA_NO_AUTO_INCREMENT (HA_CAN_SQL_HANDLER*2)
#define HA_NOT_MULTI_UPDATE (HA_NO_AUTO_INCREMENT*2)
/*
/*
Next record gives next record according last record read (even
Next record gives next record according last record read (even
...
...
sql/sql_class.h
View file @
77eb6e50
...
@@ -823,7 +823,7 @@ class multi_update : public select_result
...
@@ -823,7 +823,7 @@ class multi_update : public select_result
{
{
TABLE_LIST
*
all_tables
,
*
update_tables
,
*
table_being_updated
;
TABLE_LIST
*
all_tables
,
*
update_tables
,
*
table_being_updated
;
THD
*
thd
;
THD
*
thd
;
TABLE
**
tmp_tables
,
*
main_table
;
TABLE
**
tmp_tables
,
*
main_table
,
*
table_to_update
;
TMP_TABLE_PARAM
*
tmp_table_param
;
TMP_TABLE_PARAM
*
tmp_table_param
;
ha_rows
updated
,
found
;
ha_rows
updated
,
found
;
List
<
Item
>
*
fields
,
*
values
;
List
<
Item
>
*
fields
,
*
values
;
...
@@ -831,7 +831,7 @@ class multi_update : public select_result
...
@@ -831,7 +831,7 @@ class multi_update : public select_result
uint
table_count
;
uint
table_count
;
Copy_field
*
copy_field
;
Copy_field
*
copy_field
;
enum
enum_duplicates
handle_duplicates
;
enum
enum_duplicates
handle_duplicates
;
bool
do_update
,
trans_safe
,
transactional_tables
,
log_delayed
,
on_the_fly
;
bool
do_update
,
trans_safe
,
transactional_tables
,
log_delayed
;
public:
public:
multi_update
(
THD
*
thd_arg
,
TABLE_LIST
*
ut
,
List
<
Item
>
*
fields
,
multi_update
(
THD
*
thd_arg
,
TABLE_LIST
*
ut
,
List
<
Item
>
*
fields
,
...
...
sql/sql_update.cc
View file @
77eb6e50
...
@@ -413,7 +413,7 @@ multi_update::multi_update(THD *thd_arg, TABLE_LIST *table_list,
...
@@ -413,7 +413,7 @@ multi_update::multi_update(THD *thd_arg, TABLE_LIST *table_list,
:
all_tables
(
table_list
),
update_tables
(
0
),
thd
(
thd_arg
),
tmp_tables
(
0
),
:
all_tables
(
table_list
),
update_tables
(
0
),
thd
(
thd_arg
),
tmp_tables
(
0
),
updated
(
0
),
found
(
0
),
fields
(
field_list
),
values
(
value_list
),
updated
(
0
),
found
(
0
),
fields
(
field_list
),
values
(
value_list
),
table_count
(
0
),
copy_field
(
0
),
handle_duplicates
(
handle_duplicates_arg
),
table_count
(
0
),
copy_field
(
0
),
handle_duplicates
(
handle_duplicates_arg
),
do_update
(
1
),
trans_safe
(
0
)
,
on_the_fly
(
1
)
do_update
(
1
),
trans_safe
(
0
)
{}
{}
...
@@ -538,15 +538,13 @@ multi_update::initialize_tables(JOIN *join)
...
@@ -538,15 +538,13 @@ multi_update::initialize_tables(JOIN *join)
main_table
=
join
->
join_tab
->
table
;
main_table
=
join
->
join_tab
->
table
;
trans_safe
=
transactional_tables
=
main_table
->
file
->
has_transactions
();
trans_safe
=
transactional_tables
=
main_table
->
file
->
has_transactions
();
log_delayed
=
trans_safe
||
main_table
->
tmp_table
!=
NO_TMP_TABLE
;
log_delayed
=
trans_safe
||
main_table
->
tmp_table
!=
NO_TMP_TABLE
;
#ifdef HAVE_INNOBASE_DB
table_to_update
=
(
main_table
->
file
->
table_flags
()
&
HA_NOT_MULTI_UPDATE
)
?
if
(
main_table
->
db_type
==
DB_TYPE_INNODB
)
(
TABLE
*
)
0
:
main_table
;
on_the_fly
=
0
;
#endif
/* Create a temporary table for all tables after except main table */
/* Create a temporary table for all tables after except main table */
for
(
table_ref
=
update_tables
;
table_ref
;
table_ref
=
table_ref
->
next
)
for
(
table_ref
=
update_tables
;
table_ref
;
table_ref
=
table_ref
->
next
)
{
{
TABLE
*
table
=
table_ref
->
table
;
TABLE
*
table
=
table_ref
->
table
;
if
(
!
on_the_fly
||
table
!=
main_tabl
e
)
if
(
table
!=
table_to_updat
e
)
{
{
uint
cnt
=
table_ref
->
shared
;
uint
cnt
=
table_ref
->
shared
;
ORDER
group
;
ORDER
group
;
...
@@ -626,7 +624,7 @@ bool multi_update::send_data(List<Item> ¬_used_values)
...
@@ -626,7 +624,7 @@ bool multi_update::send_data(List<Item> ¬_used_values)
uint
offset
=
cur_table
->
shared
;
uint
offset
=
cur_table
->
shared
;
table
->
file
->
position
(
table
->
record
[
0
]);
table
->
file
->
position
(
table
->
record
[
0
]);
if
(
on_the_fly
&&
table
==
main_tabl
e
)
if
(
table
==
table_to_updat
e
)
{
{
table
->
status
|=
STATUS_UPDATED
;
table
->
status
|=
STATUS_UPDATED
;
store_record
(
table
,
1
);
store_record
(
table
,
1
);
...
@@ -719,7 +717,7 @@ int multi_update::do_updates(bool from_send_error)
...
@@ -719,7 +717,7 @@ int multi_update::do_updates(bool from_send_error)
for
(
cur_table
=
update_tables
;
cur_table
;
cur_table
=
cur_table
->
next
)
for
(
cur_table
=
update_tables
;
cur_table
;
cur_table
=
cur_table
->
next
)
{
{
table
=
cur_table
->
table
;
table
=
cur_table
->
table
;
if
(
on_the_fly
&&
table
==
main_tabl
e
)
if
(
table
==
table_to_updat
e
)
continue
;
// Already updated
continue
;
// Already updated
org_updated
=
updated
;
org_updated
=
updated
;
...
...
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