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
37a5b125
Commit
37a5b125
authored
Feb 21, 2020
by
Will DeVries
Committed by
Sergei Petrunia
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add table synchronization for direct update.
parent
d4ae797b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
+19
-4
storage/xpand/ha_xpand.cc
storage/xpand/ha_xpand.cc
+10
-2
storage/xpand/xpand_connection.cc
storage/xpand/xpand_connection.cc
+7
-1
storage/xpand/xpand_connection.h
storage/xpand/xpand_connection.h
+2
-1
No files found.
storage/xpand/ha_xpand.cc
View file @
37a5b125
...
...
@@ -626,13 +626,17 @@ int ha_xpand::write_row(const uchar *buf)
if
(
!
thd_test_options
(
thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
trx
->
auto_commit_next
();
error_code
=
trx
->
update_query
(
update_stmt
,
table
->
s
->
db
,
&
update_rows
);
ulonglong
*
oids
=
xpand_extract_table_oids
(
thd
,
thd
->
lex
);
error_code
=
trx
->
update_query
(
update_stmt
,
table
->
s
->
db
,
oids
,
&
update_rows
);
if
(
upsert_flag
&
XPAND_BULK_UPSERT
)
upsert_flag
|=
XPAND_UPSERT_SENT
;
else
upsert_flag
&=
~
XPAND_HAS_UPSERT
;
}
if
(
error_code
==
HA_ERR_TABLE_DEF_CHANGED
)
xpand_mark_tables_for_discovery
(
thd
->
lex
);
return
error_code
;
}
...
...
@@ -721,8 +725,12 @@ int ha_xpand::direct_update_rows(ha_rows *update_rows, ha_rows *found_rows)
if
(
!
thd_test_options
(
thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
trx
->
auto_commit_next
();
error_code
=
trx
->
update_query
(
update_stmt
,
table
->
s
->
db
,
update_rows
);
ulonglong
*
oids
=
xpand_extract_table_oids
(
thd
,
thd
->
lex
);
error_code
=
trx
->
update_query
(
update_stmt
,
table
->
s
->
db
,
oids
,
update_rows
);
*
found_rows
=
*
update_rows
;
if
(
error_code
==
HA_ERR_TABLE_DEF_CHANGED
)
xpand_mark_tables_for_discovery
(
thd
->
lex
);
DBUG_RETURN
(
error_code
);
}
...
...
storage/xpand/xpand_connection.cc
View file @
37a5b125
...
...
@@ -831,7 +831,7 @@ int xpand_connection::scan_query(String &stmt, uchar *fieldtype, uint fields,
* dbname ¤t database name
**/
int
xpand_connection
::
update_query
(
String
&
stmt
,
LEX_CSTRING
&
dbname
,
ulonglong
*
affected_rows
)
ulonglong
*
oids
,
ulonglong
*
affected_rows
)
{
int
error_code
;
command_length
=
0
;
...
...
@@ -839,6 +839,12 @@ int xpand_connection::update_query(String &stmt, LEX_CSTRING &dbname,
if
((
error_code
=
begin_command
(
XPAND_UPDATE_QUERY
)))
return
error_code
;
do
{
if
((
error_code
=
add_command_operand_ulonglong
(
*
oids
)))
return
error_code
;
}
while
(
*
oids
++
);
if
((
error_code
=
add_command_operand_str
((
uchar
*
)
dbname
.
str
,
dbname
.
length
)))
return
error_code
;
...
...
storage/xpand/xpand_connection.h
View file @
37a5b125
...
...
@@ -113,7 +113,8 @@ class xpand_connection
uint
null_bits_size
,
uchar
*
field_metadata
,
uint
field_metadata_size
,
ushort
row_req
,
ulonglong
*
oids
,
xpand_connection_cursor
**
scan
);
int
update_query
(
String
&
stmt
,
LEX_CSTRING
&
dbname
,
ulonglong
*
affected_rows
);
int
update_query
(
String
&
stmt
,
LEX_CSTRING
&
dbname
,
ulonglong
*
oids
,
ulonglong
*
affected_rows
);
int
scan_from_key
(
ulonglong
xpand_table_oid
,
uint
index
,
xpand_lock_mode_t
lock_mode
,
enum
scan_type
scan_dir
,
int
no_key_cols
,
bool
sorted_scan
,
...
...
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