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
b79a921f
Commit
b79a921f
authored
Feb 27, 2020
by
Will DeVries
Committed by
Sergei Petrunia
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass C strings to get_table_oid.
parent
9d2d4036
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
storage/xpand/ha_xpand.cc
storage/xpand/ha_xpand.cc
+6
-3
storage/xpand/xpand_connection.cc
storage/xpand/xpand_connection.cc
+10
-4
storage/xpand/xpand_connection.h
storage/xpand/xpand_connection.h
+2
-2
No files found.
storage/xpand/ha_xpand.cc
View file @
b79a921f
...
...
@@ -434,8 +434,9 @@ int ha_xpand::create(const char *name, TABLE *form, HA_CREATE_INFO *info)
return
error_code
;
// Load the oid of the created table
error_code
=
trx
->
get_table_oid
(
norm_db
,
norm_table
,
&
xpand_table_oid
,
table_share
);
error_code
=
trx
->
get_table_oid
(
norm_db
.
c_str
(),
strlen
(
norm_db
.
c_str
()),
norm_table
.
c_str
(),
strlen
(
norm_table
.
c_str
()),
&
xpand_table_oid
,
table_share
);
return
error_code
;
}
...
...
@@ -558,7 +559,9 @@ int ha_xpand::open(const char *name, int mode, uint test_if_locked)
if
((
error_code
=
normalize_tablename
(
name
,
&
norm_db
,
&
norm_table
)))
DBUG_RETURN
(
error_code
);
error_code
=
trx
->
get_table_oid
(
norm_db
,
norm_table
,
&
xpand_table_oid
,
error_code
=
trx
->
get_table_oid
(
norm_db
.
c_str
(),
strlen
(
norm_db
.
c_str
()),
norm_table
.
c_str
(),
strlen
(
norm_table
.
c_str
()),
&
xpand_table_oid
,
table_share
);
if
(
error_code
)
DBUG_RETURN
(
error_code
);
...
...
storage/xpand/xpand_connection.cc
View file @
b79a921f
...
...
@@ -1022,8 +1022,8 @@ int xpand_connection::populate_table_list(LEX_CSTRING *db,
error code if an error occurred
*/
int
xpand_connection
::
get_table_oid
(
const
std
::
string
&
db
,
const
std
::
string
&
name
,
int
xpand_connection
::
get_table_oid
(
const
char
*
db
,
size_t
db_len
,
const
char
*
name
,
size_t
name_len
,
ulonglong
*
oid
,
TABLE_SHARE
*
share
)
{
...
...
@@ -1038,9 +1038,9 @@ int xpand_connection::get_table_oid(const std::string &db,
"from system.databases d "
" inner join ""system.relations r on d.db = r.db "
"where d.name = '"
);
get_oid
.
append
(
db
.
c_str
()
);
get_oid
.
append
(
db
,
db_len
);
get_oid
.
append
(
"' and r.name = '"
);
get_oid
.
append
(
name
.
c_str
()
);
get_oid
.
append
(
name
,
name_len
);
get_oid
.
append
(
"'"
);
if
(
mysql_real_query
(
&
xpand_net
,
get_oid
.
c_ptr
(),
get_oid
.
length
()))
{
...
...
@@ -1094,6 +1094,12 @@ int xpand_connection::discover_table_details(LEX_CSTRING *db, LEX_CSTRING *name,
MYSQL_RES
*
results_create
=
NULL
;
MYSQL_ROW
row
;
String
show
;
ulonglong
oid
;
if
((
error_code
=
xpand_connection
::
get_table_oid
(
db
->
str
,
db
->
length
,
name
->
str
,
name
->
length
,
&
oid
,
share
)))
goto
error
;
/* get show create statement */
show
.
append
(
"show simple create table "
);
...
...
storage/xpand/xpand_connection.h
View file @
b79a921f
...
...
@@ -110,8 +110,8 @@ class xpand_connection
int
scan_end
(
xpand_connection_cursor
*
scan
);
int
populate_table_list
(
LEX_CSTRING
*
db
,
handlerton
::
discovered_list
*
result
);
int
get_table_oid
(
const
std
::
string
&
db
,
const
std
::
string
&
name
,
ulonglong
*
oid
,
TABLE_SHARE
*
share
);
int
get_table_oid
(
const
char
*
db
,
size_t
db_len
,
const
char
*
name
,
size_t
name_len
,
ulonglong
*
oid
,
TABLE_SHARE
*
share
);
int
discover_table_details
(
LEX_CSTRING
*
db
,
LEX_CSTRING
*
name
,
THD
*
thd
,
TABLE_SHARE
*
share
);
...
...
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