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
c45ae5f0
Commit
c45ae5f0
authored
Jun 13, 2019
by
Will DeVries
Committed by
Sergei Petrunia
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify delete_table and fix a few little things.
parent
f53c6535
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
24 deletions
+12
-24
storage/clustrixdb/clustrix_connection.cc
storage/clustrixdb/clustrix_connection.cc
+4
-3
storage/clustrixdb/ha_clustrixdb.cc
storage/clustrixdb/ha_clustrixdb.cc
+8
-21
No files found.
storage/clustrixdb/clustrix_connection.cc
View file @
c45ae5f0
...
@@ -413,8 +413,9 @@ int clustrix_connection::discover_table_details(LEX_CSTRING *db,
...
@@ -413,8 +413,9 @@ int clustrix_connection::discover_table_details(LEX_CSTRING *db,
get_oid
.
append
(
"'"
);
get_oid
.
append
(
"'"
);
if
(
mysql_real_query
(
&
clustrix_net
,
get_oid
.
c_ptr
(),
get_oid
.
length
()))
{
if
(
mysql_real_query
(
&
clustrix_net
,
get_oid
.
c_ptr
(),
get_oid
.
length
()))
{
if
((
error_code
=
mysql_errno
(
&
clustrix_net
)))
{
if
((
error_code
=
mysql_errno
(
&
clustrix_net
)))
{
error_code
=
HA_ERR_NO_SUCH_TABLE
;
DBUG_PRINT
(
"mysql_real_query returns "
,
(
"%d"
,
error_code
));
goto
error
;
error_code
=
HA_ERR_NO_SUCH_TABLE
;
goto
error
;
}
}
}
}
...
@@ -450,7 +451,7 @@ int clustrix_connection::discover_table_details(LEX_CSTRING *db,
...
@@ -450,7 +451,7 @@ int clustrix_connection::discover_table_details(LEX_CSTRING *db,
show
.
append
(
name
);
show
.
append
(
name
);
if
(
mysql_real_query
(
&
clustrix_net
,
show
.
c_ptr
(),
show
.
length
()))
{
if
(
mysql_real_query
(
&
clustrix_net
,
show
.
c_ptr
(),
show
.
length
()))
{
if
((
error_code
=
mysql_errno
(
&
clustrix_net
)))
{
if
((
error_code
=
mysql_errno
(
&
clustrix_net
)))
{
DBUG_PRINT
(
"mysql_real_query returns "
,(
"%d"
,
error_code
));
DBUG_PRINT
(
"mysql_real_query returns "
,
(
"%d"
,
error_code
));
error_code
=
HA_ERR_NO_SUCH_TABLE
;
error_code
=
HA_ERR_NO_SUCH_TABLE
;
goto
error
;
goto
error
;
}
}
...
...
storage/clustrixdb/ha_clustrixdb.cc
View file @
c45ae5f0
...
@@ -230,24 +230,15 @@ int ha_clustrixdb::delete_table(const char *name)
...
@@ -230,24 +230,15 @@ int ha_clustrixdb::delete_table(const char *name)
// This block isn't UTF aware yet.
// This block isn't UTF aware yet.
// The format contains './' in the beginning of a path.
// The format contains './' in the beginning of a path.
char
*
ptr
=
(
char
*
)
name
+
2
;
char
*
dbname_end
=
(
char
*
)
name
+
2
;
while
(
*
ptr
!=
'/'
)
while
(
*
dbname_end
!=
'/'
)
{
dbname_end
++
;
ptr
++
;
}
*
ptr
=
'\0'
;
String
db_name
;
db_name
.
append
(
name
+
2
);
*
ptr
=
'/'
;
ptr
++
;
String
tbl_name
;
tbl_name
.
append
(
ptr
);
String
delete_cmd
;
String
delete_cmd
;
delete_cmd
.
append
(
"DROP TABLE `"
);
delete_cmd
.
append
(
"DROP TABLE `"
);
delete_cmd
.
append
(
db_name
);
delete_cmd
.
append
(
name
+
2
,
dbname_end
-
name
-
2
);
delete_cmd
.
append
(
"`.`"
);
delete_cmd
.
append
(
"`.`"
);
delete_cmd
.
append
(
tbl_name
);
delete_cmd
.
append
(
dbname_end
+
1
);
delete_cmd
.
append
(
"`"
);
delete_cmd
.
append
(
"`"
);
return
trx
->
clustrix_net
->
delete_table
(
delete_cmd
);
return
trx
->
clustrix_net
->
delete_table
(
delete_cmd
);
...
@@ -307,11 +298,9 @@ int ha_clustrixdb::write_row(uchar *buf)
...
@@ -307,11 +298,9 @@ int ha_clustrixdb::write_row(uchar *buf)
packed_new_row
,
packed_size
)))
packed_new_row
,
packed_size
)))
goto
err
;
goto
err
;
{
Field
*
auto_inc_field
=
table
->
next_number_field
;
Field
*
auto_inc_field
=
table
->
next_number_field
;
if
(
auto_inc_field
)
if
(
auto_inc_field
)
insert_id_for_cur_row
=
trx
->
clustrix_net
->
last_insert_id
;
insert_id_for_cur_row
=
trx
->
clustrix_net
->
last_insert_id
;
}
err:
err:
if
(
packed_size
)
if
(
packed_size
)
...
@@ -505,7 +494,6 @@ int ha_clustrixdb::index_read(uchar * buf, const uchar * key, uint key_len,
...
@@ -505,7 +494,6 @@ int ha_clustrixdb::index_read(uchar * buf, const uchar * key, uint key_len,
&
master_reclength
,
rowdata
+
rowdata_length
)))
&
master_reclength
,
rowdata
+
rowdata_length
)))
goto
err
;
goto
err
;
error_code
=
0
;
err:
err:
if
(
packed_key
)
if
(
packed_key
)
my_afree
(
packed_key
);
my_afree
(
packed_key
);
...
@@ -728,7 +716,6 @@ int ha_clustrixdb::rnd_pos(uchar * buf, uchar *pos)
...
@@ -728,7 +716,6 @@ int ha_clustrixdb::rnd_pos(uchar * buf, uchar *pos)
&
master_reclength
,
rowdata
+
rowdata_length
)))
&
master_reclength
,
rowdata
+
rowdata_length
)))
goto
err
;
goto
err
;
error_code
=
0
;
err:
err:
if
(
packed_key
)
if
(
packed_key
)
...
...
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