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
80f839a3
Commit
80f839a3
authored
Jun 12, 2007
by
kaa@polly.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge polly.local:/home/kaa/src/maint/bug28895/my50-bug28895
into polly.local:/home/kaa/src/maint/bug28895/my51-bug28895
parents
b51e43bb
0f5a1e59
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
8 deletions
+27
-8
mysql-test/r/long_tmpdir.result
mysql-test/r/long_tmpdir.result
+3
-0
mysql-test/t/long_tmpdir-master.opt
mysql-test/t/long_tmpdir-master.opt
+1
-0
mysql-test/t/long_tmpdir-master.sh
mysql-test/t/long_tmpdir-master.sh
+3
-0
mysql-test/t/long_tmpdir.test
mysql-test/t/long_tmpdir.test
+9
-0
sql/sql_select.cc
sql/sql_select.cc
+11
-8
No files found.
mysql-test/r/long_tmpdir.result
0 → 100644
View file @
80f839a3
create view v1 as select table_name from information_schema.tables;
drop view v1;
End of 5.0 tests
mysql-test/t/long_tmpdir-master.opt
0 → 100644
View file @
80f839a3
--tmpdir=$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
mysql-test/t/long_tmpdir-master.sh
0 → 100644
View file @
80f839a3
d
=
"
$MYSQLTEST_VARDIR
/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789"
test
-d
"
$d
"
||
mkdir
"
$d
"
rm
-f
"
$d
"
/
*
mysql-test/t/long_tmpdir.test
0 → 100644
View file @
80f839a3
#
# Bug #29015: Stack overflow in processing temporary table name when tmpdir path
# is long
#
create
view
v1
as
select
table_name
from
information_schema
.
tables
;
drop
view
v1
;
--
echo
End
of
5.0
tests
sql/sql_select.cc
View file @
80f839a3
...
@@ -9364,7 +9364,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -9364,7 +9364,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
bool
using_unique_constraint
=
0
;
bool
using_unique_constraint
=
0
;
bool
use_packed_rows
=
0
;
bool
use_packed_rows
=
0
;
bool
not_all_columns
=
!
(
select_options
&
TMP_TABLE_ALL_COLUMNS
);
bool
not_all_columns
=
!
(
select_options
&
TMP_TABLE_ALL_COLUMNS
);
char
*
tmpname
,
path
[
FN_REFLEN
];
char
*
tmpname
,
*
tmppath
,
path
[
FN_REFLEN
],
table_name
[
NAME_LEN
+
1
];
byte
*
pos
,
*
group_buff
,
*
bitmaps
;
byte
*
pos
,
*
group_buff
,
*
bitmaps
;
uchar
*
null_flags
;
uchar
*
null_flags
;
Field
**
reg_field
,
**
from_field
,
**
default_field
;
Field
**
reg_field
,
**
from_field
,
**
default_field
;
...
@@ -9388,12 +9388,12 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -9388,12 +9388,12 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
temp_pool_slot
=
bitmap_lock_set_next
(
&
temp_pool
);
temp_pool_slot
=
bitmap_lock_set_next
(
&
temp_pool
);
if
(
temp_pool_slot
!=
MY_BIT_NONE
)
// we got a slot
if
(
temp_pool_slot
!=
MY_BIT_NONE
)
// we got a slot
sprintf
(
path
,
"%s_%lx_%i"
,
tmp_file_prefix
,
sprintf
(
table_name
,
"%s_%lx_%i"
,
tmp_file_prefix
,
current_pid
,
temp_pool_slot
);
current_pid
,
temp_pool_slot
);
else
else
{
{
/* if we run out of slots or we are not using tempool */
/* if we run out of slots or we are not using tempool */
sprintf
(
path
,
"%s%lx_%lx_%x"
,
tmp_file_prefix
,
current_pid
,
sprintf
(
table_name
,
"%s%lx_%lx_%x"
,
tmp_file_prefix
,
current_pid
,
thd
->
thread_id
,
thd
->
tmp_table
++
);
thd
->
thread_id
,
thd
->
tmp_table
++
);
}
}
...
@@ -9401,7 +9401,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -9401,7 +9401,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
No need to change table name to lower case as we are only creating
No need to change table name to lower case as we are only creating
MyISAM or HEAP tables here
MyISAM or HEAP tables here
*/
*/
fn_format
(
path
,
path
,
mysql_tmpdir
,
""
,
MY_REPLACE_EXT
|
MY_UNPACK_FILENAME
);
fn_format
(
path
,
table_name
,
mysql_tmpdir
,
""
,
MY_REPLACE_EXT
|
MY_UNPACK_FILENAME
);
if
(
group
)
if
(
group
)
{
{
...
@@ -9447,7 +9448,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -9447,7 +9448,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
sizeof
(
*
key_part_info
)
*
(
param
->
group_parts
+
1
),
sizeof
(
*
key_part_info
)
*
(
param
->
group_parts
+
1
),
&
param
->
start_recinfo
,
&
param
->
start_recinfo
,
sizeof
(
*
param
->
recinfo
)
*
(
field_count
*
2
+
4
),
sizeof
(
*
param
->
recinfo
)
*
(
field_count
*
2
+
4
),
&
tmpname
,
(
uint
)
strlen
(
path
)
+
1
,
&
tmppath
,
(
uint
)
strlen
(
path
)
+
1
,
&
tmpname
,
(
uint
)
strlen
(
table_name
)
+
1
,
&
group_buff
,
(
group
&&
!
using_unique_constraint
?
&
group_buff
,
(
group
&&
!
using_unique_constraint
?
param
->
group_length
:
0
),
param
->
group_length
:
0
),
&
bitmaps
,
bitmap_buffer_size
(
field_count
)
*
2
,
&
bitmaps
,
bitmap_buffer_size
(
field_count
)
*
2
,
...
@@ -9466,7 +9468,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -9466,7 +9468,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
DBUG_RETURN
(
NULL
);
/* purecov: inspected */
DBUG_RETURN
(
NULL
);
/* purecov: inspected */
}
}
param
->
items_to_copy
=
copy_func
;
param
->
items_to_copy
=
copy_func
;
strmov
(
tmpname
,
path
);
strmov
(
tmppath
,
path
);
strmov
(
tmpname
,
table_name
);
/* make table according to fields */
/* make table according to fields */
bzero
((
char
*
)
table
,
sizeof
(
*
table
));
bzero
((
char
*
)
table
,
sizeof
(
*
table
));
...
@@ -9491,7 +9494,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -9491,7 +9494,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
table
->
keys_in_use_for_query
.
init
();
table
->
keys_in_use_for_query
.
init
();
table
->
s
=
share
;
table
->
s
=
share
;
init_tmp_table_share
(
share
,
""
,
0
,
tmpname
,
tmp
name
);
init_tmp_table_share
(
share
,
""
,
0
,
tmpname
,
tmp
path
);
share
->
blob_field
=
blob_field
;
share
->
blob_field
=
blob_field
;
share
->
blob_ptr_size
=
mi_portable_sizeof_char_ptr
;
share
->
blob_ptr_size
=
mi_portable_sizeof_char_ptr
;
share
->
db_low_byte_first
=
1
;
// True for HEAP and MyISAM
share
->
db_low_byte_first
=
1
;
// True for HEAP and MyISAM
...
...
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