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
7bdecb1d
Commit
7bdecb1d
authored
Dec 16, 2010
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
6a9822a8
0673d8ef
Changes
20
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
526 additions
and
316 deletions
+526
-316
README
README
+246
-294
client/mysqltest.cc
client/mysqltest.cc
+5
-3
mysql-test/r/ctype_latin1.result
mysql-test/r/ctype_latin1.result
+8
-0
mysql-test/r/ctype_ujis.result
mysql-test/r/ctype_ujis.result
+10
-0
mysql-test/r/date_formats.result
mysql-test/r/date_formats.result
+14
-0
mysql-test/r/mysqltest.result
mysql-test/r/mysqltest.result
+1
-1
mysql-test/r/partition_innodb_plugin.result
mysql-test/r/partition_innodb_plugin.result
+73
-0
mysql-test/r/xml.result
mysql-test/r/xml.result
+13
-0
mysql-test/suite/binlog/t/disabled.def
mysql-test/suite/binlog/t/disabled.def
+1
-2
mysql-test/t/ctype_latin1.test
mysql-test/t/ctype_latin1.test
+5
-0
mysql-test/t/ctype_ujis.test
mysql-test/t/ctype_ujis.test
+7
-0
mysql-test/t/date_formats.test
mysql-test/t/date_formats.test
+16
-0
mysql-test/t/mysqltest.test
mysql-test/t/mysqltest.test
+2
-0
mysql-test/t/partition_innodb_plugin.test
mysql-test/t/partition_innodb_plugin.test
+69
-0
mysql-test/t/xml.test
mysql-test/t/xml.test
+14
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+6
-5
sql/item_strfunc.cc
sql/item_strfunc.cc
+7
-1
sql/item_timefunc.cc
sql/item_timefunc.cc
+7
-7
sql/item_xmlfunc.cc
sql/item_xmlfunc.cc
+2
-2
sql/sql_partition.cc
sql/sql_partition.cc
+20
-1
No files found.
README
View file @
7bdecb1d
This diff is collapsed.
Click to expand it.
client/mysqltest.cc
View file @
7bdecb1d
...
...
@@ -444,7 +444,7 @@ struct st_command
char
*
query
,
*
query_buf
,
*
first_argument
,
*
last_argument
,
*
end
;
DYNAMIC_STRING
content
;
int
first_word_len
,
query_len
;
my_bool
abort_on_error
;
my_bool
abort_on_error
,
used_replace
;
struct
st_expected_errors
expected_errors
;
char
require_file
[
FN_REFLEN
];
enum
enum_commands
type
;
...
...
@@ -3287,7 +3287,7 @@ static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname,
if
(
ds_wild
&&
ds_wild
->
length
&&
wild_compare
(
file
->
name
,
ds_wild
->
str
,
0
))
continue
;
dynstr_append
(
ds
,
file
->
name
);
replace_
dynstr_append
(
ds
,
file
->
name
);
dynstr_append
(
ds
,
"
\n
"
);
}
set_wild_chars
(
0
);
...
...
@@ -3317,6 +3317,7 @@ static void do_list_files(struct st_command *command)
{
"file"
,
ARG_STRING
,
FALSE
,
&
ds_wild
,
"Filename (incl. wildcard)"
}
};
DBUG_ENTER
(
"do_list_files"
);
command
->
used_replace
=
1
;
check_command_args
(
command
,
command
->
first_argument
,
list_files_args
,
...
...
@@ -3358,6 +3359,7 @@ static void do_list_files_write_file_command(struct st_command *command,
{
"file"
,
ARG_STRING
,
FALSE
,
&
ds_wild
,
"Filename (incl. wildcard)"
}
};
DBUG_ENTER
(
"do_list_files_write_file"
);
command
->
used_replace
=
1
;
check_command_args
(
command
,
command
->
first_argument
,
list_files_args
,
...
...
@@ -8404,7 +8406,7 @@ int main(int argc, char **argv)
memset
(
&
saved_expected_errors
,
0
,
sizeof
(
saved_expected_errors
));
}
if
(
command_executed
!=
last_command_executed
)
if
(
command_executed
!=
last_command_executed
||
command
->
used_replace
)
{
/*
As soon as any command has been executed,
...
...
mysql-test/r/ctype_latin1.result
View file @
7bdecb1d
...
...
@@ -409,3 +409,11 @@ select hex(cast(_ascii 0x7f as char(1) character set latin1));
hex(cast(_ascii 0x7f as char(1) character set latin1))
7F
End of 5.0 tests
#
# Bug#58022 ... like ... escape export_set ( ... ) crashes when export_set returns warnings
#
SELECT '' LIKE '' ESCAPE EXPORT_SET(1, 1, 1, 1, '');
'' LIKE '' ESCAPE EXPORT_SET(1, 1, 1, 1, '')
1
Warnings:
Warning 1292 Truncated incorrect INTEGER value: ''
mysql-test/r/ctype_ujis.result
View file @
7bdecb1d
...
...
@@ -2374,6 +2374,16 @@ hex(convert(_latin1 0xA4A2 using ujis)) hex(c2)
DROP PROCEDURE sp1;
DROP TABLE t1;
DROP TABLE t2;
#
# Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
#
SET NAMES utf8;
SELECT CONVERT(REPLACE(EXPORT_SET('a','a','a','','a'),'00','') USING ujis);
CONVERT(REPLACE(EXPORT_SET('a','a','a','','a'),'00','') USING ujis)
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'a'
Warning 1292 Truncated incorrect INTEGER value: 'a'
set names default;
set character_set_database=default;
set character_set_server=default;
mysql-test/r/date_formats.result
View file @
7bdecb1d
...
...
@@ -609,3 +609,17 @@ SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date;
valid_date
Thursday 01 January 2009
"End of 5.0 tests"
#
# Start of 5.1 tests
#
#
# Bug#58005 utf8 + get_format causes failed assertion: !str || str != Ptr'
#
SET NAMES utf8;
SELECT LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535)));
LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535)))
%
SET NAMES latin1;
#
# End of 5.1 tests
#
mysql-test/r/mysqltest.result
View file @
7bdecb1d
...
...
@@ -804,7 +804,7 @@ drop table t1;
mysqltest: At line 1: change user failed: Unknown database 'inexistent'
mysqltest: At line 1: change user failed: Access denied for user 'inexistent'@'localhost' (using password: NO)
mysqltest: At line 1: change user failed: Access denied for user 'root'@'localhost' (using password: YES)
file
1.txt
REPLACED_FILE
1.txt
file1.txt
file2.txt
file11.txt
...
...
mysql-test/r/partition_innodb_plugin.result
View file @
7bdecb1d
call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB internal");
#
# Bug#55091: Server crashes on ADD PARTITION after a failed attempt
#
SET @old_innodb_file_format_check = @@global.innodb_file_format_check;
SET @old_innodb_file_format = @@global.innodb_file_format;
SET @old_innodb_file_per_table = @@global.innodb_file_per_table;
SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
SET @@global.innodb_file_format = Barracuda,
@@global.innodb_file_per_table = ON,
@@global.innodb_strict_mode = ON;
# Connection con1
CREATE TABLE t1 (id INT NOT NULL
PRIMARY KEY,
user_num CHAR(10)
) ENGINE = InnoDB
KEY_BLOCK_SIZE=4
PARTITION BY HASH(id) PARTITIONS 1;
t1#P#p0.ibd
t1.frm
t1.par
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`user_num` char(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=4
/*!50100 PARTITION BY HASH (id)
PARTITIONS 1 */
SET GLOBAL innodb_file_per_table = OFF;
# Connection con2
LOCK TABLE t1 WRITE;
# ALTER fails because COMPRESSED/KEY_BLOCK_SIZE
# are incompatible with innodb_file_per_table = OFF;
ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
ERROR HY000: Got error 1478 from storage engine
t1#P#p0.ibd
t1.frm
t1.par
# This SET is not needed to reproduce the bug,
# it is here just to make the test case more realistic
SET innodb_strict_mode = OFF;
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
t1.frm
t1.par
ALTER TABLE t1 REBUILD PARTITION p0;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
UNLOCK TABLES;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`user_num` char(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=4
/*!50100 PARTITION BY HASH (id)
PARTITIONS 3 */
DROP TABLE t1;
# Connection default
SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
SET @@global.innodb_file_format = @old_innodb_file_format;
SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
SET @@global.innodb_file_format_check = @old_innodb_file_format_check;
SET NAMES utf8;
CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
ENGINE=InnoDB
...
...
mysql-test/r/xml.result
View file @
7bdecb1d
...
...
@@ -1094,6 +1094,19 @@ Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
DROP TABLE t1;
#
# Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
#
SET NAMES utf8;
SELECT REPLACE(EXTRACTVALUE('1', '/a'),'ds','');
REPLACE(EXTRACTVALUE('1', '/a'),'ds','')
#
# Bug #57820 extractvalue crashes
#
SELECT AVG(DISTINCT EXTRACTVALUE((''),('$@k')));
AVG(DISTINCT EXTRACTVALUE((''),('$@k')))
NULL
#
# Bug#57279 updatexml dies with: Assertion failed: str_arg[length] == 0
#
SELECT UPDATEXML(NULL, (LPAD(0.1111E-15, '2011', 1)), 1);
...
...
mysql-test/suite/binlog/t/disabled.def
View file @
7bdecb1d
...
...
@@ -10,5 +10,4 @@
#
##############################################################################
binlog_truncate_innodb : BUG#57291 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
binlog_row_failure_mixing_engines : BUG#58416 2010-11-23 ramil Fails on win x86 debug_max
mysql-test/t/ctype_latin1.test
View file @
7bdecb1d
...
...
@@ -127,3 +127,8 @@ DROP TABLE `abc
select
hex
(
cast
(
_ascii
0x7f
as
char
(
1
)
character
set
latin1
));
--
echo
End
of
5.0
tests
--
echo
#
--
echo
# Bug#58022 ... like ... escape export_set ( ... ) crashes when export_set returns warnings
--
echo
#
SELECT
''
LIKE
''
ESCAPE
EXPORT_SET
(
1
,
1
,
1
,
1
,
''
);
mysql-test/t/ctype_ujis.test
View file @
7bdecb1d
...
...
@@ -1209,6 +1209,13 @@ DROP PROCEDURE sp1;
DROP
TABLE
t1
;
DROP
TABLE
t2
;
--
echo
#
--
echo
# Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
--
echo
#
SET
NAMES
utf8
;
SELECT
CONVERT
(
REPLACE
(
EXPORT_SET
(
'a'
,
'a'
,
'a'
,
''
,
'a'
),
'00'
,
''
)
USING
ujis
);
set
names
default
;
set
character_set_database
=
default
;
set
character_set_server
=
default
;
mysql-test/t/date_formats.test
View file @
7bdecb1d
...
...
@@ -359,3 +359,19 @@ SELECT DATE_FORMAT("0000-02-28",'%W %d %M %Y') as valid_date;
SELECT
DATE_FORMAT
(
"2009-01-01"
,
'%W %d %M %Y'
)
as
valid_date
;
--
echo
"End of 5.0 tests"
--
echo
#
--
echo
# Start of 5.1 tests
--
echo
#
--
echo
#
--
echo
# Bug#58005 utf8 + get_format causes failed assertion: !str || str != Ptr'
--
echo
#
SET
NAMES
utf8
;
SELECT
LEAST
(
'%'
,
GET_FORMAT
(
datetime
,
'eur'
),
CAST
(
GET_FORMAT
(
datetime
,
'eur'
)
AS
CHAR
(
65535
)));
SET
NAMES
latin1
;
--
echo
#
--
echo
# End of 5.1 tests
--
echo
#
mysql-test/t/mysqltest.test
View file @
7bdecb1d
...
...
@@ -2513,6 +2513,8 @@ write_file $MYSQLTEST_VARDIR/tmp/testdir/file1.txt;
hello
EOF
# Verify that --replace_result also work on list_files
--
replace_result
file
REPLACED_FILE
list_files
$MYSQLTEST_VARDIR
/
tmp
/
testdir
;
# list_files gets the directory list before creating the new file
list_files_write_file
$MYSQLTEST_VARDIR
/
tmp
/
testdir
/
file2
.
txt
$MYSQLTEST_VARDIR
/
tmp
/
testdir
*
;
...
...
mysql-test/t/partition_innodb_plugin.test
View file @
7bdecb1d
--
source
include
/
have_partition
.
inc
--
source
include
/
have_innodb_plugin
.
inc
# Remove the line below when bug#53307 is solved.
--
source
include
/
not_valgrind
.
inc
let
$MYSQLD_DATADIR
=
`SELECT @@datadir`
;
call
mtr
.
add_suppression
(
"nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB internal"
);
--
echo
#
--
echo
# Bug#55091: Server crashes on ADD PARTITION after a failed attempt
--
echo
#
SET
@
old_innodb_file_format_check
=
@@
global
.
innodb_file_format_check
;
SET
@
old_innodb_file_format
=
@@
global
.
innodb_file_format
;
SET
@
old_innodb_file_per_table
=
@@
global
.
innodb_file_per_table
;
SET
@
old_innodb_strict_mode
=
@@
global
.
innodb_strict_mode
;
SET
@@
global
.
innodb_file_format
=
Barracuda
,
@@
global
.
innodb_file_per_table
=
ON
,
@@
global
.
innodb_strict_mode
=
ON
;
--
echo
# Connection con1
--
connect
(
con1
,
localhost
,
root
,,)
CREATE
TABLE
t1
(
id
INT
NOT
NULL
PRIMARY
KEY
,
user_num
CHAR
(
10
)
)
ENGINE
=
InnoDB
KEY_BLOCK_SIZE
=
4
PARTITION
BY
HASH
(
id
)
PARTITIONS
1
;
--
replace_result
#p# #P#
--
list_files
$MYSQLD_DATADIR
/
test
SHOW
CREATE
TABLE
t1
;
SET
GLOBAL
innodb_file_per_table
=
OFF
;
--
disconnect
con1
--
connect
(
con2
,
localhost
,
root
,,)
--
echo
# Connection con2
LOCK
TABLE
t1
WRITE
;
--
echo
# ALTER fails because COMPRESSED/KEY_BLOCK_SIZE
--
echo
# are incompatible with innodb_file_per_table = OFF;
--
error
ER_GET_ERRNO
ALTER
TABLE
t1
ADD
PARTITION
PARTITIONS
1
;
--
replace_result
#p# #P#
--
list_files
$MYSQLD_DATADIR
/
test
--
echo
# This SET is not needed to reproduce the bug,
--
echo
# it is here just to make the test case more realistic
SET
innodb_strict_mode
=
OFF
;
ALTER
TABLE
t1
ADD
PARTITION
PARTITIONS
2
;
--
replace_result
#p# #P#
--
list_files
$MYSQLD_DATADIR
/
test
# really bug#56172
ALTER
TABLE
t1
REBUILD
PARTITION
p0
;
UNLOCK
TABLES
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
--
disconnect
con2
--
connection
default
--
echo
# Connection default
SET
@@
global
.
innodb_strict_mode
=
@
old_innodb_strict_mode
;
SET
@@
global
.
innodb_file_format
=
@
old_innodb_file_format
;
SET
@@
global
.
innodb_file_per_table
=
@
old_innodb_file_per_table
;
SET
@@
global
.
innodb_file_format_check
=
@
old_innodb_file_format_check
;
#
# Bug#32430 - show engine innodb status causes errors
...
...
mysql-test/t/xml.test
View file @
7bdecb1d
...
...
@@ -617,6 +617,20 @@ FROM t1 ORDER BY t1.id;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
--
echo
#
SET
NAMES
utf8
;
SELECT
REPLACE
(
EXTRACTVALUE
(
'1'
,
'/a'
),
'ds'
,
''
);
--
echo
#
--
echo
# Bug #57820 extractvalue crashes
--
echo
#
SELECT
AVG
(
DISTINCT
EXTRACTVALUE
((
''
),(
'$@k'
)));
--
echo
#
--
echo
# Bug#57279 updatexml dies with: Assertion failed: str_arg[length] == 0
--
echo
#
...
...
sql/item_cmpfunc.cc
View file @
7bdecb1d
...
...
@@ -4692,6 +4692,7 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
String
*
escape_str
=
escape_item
->
val_str
(
&
cmp
.
value1
);
if
(
escape_str
)
{
const
char
*
escape_str_ptr
=
escape_str
->
ptr
();
if
(
escape_used_in_parsing
&&
(
(((
thd
->
variables
.
sql_mode
&
MODE_NO_BACKSLASH_ESCAPES
)
&&
escape_str
->
numchars
()
!=
1
)
||
...
...
@@ -4706,8 +4707,8 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
CHARSET_INFO
*
cs
=
escape_str
->
charset
();
my_wc_t
wc
;
int
rc
=
cs
->
cset
->
mb_wc
(
cs
,
&
wc
,
(
const
uchar
*
)
escape_str
->
ptr
()
,
(
const
uchar
*
)
escape_str
->
ptr
()
+
(
const
uchar
*
)
escape_str
_ptr
,
(
const
uchar
*
)
escape_str
_ptr
+
escape_str
->
length
());
escape
=
(
int
)
(
rc
>
0
?
wc
:
'\\'
);
}
...
...
@@ -4725,13 +4726,13 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
{
char
ch
;
uint
errors
;
uint32
cnvlen
=
copy_and_convert
(
&
ch
,
1
,
cs
,
escape_str
->
ptr
()
,
uint32
cnvlen
=
copy_and_convert
(
&
ch
,
1
,
cs
,
escape_str
_ptr
,
escape_str
->
length
(),
escape_str
->
charset
(),
&
errors
);
escape
=
cnvlen
?
ch
:
'\\'
;
}
else
escape
=
*
(
escape_str
->
ptr
())
;
escape
=
escape_str_ptr
?
*
escape_str_ptr
:
'\\'
;
}
}
else
...
...
sql/item_strfunc.cc
View file @
7bdecb1d
...
...
@@ -904,9 +904,15 @@ String *Item_func_replace::val_str(String *str)
search
=
res2
->
ptr
();
search_end
=
search
+
from_length
;
redo:
DBUG_ASSERT
(
res
->
ptr
()
||
!
offset
);
ptr
=
res
->
ptr
()
+
offset
;
strend
=
res
->
ptr
()
+
res
->
length
();
end
=
strend
-
from_length
+
1
;
/*
In some cases val_str() can return empty string
with ptr() == NULL and length() == 0.
Let's check strend to avoid overflow.
*/
end
=
strend
?
strend
-
from_length
+
1
:
NULL
;
while
(
ptr
<
end
)
{
if
(
*
ptr
==
*
search
)
...
...
sql/item_timefunc.cc
View file @
7bdecb1d
...
...
@@ -2456,14 +2456,14 @@ String *Item_char_typecast::val_str(String *str)
{
// Convert character set if differ
uint
dummy_errors
;
if
(
!
(
res
=
args
[
0
]
->
val_str
(
&
tmp_value
))
||
str
->
copy
(
res
->
ptr
(),
res
->
length
(),
from_cs
,
if
(
!
(
res
=
args
[
0
]
->
val_str
(
str
))
||
tmp_value
.
copy
(
res
->
ptr
(),
res
->
length
(),
from_cs
,
cast_cs
,
&
dummy_errors
))
{
null_value
=
1
;
return
0
;
}
res
=
str
;
res
=
&
tmp_value
;
}
res
->
set_charset
(
cast_cs
);
...
...
@@ -2497,9 +2497,9 @@ String *Item_char_typecast::val_str(String *str)
{
if
(
res
->
alloced_length
()
<
(
uint
)
cast_length
)
{
str
->
alloc
(
cast_length
);
str
->
copy
(
*
res
);
res
=
str
;
str
_value
.
alloc
(
cast_length
);
str
_value
.
copy
(
*
res
);
res
=
&
str_value
;
}
bzero
((
char
*
)
res
->
ptr
()
+
res
->
length
(),
(
uint
)
cast_length
-
res
->
length
());
...
...
sql/item_xmlfunc.cc
View file @
7bdecb1d
...
...
@@ -2790,12 +2790,12 @@ String *Item_func_xml_extractvalue::val_str(String *str)
null_value
=
0
;
if
(
!
nodeset_func
||
!
(
res
=
args
[
0
]
->
val_str
(
str
))
||
!
parse_xml
(
res
,
&
pxml
))
!
parse_xml
(
res
,
&
pxml
)
||
!
(
res
=
nodeset_func
->
val_str
(
&
tmp_value
)))
{
null_value
=
1
;
return
0
;
}
res
=
nodeset_func
->
val_str
(
&
tmp_value
);
return
res
;
}
...
...
sql/sql_partition.cc
View file @
7bdecb1d
...
...
@@ -5934,6 +5934,12 @@ static void alter_partition_lock_handling(ALTER_PARTITION_PARAM_TYPE *lpt)
int
err
;
if
(
lpt
->
thd
->
locked_tables
)
{
/*
Close the table if open, to remove/destroy the already altered
table->part_info object, so that it is not reused.
*/
if
(
lpt
->
table
->
db_stat
)
abort_and_upgrade_lock_and_close_table
(
lpt
);
/*
When we have the table locked, it is necessary to reopen the table
since all table objects were closed and removed as part of the
...
...
@@ -6436,7 +6442,20 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
table
,
table_list
,
FALSE
,
NULL
,
written_bin_log
));
err:
if
(
thd
->
locked_tables
)
{
/*
table->part_info was altered in prep_alter_part_table and must be
destroyed and recreated, since otherwise it will be reused, since
we are under LOCK TABLE.
*/
alter_partition_lock_handling
(
lpt
);
}
else
{
/* Force the table to be closed to avoid reuse of the table->part_info */
close_thread_tables
(
thd
);
}
DBUG_RETURN
(
TRUE
);
}
#endif
...
...
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