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
0bab5481
Commit
0bab5481
authored
Nov 25, 2022
by
Monty
Committed by
Sergei Petrunia
Feb 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove strlen() from Item::cleanup
parent
01760333
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
13 deletions
+10
-13
sql/item.cc
sql/item.cc
+4
-7
sql/item.h
sql/item.h
+1
-1
sql/sql_view.cc
sql/sql_view.cc
+5
-5
No files found.
sql/item.cc
View file @
0bab5481
...
...
@@ -411,7 +411,7 @@ int Item::save_str_value_in_field(Field *field, String *result)
Item
::
Item
(
THD
*
thd
)
:
name
(
null_clex_str
),
orig_name
(
0
),
is_expensive_cache
(
-
1
)
name
(
null_clex_str
),
orig_name
(
null_clex_str
),
is_expensive_cache
(
-
1
)
{
DBUG_ASSERT
(
thd
);
base_flags
=
item_base_t
::
FIXED
;
...
...
@@ -444,7 +444,7 @@ Item::Item(THD *thd):
*/
Item
::
Item
()
:
name
(
null_clex_str
),
orig_name
(
0
),
is_expensive_cache
(
-
1
)
name
(
null_clex_str
),
orig_name
(
null_clex_str
),
is_expensive_cache
(
-
1
)
{
DBUG_ASSERT
(
!
mysqld_server_started
);
// Created early
base_flags
=
item_base_t
::
FIXED
;
...
...
@@ -552,11 +552,8 @@ void Item::cleanup()
DBUG_PRINT
(
"enter"
,
(
"this: %p"
,
this
));
marker
=
MARKER_UNUSED
;
join_tab_idx
=
MAX_TABLES
;
if
(
orig_name
)
{
name
.
str
=
orig_name
;
name
.
length
=
strlen
(
orig_name
);
}
if
(
orig_name
.
str
)
name
=
orig_name
;
DBUG_VOID_RETURN
;
}
...
...
sql/item.h
View file @
0bab5481
...
...
@@ -1035,7 +1035,7 @@ class Item :public Value_source,
LEX_CSTRING
name
;
/* Name of item */
/* Original item name (if it was renamed)*/
const
char
*
orig_name
;
LEX_CSTRING
orig_name
;
/* All common bool variables for an Item is stored here */
item_base_t
base_flags
;
...
...
sql/sql_view.cc
View file @
0bab5481
...
...
@@ -67,8 +67,8 @@ static void make_unique_view_field_name(THD *thd, Item *target,
List
<
Item
>
&
item_list
,
Item
*
last_element
)
{
const
char
*
name
=
(
target
->
orig_name
?
target
->
orig_name
:
const
char
*
name
=
(
target
->
orig_name
.
str
?
target
->
orig_name
.
str
:
target
->
name
.
str
);
size_t
name_len
;
uint
attempt
;
...
...
@@ -100,8 +100,8 @@ static void make_unique_view_field_name(THD *thd, Item *target,
itc
.
rewind
();
}
if
(
!
target
->
orig_name
)
target
->
orig_name
=
target
->
name
.
str
;
if
(
!
target
->
orig_name
.
str
)
target
->
orig_name
=
target
->
name
;
target
->
set_name
(
thd
,
buff
,
name_len
,
system_charset_info
);
}
...
...
@@ -186,7 +186,7 @@ void make_valid_column_names(THD *thd, List<Item> &item_list)
if
(
item
->
is_explicit_name
()
||
!
check_column_name
(
item
->
name
.
str
))
continue
;
name_len
=
my_snprintf
(
buff
,
NAME_LEN
,
"Name_exp_%u"
,
column_no
);
item
->
orig_name
=
item
->
name
.
str
;
item
->
orig_name
=
item
->
name
;
item
->
set_name
(
thd
,
buff
,
name_len
,
system_charset_info
);
}
...
...
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