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
01f39762
Commit
01f39762
authored
Feb 20, 2020
by
Isaac Ackerman
Committed by
Sergei Petrunia
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track sysvars that change pushdown execution
parent
2e76114c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
8 deletions
+61
-8
storage/xpand/ha_xpand.cc
storage/xpand/ha_xpand.cc
+3
-3
storage/xpand/xpand_connection.cc
storage/xpand/xpand_connection.cc
+55
-4
storage/xpand/xpand_connection.h
storage/xpand/xpand_connection.h
+3
-1
No files found.
storage/xpand/ha_xpand.cc
View file @
01f39762
...
...
@@ -253,7 +253,7 @@ xpand_connection *get_trx(THD *thd, int *error_code)
xpand_connection
*
trx
;
if
(
!
(
trx
=
(
xpand_connection
*
)
thd_get_ha_data
(
thd
,
xpand_hton
)))
{
if
(
!
(
trx
=
new
xpand_connection
()))
{
if
(
!
(
trx
=
new
xpand_connection
(
thd
)))
{
*
error_code
=
HA_ERR_OUT_OF_MEM
;
return
NULL
;
}
...
...
@@ -1264,7 +1264,7 @@ static int xpand_discover_table_names(handlerton *hton, LEX_CSTRING *db,
MY_DIR
*
dir
,
handlerton
::
discovered_list
*
result
)
{
xpand_connection
*
xpand_net
=
new
xpand_connection
();
xpand_connection
*
xpand_net
=
new
xpand_connection
(
NULL
);
int
error_code
=
xpand_net
->
connect
();
if
(
error_code
)
goto
err
;
...
...
@@ -1278,7 +1278,7 @@ static int xpand_discover_table_names(handlerton *hton, LEX_CSTRING *db,
int
xpand_discover_table
(
handlerton
*
hton
,
THD
*
thd
,
TABLE_SHARE
*
share
)
{
xpand_connection
*
xpand_net
=
new
xpand_connection
();
xpand_connection
*
xpand_net
=
new
xpand_connection
(
NULL
);
int
error_code
=
xpand_net
->
connect
();
if
(
error_code
)
goto
err
;
...
...
storage/xpand/xpand_connection.cc
View file @
01f39762
...
...
@@ -6,9 +6,15 @@ Copyright (c) 2019, MariaDB Corporation.
#include "xpand_connection.h"
#include <string>
#include "errmsg.h"
#include "handler.h"
#include "table.h"
#include "sql_class.h"
#include "tztime.h"
//#include "errmsg.h"
//name conflicts on macro ER with sql_class.h
#define CR_CONNECTION_ERROR 2002
#define CR_CONN_HOST_ERROR 2003
extern
int
xpand_connect_timeout
;
extern
int
xpand_read_timeout
;
...
...
@@ -82,8 +88,8 @@ enum xpand_commands {
/****************************************************************************
** Class xpand_connection
****************************************************************************/
xpand_connection
::
xpand_connection
()
:
command_buffer
(
NULL
),
command_buffer_length
(
0
),
command_length
(
0
),
xpand_connection
::
xpand_connection
(
THD
*
parent_thd
)
:
session
(
parent_thd
),
command_buffer
(
NULL
),
command_buffer_length
(
0
),
command_length
(
0
),
trans_state
(
XPAND_TRANS_NONE
),
trans_flags
(
XPAND_TRANS_NO_POST_FLAGS
)
{
DBUG_ENTER
(
"xpand_connection::xpand_connection"
);
...
...
@@ -198,6 +204,43 @@ int xpand_connection::connect()
DBUG_RETURN
(
0
);
}
int
xpand_connection
::
add_status_vars
()
{
DBUG_ENTER
(
"xpand_connection::add_status_vars"
);
assert
(
session
);
int
error_code
=
0
;
system_variables
vars
=
session
->
variables
;
if
((
error_code
=
add_command_operand_uchar
(
1
)))
DBUG_RETURN
(
error_code
);
//sql mode
if
((
error_code
=
add_command_operand_ulonglong
(
vars
.
sql_mode
)))
DBUG_RETURN
(
error_code
);
//auto increment state
if
((
error_code
=
add_command_operand_ushort
(
vars
.
auto_increment_increment
)))
DBUG_RETURN
(
error_code
);
if
((
error_code
=
add_command_operand_ushort
(
vars
.
auto_increment_offset
)))
DBUG_RETURN
(
error_code
);
//character set and collation
if
((
error_code
=
add_command_operand_ushort
(
vars
.
character_set_client
->
number
)))
DBUG_RETURN
(
error_code
);
if
((
error_code
=
add_command_operand_ushort
(
vars
.
collation_connection
->
number
)))
DBUG_RETURN
(
error_code
);
if
((
error_code
=
add_command_operand_ushort
(
vars
.
collation_server
->
number
)))
DBUG_RETURN
(
error_code
);
//timezone and time names
String
tzone
;
//convert to utf8
vars
.
time_zone
->
get_name
()
->
print
(
&
tzone
,
get_charset
(
33
,
0
));
if
((
error_code
=
add_command_operand_str
((
const
uchar
*
)
tzone
.
ptr
(),
tzone
.
length
())))
DBUG_RETURN
(
error_code
);
if
((
error_code
=
add_command_operand_ushort
(
vars
.
lc_time_names
->
number
)))
DBUG_RETURN
(
error_code
);
//transaction isolation
if
((
error_code
=
add_command_operand_uchar
(
vars
.
tx_isolation
)))
DBUG_RETURN
(
error_code
);
DBUG_RETURN
(
0
);
}
int
xpand_connection
::
begin_command
(
uchar
command
)
{
if
(
trans_state
==
XPAND_TRANS_NONE
)
...
...
@@ -211,6 +254,11 @@ int xpand_connection::begin_command(uchar command)
if
((
error_code
=
add_command_operand_uchar
(
trans_state
|
trans_flags
)))
return
error_code
;
if
(
trans_state
&
XPAND_TRANS_NEW_STMT
||
trans_state
&
XPAND_TRANS_REQUESTED
)
if
((
error_code
=
add_status_vars
()))
return
error_code
;
return
error_code
;
}
...
...
@@ -620,7 +668,10 @@ class xpand_connection_cursor {
ulong
packet_length
=
cli_safe_read
(
xpand_net
);
if
(
packet_length
==
packet_error
)
{
*
stmt_completed
=
TRUE
;
DBUG_RETURN
(
mysql_errno
(
xpand_net
));
int
error_code
=
mysql_errno
(
xpand_net
);
my_printf_error
(
error_code
,
"Xpand error: %s"
,
MYF
(
0
),
mysql_error
(
xpand_net
));
DBUG_RETURN
(
error_code
);
}
unsigned
char
*
pos
=
xpand_net
->
net
.
read_pos
;
...
...
storage/xpand/xpand_connection.h
View file @
01f39762
...
...
@@ -31,6 +31,7 @@ class xpand_connection_cursor;
class
xpand_connection
{
private:
THD
*
session
;
MYSQL
xpand_net
;
uchar
*
command_buffer
;
size_t
command_buffer_length
;
...
...
@@ -41,7 +42,7 @@ class xpand_connection
int
allocate_cursor
(
MYSQL
*
xpand_net
,
ulong
buffer_size
,
xpand_connection_cursor
**
scan
);
public:
xpand_connection
();
xpand_connection
(
THD
*
parent_thd
);
~
xpand_connection
();
inline
bool
is_connected
()
...
...
@@ -116,6 +117,7 @@ class xpand_connection
int
add_command_operand_vlstr
(
const
uchar
*
str
,
size_t
length
);
int
add_command_operand_lex_string
(
LEX_CSTRING
str
);
int
add_command_operand_bitmap
(
MY_BITMAP
*
bitmap
);
int
add_status_vars
();
int
begin_command
(
uchar
command
);
int
send_command
();
int
read_query_response
();
...
...
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