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
081a2847
Commit
081a2847
authored
May 31, 2022
by
Kazzix
Committed by
GitHub
May 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-28360 Spider: remove #ifdef SPIDER_use_LEX_CSTRING_for_KEY_Field_name
Reviewed by: Nayuta Yanagisawa
parent
b3df1ec9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
51 deletions
+0
-51
storage/spider/spd_db_conn.cc
storage/spider/spd_db_conn.cc
+0
-45
storage/spider/spd_db_mysql.cc
storage/spider/spd_db_mysql.cc
+0
-5
storage/spider/spd_include.h
storage/spider/spd_include.h
+0
-1
No files found.
storage/spider/spd_db_conn.cc
View file @
081a2847
...
@@ -1630,13 +1630,8 @@ int spider_db_append_key_where_internal(
...
@@ -1630,13 +1630,8 @@ int spider_db_append_key_where_internal(
if
(
sql_kind
==
SPIDER_SQL_KIND_HANDLER
)
if
(
sql_kind
==
SPIDER_SQL_KIND_HANDLER
)
{
{
#ifdef SPIDER_use_LEX_CSTRING_for_KEY_Field_name
const
char
*
key_name
=
key_info
->
name
.
str
;
const
char
*
key_name
=
key_info
->
name
.
str
;
key_name_length
=
key_info
->
name
.
length
;
key_name_length
=
key_info
->
name
.
length
;
#else
const
char
*
key_name
=
key_info
->
name
;
key_name_length
=
strlen
(
key_name
);
#endif
if
(
str
->
reserve
(
SPIDER_SQL_READ_LEN
+
if
(
str
->
reserve
(
SPIDER_SQL_READ_LEN
+
/* SPIDER_SQL_NAME_QUOTE_LEN */
2
+
key_name_length
))
/* SPIDER_SQL_NAME_QUOTE_LEN */
2
+
key_name_length
))
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
...
@@ -8167,13 +8162,8 @@ int spider_db_open_item_ident(
...
@@ -8167,13 +8162,8 @@ int spider_db_open_item_ident(
}
}
if
(
str
)
if
(
str
)
{
{
#ifdef SPIDER_use_LEX_CSTRING_for_KEY_Field_name
if
(
item_ident
->
field_name
.
str
)
if
(
item_ident
->
field_name
.
str
)
field_name_length
=
item_ident
->
field_name
.
length
;
field_name_length
=
item_ident
->
field_name
.
length
;
#else
if
(
item_ident
->
field_name
)
field_name_length
=
strlen
(
item_ident
->
field_name
);
#endif
else
else
field_name_length
=
0
;
field_name_length
=
0
;
if
(
share
->
access_charset
->
cset
==
system_charset_info
->
cset
)
if
(
share
->
access_charset
->
cset
==
system_charset_info
->
cset
)
...
@@ -8184,14 +8174,9 @@ int spider_db_open_item_ident(
...
@@ -8184,14 +8174,9 @@ int spider_db_open_item_ident(
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
}
}
str
->
q_append
(
alias
,
alias_length
);
str
->
q_append
(
alias
,
alias_length
);
#ifdef SPIDER_use_LEX_CSTRING_for_KEY_Field_name
if
((
error_num
=
spider_dbton
[
dbton_id
].
db_util
->
if
((
error_num
=
spider_dbton
[
dbton_id
].
db_util
->
append_escaped_name
(
str
,
item_ident
->
field_name
.
str
,
append_escaped_name
(
str
,
item_ident
->
field_name
.
str
,
field_name_length
)))
field_name_length
)))
#else
if
((
error_num
=
spider_dbton
[
dbton_id
].
db_util
->
append_escaped_name
(
str
,
item_ident
->
field_name
,
field_name_length
)))
#endif
{
{
DBUG_RETURN
(
error_num
);
DBUG_RETURN
(
error_num
);
}
}
...
@@ -8199,15 +8184,9 @@ int spider_db_open_item_ident(
...
@@ -8199,15 +8184,9 @@ int spider_db_open_item_ident(
if
(
str
->
reserve
(
alias_length
))
if
(
str
->
reserve
(
alias_length
))
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
str
->
q_append
(
alias
,
alias_length
);
str
->
q_append
(
alias
,
alias_length
);
#ifdef SPIDER_use_LEX_CSTRING_for_KEY_Field_name
if
((
error_num
=
spider_dbton
[
dbton_id
].
db_util
->
if
((
error_num
=
spider_dbton
[
dbton_id
].
db_util
->
append_escaped_name_with_charset
(
str
,
item_ident
->
field_name
.
str
,
append_escaped_name_with_charset
(
str
,
item_ident
->
field_name
.
str
,
field_name_length
,
system_charset_info
)))
field_name_length
,
system_charset_info
)))
#else
if
((
error_num
=
spider_dbton
[
dbton_id
].
db_util
->
append_escaped_name_with_charset
(
str
,
item_ident
->
field_name
,
field_name_length
,
system_charset_info
)))
#endif
{
{
DBUG_RETURN
(
error_num
);
DBUG_RETURN
(
error_num
);
}
}
...
@@ -8318,7 +8297,6 @@ int spider_db_open_item_ref(
...
@@ -8318,7 +8297,6 @@ int spider_db_open_item_ref(
DBUG_ENTER
(
"spider_db_open_item_ref"
);
DBUG_ENTER
(
"spider_db_open_item_ref"
);
if
(
item_ref
->
ref
)
if
(
item_ref
->
ref
)
{
{
#ifdef SPIDER_use_LEX_CSTRING_for_KEY_Field_name
if
(
if
(
(
*
(
item_ref
->
ref
))
->
type
()
!=
Item
::
CACHE_ITEM
&&
(
*
(
item_ref
->
ref
))
->
type
()
!=
Item
::
CACHE_ITEM
&&
item_ref
->
ref_type
()
!=
Item_ref
::
VIEW_REF
&&
item_ref
->
ref_type
()
!=
Item_ref
::
VIEW_REF
&&
...
@@ -8326,34 +8304,16 @@ int spider_db_open_item_ref(
...
@@ -8326,34 +8304,16 @@ int spider_db_open_item_ref(
item_ref
->
name
.
str
&&
item_ref
->
name
.
str
&&
item_ref
->
alias_name_used
item_ref
->
alias_name_used
)
)
#else
if
(
(
*
(
item_ref
->
ref
))
->
type
()
!=
Item
::
CACHE_ITEM
&&
item_ref
->
ref_type
()
!=
Item_ref
::
VIEW_REF
&&
!
item_ref
->
table_name
&&
item_ref
->
name
&&
item_ref
->
alias_name_used
)
#endif
{
{
if
(
str
)
if
(
str
)
{
{
#ifdef SPIDER_use_LEX_CSTRING_for_KEY_Field_name
uint
length
=
item_ref
->
name
.
length
;
uint
length
=
item_ref
->
name
.
length
;
#else
uint
length
=
strlen
(
item_ref
->
name
);
#endif
if
(
str
->
reserve
(
length
+
/* SPIDER_SQL_NAME_QUOTE_LEN */
2
))
if
(
str
->
reserve
(
length
+
/* SPIDER_SQL_NAME_QUOTE_LEN */
2
))
{
{
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
}
}
#ifdef SPIDER_use_LEX_CSTRING_for_KEY_Field_name
if
((
error_num
=
spider_dbton
[
dbton_id
].
db_util
->
if
((
error_num
=
spider_dbton
[
dbton_id
].
db_util
->
append_name
(
str
,
item_ref
->
name
.
str
,
length
)))
append_name
(
str
,
item_ref
->
name
.
str
,
length
)))
#else
if
((
error_num
=
spider_dbton
[
dbton_id
].
db_util
->
append_name
(
str
,
item_ref
->
name
,
length
)))
#endif
{
{
DBUG_RETURN
(
error_num
);
DBUG_RETURN
(
error_num
);
}
}
...
@@ -10020,13 +9980,8 @@ int spider_db_udf_copy_key_row(
...
@@ -10020,13 +9980,8 @@ int spider_db_udf_copy_key_row(
)
{
)
{
int
error_num
;
int
error_num
;
DBUG_ENTER
(
"spider_db_udf_copy_key_row"
);
DBUG_ENTER
(
"spider_db_udf_copy_key_row"
);
#ifdef SPIDER_use_LEX_CSTRING_for_KEY_Field_name
if
((
error_num
=
spider_db_append_name_with_quote_str
(
str
,
if
((
error_num
=
spider_db_append_name_with_quote_str
(
str
,
(
char
*
)
field
->
field_name
.
str
,
dbton_id
)))
(
char
*
)
field
->
field_name
.
str
,
dbton_id
)))
#else
if
((
error_num
=
spider_db_append_name_with_quote_str
(
str
,
(
char
*
)
field
->
field_name
,
dbton_id
)))
#endif
DBUG_RETURN
(
error_num
);
DBUG_RETURN
(
error_num
);
if
(
str
->
reserve
(
joint_length
+
*
length
+
SPIDER_SQL_AND_LEN
))
if
(
str
->
reserve
(
joint_length
+
*
length
+
SPIDER_SQL_AND_LEN
))
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
...
...
storage/spider/spd_db_mysql.cc
View file @
081a2847
...
@@ -3825,13 +3825,8 @@ void spider_db_mbase::set_dup_key_idx(
...
@@ -3825,13 +3825,8 @@ void spider_db_mbase::set_dup_key_idx(
key_name
=
spider
->
share
->
tgt_pk_names
[
all_link_idx
];
key_name
=
spider
->
share
->
tgt_pk_names
[
all_link_idx
];
key_name_length
=
spider
->
share
->
tgt_pk_names_lengths
[
all_link_idx
];
key_name_length
=
spider
->
share
->
tgt_pk_names_lengths
[
all_link_idx
];
}
else
{
}
else
{
#ifdef SPIDER_use_LEX_CSTRING_for_KEY_Field_name
key_name
=
table
->
key_info
[
roop_count
].
name
.
str
;
key_name
=
table
->
key_info
[
roop_count
].
name
.
str
;
key_name_length
=
table
->
key_info
[
roop_count
].
name
.
length
;
key_name_length
=
table
->
key_info
[
roop_count
].
name
.
length
;
#else
key_name
=
table
->
key_info
[
roop_count
].
name
;
key_name_length
=
strlen
(
key_name
);
#endif
}
}
DBUG_PRINT
(
"info"
,(
"spider key_name=%s"
,
key_name
));
DBUG_PRINT
(
"info"
,(
"spider key_name=%s"
,
key_name
));
if
(
if
(
...
...
storage/spider/spd_include.h
View file @
081a2847
...
@@ -109,7 +109,6 @@
...
@@ -109,7 +109,6 @@
#define SPIDER_read_record_read_record(A) read_record()
#define SPIDER_read_record_read_record(A) read_record()
#define SPIDER_has_Item_with_subquery
#define SPIDER_has_Item_with_subquery
#define SPIDER_use_LEX_CSTRING_for_KEY_Field_name
#define SPIDER_use_LEX_CSTRING_for_Field_blob_constructor
#define SPIDER_use_LEX_CSTRING_for_Field_blob_constructor
#define SPIDER_use_LEX_CSTRING_for_database_tablename_alias
#define SPIDER_use_LEX_CSTRING_for_database_tablename_alias
#define SPIDER_THD_db_str(A) (A)->db.str
#define SPIDER_THD_db_str(A) (A)->db.str
...
...
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