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
464394bf
Commit
464394bf
authored
Nov 18, 2015
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-8717 - Obsolete sql_strdup() in favor of THD::strdup() and thd_strdup()
parent
13af8650
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
16 deletions
+6
-16
sql/sql_table.cc
sql/sql_table.cc
+5
-4
sql/thr_malloc.cc
sql/thr_malloc.cc
+0
-10
sql/thr_malloc.h
sql/thr_malloc.h
+0
-1
storage/archive/ha_archive.cc
storage/archive/ha_archive.cc
+1
-1
No files found.
sql/sql_table.cc
View file @
464394bf
...
@@ -63,7 +63,8 @@
...
@@ -63,7 +63,8 @@
const
char
*
primary_key_name
=
"PRIMARY"
;
const
char
*
primary_key_name
=
"PRIMARY"
;
static
bool
check_if_keyname_exists
(
const
char
*
name
,
KEY
*
start
,
KEY
*
end
);
static
bool
check_if_keyname_exists
(
const
char
*
name
,
KEY
*
start
,
KEY
*
end
);
static
char
*
make_unique_key_name
(
const
char
*
field_name
,
KEY
*
start
,
KEY
*
end
);
static
char
*
make_unique_key_name
(
THD
*
thd
,
const
char
*
field_name
,
KEY
*
start
,
KEY
*
end
);
static
int
copy_data_between_tables
(
THD
*
thd
,
TABLE
*
from
,
TABLE
*
to
,
static
int
copy_data_between_tables
(
THD
*
thd
,
TABLE
*
from
,
TABLE
*
to
,
List
<
Create_field
>
&
create
,
bool
ignore
,
List
<
Create_field
>
&
create
,
bool
ignore
,
uint
order_num
,
ORDER
*
order
,
uint
order_num
,
ORDER
*
order
,
...
@@ -4026,7 +4027,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
...
@@ -4026,7 +4027,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
primary_key
=
1
;
primary_key
=
1
;
}
}
else
if
(
!
(
key_name
=
key
->
name
.
str
))
else
if
(
!
(
key_name
=
key
->
name
.
str
))
key_name
=
make_unique_key_name
(
sql_field
->
field_name
,
key_name
=
make_unique_key_name
(
thd
,
sql_field
->
field_name
,
*
key_info_buffer
,
key_info
);
*
key_info_buffer
,
key_info
);
if
(
check_if_keyname_exists
(
key_name
,
*
key_info_buffer
,
key_info
))
if
(
check_if_keyname_exists
(
key_name
,
*
key_info_buffer
,
key_info
))
{
{
...
@@ -5068,7 +5069,7 @@ check_if_keyname_exists(const char *name, KEY *start, KEY *end)
...
@@ -5068,7 +5069,7 @@ check_if_keyname_exists(const char *name, KEY *start, KEY *end)
static
char
*
static
char
*
make_unique_key_name
(
const
char
*
field_name
,
KEY
*
start
,
KEY
*
end
)
make_unique_key_name
(
THD
*
thd
,
const
char
*
field_name
,
KEY
*
start
,
KEY
*
end
)
{
{
char
buff
[
MAX_FIELD_NAME
],
*
buff_end
;
char
buff
[
MAX_FIELD_NAME
],
*
buff_end
;
...
@@ -5086,7 +5087,7 @@ make_unique_key_name(const char *field_name,KEY *start,KEY *end)
...
@@ -5086,7 +5087,7 @@ make_unique_key_name(const char *field_name,KEY *start,KEY *end)
*
buff_end
=
'_'
;
*
buff_end
=
'_'
;
int10_to_str
(
i
,
buff_end
+
1
,
10
);
int10_to_str
(
i
,
buff_end
+
1
,
10
);
if
(
!
check_if_keyname_exists
(
buff
,
start
,
end
))
if
(
!
check_if_keyname_exists
(
buff
,
start
,
end
))
return
sql_
strdup
(
buff
);
return
thd
->
strdup
(
buff
);
}
}
return
(
char
*
)
"not_specified"
;
// Should never happen
return
(
char
*
)
"not_specified"
;
// Should never happen
}
}
...
...
sql/thr_malloc.cc
View file @
464394bf
...
@@ -84,16 +84,6 @@ void *sql_calloc(size_t size)
...
@@ -84,16 +84,6 @@ void *sql_calloc(size_t size)
}
}
char
*
sql_strdup
(
const
char
*
str
)
{
size_t
len
=
strlen
(
str
)
+
1
;
char
*
pos
;
if
((
pos
=
(
char
*
)
sql_alloc
(
len
)))
memcpy
(
pos
,
str
,
len
);
return
pos
;
}
char
*
sql_strmake
(
const
char
*
str
,
size_t
len
)
char
*
sql_strmake
(
const
char
*
str
,
size_t
len
)
{
{
char
*
pos
;
char
*
pos
;
...
...
sql/thr_malloc.h
View file @
464394bf
...
@@ -24,7 +24,6 @@ void init_sql_alloc(MEM_ROOT *root, uint block_size, uint pre_alloc_size,
...
@@ -24,7 +24,6 @@ void init_sql_alloc(MEM_ROOT *root, uint block_size, uint pre_alloc_size,
myf
my_flags
);
myf
my_flags
);
void
*
sql_alloc
(
size_t
);
void
*
sql_alloc
(
size_t
);
void
*
sql_calloc
(
size_t
);
void
*
sql_calloc
(
size_t
);
char
*
sql_strdup
(
const
char
*
str
);
char
*
sql_strmake
(
const
char
*
str
,
size_t
len
);
char
*
sql_strmake
(
const
char
*
str
,
size_t
len
);
char
*
sql_strmake_with_convert
(
const
char
*
str
,
size_t
arg_length
,
char
*
sql_strmake_with_convert
(
const
char
*
str
,
size_t
arg_length
,
CHARSET_INFO
*
from_cs
,
CHARSET_INFO
*
from_cs
,
...
...
storage/archive/ha_archive.cc
View file @
464394bf
...
@@ -1645,7 +1645,7 @@ void ha_archive::update_create_info(HA_CREATE_INFO *create_info)
...
@@ -1645,7 +1645,7 @@ void ha_archive::update_create_info(HA_CREATE_INFO *create_info)
}
}
if
(
!
(
my_readlink
(
tmp_real_path
,
share
->
data_file_name
,
MYF
(
0
))))
if
(
!
(
my_readlink
(
tmp_real_path
,
share
->
data_file_name
,
MYF
(
0
))))
create_info
->
data_file_name
=
sql_strdup
(
tmp_real_path
);
create_info
->
data_file_name
=
thd_strdup
(
ha_thd
(),
tmp_real_path
);
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
...
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