Commit 5471e4c7 authored by V Narayanan's avatar V Narayanan

merging with mysql-5.1-bugteam

parents 337faed5 9221a3d8
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT PRIMARY KEY)
ENGINE MYISAM
PARTITION BY HASH (a)
PARTITIONS 1;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
ALTER TABLE t1 REORGANIZE PARTITION;
DROP TABLE t1;
create table t1 (a int) create table t1 (a int)
partition by range (a) partition by range (a)
subpartition by key (a) subpartition by key (a)
......
...@@ -1029,4 +1029,28 @@ SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1')); ...@@ -1029,4 +1029,28 @@ SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
1 1
1 1
DROP TABLE t1; DROP TABLE t1;
SET @xml=
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Title - document with document declaration</title>
</head>
<body> Hi, Im a webpage with document a declaration </body>
</html>';
SELECT ExtractValue(@xml, 'html/head/title');
ExtractValue(@xml, 'html/head/title')
Title - document with document declaration
SELECT ExtractValue(@xml, 'html/body');
ExtractValue(@xml, 'html/body')
Hi, Im a webpage with document a declaration
SELECT ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml');
ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml')
NULL
Warnings:
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 11: STRING unexpected ('>' wanted)'
SELECT ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml');
ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml')
NULL
Warnings:
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 17: STRING unexpected ('>' wanted)'
End of 5.1 tests End of 5.1 tests
...@@ -213,5 +213,10 @@ START TRANSACTION; ...@@ -213,5 +213,10 @@ START TRANSACTION;
INSERT INTO t1 VALUES (NULL, 'first row t2'); INSERT INTO t1 VALUES (NULL, 'first row t2');
SET autocommit=OFF; SET autocommit=OFF;
ALTER TABLE t1 AUTO_INCREMENT = 10; ALTER TABLE t1 AUTO_INCREMENT = 10;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
INSERT INTO t1 VALUES (NULL, 'second row t2'); INSERT INTO t1 VALUES (NULL, 'second row t2');
SELECT a,b FROM t1 ORDER BY a;
a b
1 first row t2
2 second row t2
DROP TABLE t1; DROP TABLE t1;
...@@ -68,10 +68,12 @@ INSERT INTO t1 VALUES (NULL, 'first row t2'); ...@@ -68,10 +68,12 @@ INSERT INTO t1 VALUES (NULL, 'first row t2');
--connection con2 --connection con2
SET autocommit=OFF; SET autocommit=OFF;
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 AUTO_INCREMENT = 10; ALTER TABLE t1 AUTO_INCREMENT = 10;
--connection con1 --connection con1
INSERT INTO t1 VALUES (NULL, 'second row t2'); INSERT INTO t1 VALUES (NULL, 'second row t2');
SELECT a,b FROM t1 ORDER BY a;
--disconnect con2 --disconnect con2
--disconnect con1 --disconnect con1
--connection default --connection default
......
...@@ -3,6 +3,17 @@ ...@@ -3,6 +3,17 @@
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
#
# Bug 40389: REORGANIZE PARTITION crashes when only using one partition
#
CREATE TABLE t1 (a INT PRIMARY KEY)
ENGINE MYISAM
PARTITION BY HASH (a)
PARTITIONS 1;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
ALTER TABLE t1 REORGANIZE PARTITION;
DROP TABLE t1;
# #
# Bug 21143: mysqld hang when error in number of subparts in # Bug 21143: mysqld hang when error in number of subparts in
# REORGANIZE command # REORGANIZE command
......
...@@ -551,4 +551,29 @@ INSERT INTO t1 VALUES (0), (0); ...@@ -551,4 +551,29 @@ INSERT INTO t1 VALUES (0), (0);
SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1')); SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
DROP TABLE t1; DROP TABLE t1;
#
# BUG#38227 EXTRACTVALUE doesn't work with DTD declarations
#
# Check that quoted strings work fine in DOCTYPE declaration.
#
SET @xml=
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Title - document with document declaration</title>
</head>
<body> Hi, Im a webpage with document a declaration </body>
</html>';
SELECT ExtractValue(@xml, 'html/head/title');
SELECT ExtractValue(@xml, 'html/body');
# These two documents will fail.
# Quoted strings are not allowed in regular tags
#
SELECT ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml');
SELECT ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml');
--echo End of 5.1 tests --echo End of 5.1 tests
...@@ -3431,7 +3431,7 @@ int ha_partition::rnd_next(uchar *buf) ...@@ -3431,7 +3431,7 @@ int ha_partition::rnd_next(uchar *buf)
while (TRUE) while (TRUE)
{ {
int result= file->rnd_next(buf); result= file->rnd_next(buf);
if (!result) if (!result)
{ {
m_last_part= part_id; m_last_part= part_id;
......
...@@ -867,6 +867,7 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, ...@@ -867,6 +867,7 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
if (part_type != HASH_PARTITION || !list_of_part_fields) if (part_type != HASH_PARTITION || !list_of_part_fields)
{ {
DBUG_ASSERT(part_expr);
err= part_expr->walk(&Item::check_partition_func_processor, 0, err= part_expr->walk(&Item::check_partition_func_processor, 0,
NULL); NULL);
if (!err && is_sub_partitioned() && !list_of_subpart_fields) if (!err && is_sub_partitioned() && !list_of_subpart_fields)
......
...@@ -4233,9 +4233,8 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, ...@@ -4233,9 +4233,8 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
after the change as before. Thus we can reply ok immediately after the change as before. Thus we can reply ok immediately
without any changes at all. without any changes at all.
*/ */
DBUG_RETURN(fast_end_partition(thd, ULL(0), ULL(0), *fast_alter_partition= TRUE;
table, NULL, DBUG_RETURN(FALSE);
TRUE, NULL, FALSE));
} }
else if (new_part_no > curr_part_no) else if (new_part_no > curr_part_no)
{ {
......
...@@ -328,7 +328,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len) ...@@ -328,7 +328,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len)
} }
while ((MY_XML_IDENT == (lex=my_xml_scan(p,&a))) || while ((MY_XML_IDENT == (lex=my_xml_scan(p,&a))) ||
(MY_XML_STRING == lex)) ((MY_XML_STRING == lex && exclam)))
{ {
MY_XML_ATTR b; MY_XML_ATTR b;
if (MY_XML_EQ == (lex=my_xml_scan(p,&b))) if (MY_XML_EQ == (lex=my_xml_scan(p,&b)))
...@@ -349,13 +349,22 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len) ...@@ -349,13 +349,22 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len)
return MY_XML_ERROR; return MY_XML_ERROR;
} }
} }
else if ((MY_XML_STRING == lex) || (MY_XML_IDENT == lex)) else if (MY_XML_IDENT == lex)
{ {
p->current_node_type= MY_XML_NODE_ATTR; p->current_node_type= MY_XML_NODE_ATTR;
if ((MY_XML_OK != my_xml_enter(p,a.beg,(size_t) (a.end-a.beg))) || if ((MY_XML_OK != my_xml_enter(p,a.beg,(size_t) (a.end-a.beg))) ||
(MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg)))) (MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg))))
return MY_XML_ERROR; return MY_XML_ERROR;
} }
else if ((MY_XML_STRING == lex) && exclam)
{
/*
We are in <!DOCTYPE>, e.g.
<!DOCTYPE name SYSTEM "SystemLiteral">
<!DOCTYPE name PUBLIC "PublidLiteral" "SystemLiteral">
Just skip "SystemLiteral" and "PublicidLiteral"
*/
}
else else
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment