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
0b2024ac
Commit
0b2024ac
authored
Jul 04, 2006
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-main
parents
904100ee
98874725
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+2
-1
sql/handler.h
sql/handler.h
+1
-0
sql/sql_update.cc
sql/sql_update.cc
+22
-3
No files found.
sql/ha_ndbcluster.cc
View file @
0b2024ac
...
...
@@ -4584,7 +4584,8 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg):
HA_NO_PREFIX_CHAR_KEYS
|
HA_NEED_READ_RANGE_BUFFER
|
HA_CAN_GEOMETRY
|
HA_CAN_BIT_FIELD
),
HA_CAN_BIT_FIELD
|
HA_PARTIAL_COLUMN_READ
),
m_share
(
0
),
m_use_write
(
FALSE
),
m_ignore_dup_key
(
FALSE
),
...
...
sql/handler.h
View file @
0b2024ac
...
...
@@ -57,6 +57,7 @@
see mi_rsame/heap_rsame/myrg_rsame
*/
#define HA_READ_RND_SAME (1 << 0)
#define HA_PARTIAL_COLUMN_READ (1 << 1)
/* read may not return all columns */
#define HA_TABLE_SCAN_ON_INDEX (1 << 2)
/* No separate data/index file */
#define HA_REC_NOT_IN_SEQ (1 << 3)
/* ha_info don't return recnumber;
It returns a position to ha_r_rnd */
...
...
sql/sql_update.cc
View file @
0b2024ac
...
...
@@ -120,6 +120,7 @@ int mysql_update(THD *thd,
bool
using_limit
=
limit
!=
HA_POS_ERROR
;
bool
safe_update
=
thd
->
options
&
OPTION_SAFE_UPDATES
;
bool
used_key_is_modified
,
transactional_table
;
bool
can_compare_record
;
int
res
;
int
error
;
uint
used_index
=
MAX_KEY
;
...
...
@@ -433,6 +434,13 @@ int mysql_update(THD *thd,
(
MODE_STRICT_TRANS_TABLES
|
MODE_STRICT_ALL_TABLES
)));
/*
We can use compare_record() to optimize away updates if
the table handler is returning all columns
*/
can_compare_record
=
!
(
table
->
file
->
table_flags
()
&
HA_PARTIAL_COLUMN_READ
);
while
(
!
(
error
=
info
.
read_record
(
&
info
))
&&
!
thd
->
killed
)
{
if
(
!
(
select
&&
select
->
skip_record
()))
...
...
@@ -445,7 +453,7 @@ int mysql_update(THD *thd,
found
++
;
if
(
compare_record
(
table
,
query_id
))
if
(
!
can_compare_record
||
compare_record
(
table
,
query_id
))
{
if
((
res
=
table_list
->
view_check_option
(
thd
,
ignore
))
!=
VIEW_CHECK_OK
)
...
...
@@ -1248,8 +1256,15 @@ bool multi_update::send_data(List<Item> ¬_used_values)
uint
offset
=
cur_table
->
shared
;
table
->
file
->
position
(
table
->
record
[
0
]);
/*
We can use compare_record() to optimize away updates if
the table handler is returning all columns
*/
if
(
table
==
table_to_update
)
{
bool
can_compare_record
;
can_compare_record
=
!
(
table
->
file
->
table_flags
()
&
HA_PARTIAL_COLUMN_READ
);
table
->
status
|=
STATUS_UPDATED
;
store_record
(
table
,
record
[
1
]);
if
(
fill_record_n_invoke_before_triggers
(
thd
,
*
fields_for_table
[
offset
],
...
...
@@ -1259,7 +1274,7 @@ bool multi_update::send_data(List<Item> ¬_used_values)
DBUG_RETURN
(
1
);
found
++
;
if
(
compare_record
(
table
,
thd
->
query_id
))
if
(
!
can_compare_record
||
compare_record
(
table
,
thd
->
query_id
))
{
int
error
;
if
((
error
=
cur_table
->
view_check_option
(
thd
,
ignore
))
!=
...
...
@@ -1376,6 +1391,7 @@ int multi_update::do_updates(bool from_send_error)
for
(
cur_table
=
update_tables
;
cur_table
;
cur_table
=
cur_table
->
next_local
)
{
byte
*
ref_pos
;
bool
can_compare_record
;
table
=
cur_table
->
table
;
if
(
table
==
table_to_update
)
...
...
@@ -1402,6 +1418,9 @@ int multi_update::do_updates(bool from_send_error)
if
((
local_error
=
tmp_table
->
file
->
ha_rnd_init
(
1
)))
goto
err
;
can_compare_record
=
!
(
table
->
file
->
table_flags
()
&
HA_PARTIAL_COLUMN_READ
);
ref_pos
=
(
byte
*
)
tmp_table
->
field
[
0
]
->
ptr
;
for
(;;)
{
...
...
@@ -1431,7 +1450,7 @@ int multi_update::do_updates(bool from_send_error)
TRG_ACTION_BEFORE
,
TRUE
))
goto
err2
;
if
(
compare_record
(
table
,
thd
->
query_id
))
if
(
!
can_compare_record
||
compare_record
(
table
,
thd
->
query_id
))
{
if
((
local_error
=
table
->
file
->
update_row
(
table
->
record
[
1
],
table
->
record
[
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