diff --git a/mysql-test/r/partition_mgm.result b/mysql-test/r/partition_mgm.result
index 465bddcb3fb..a1f35756e21 100644
--- a/mysql-test/r/partition_mgm.result
+++ b/mysql-test/r/partition_mgm.result
@@ -1,4 +1,11 @@
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)
partition by range (a)
subpartition by key (a)
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result
index 56c884343e3..41c0d6bee21 100644
--- a/mysql-test/r/xml.result
+++ b/mysql-test/r/xml.result
@@ -1029,4 +1029,28 @@ SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
1
1
DROP TABLE t1;
+SET @xml=
+'
+
+
+ Title - document with document declaration
+
+ Hi, Im a webpage with document a declaration
+';
+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('CharData', '/xml');
+ExtractValue('CharData', '/xml')
+NULL
+Warnings:
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 11: STRING unexpected ('>' wanted)'
+SELECT ExtractValue('CharData', '/xml');
+ExtractValue('CharData', '/xml')
+NULL
+Warnings:
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 17: STRING unexpected ('>' wanted)'
End of 5.1 tests
diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result
index 5eab78de8c2..8869f6d450c 100644
--- a/mysql-test/suite/parts/r/partition_special_innodb.result
+++ b/mysql-test/suite/parts/r/partition_special_innodb.result
@@ -213,5 +213,10 @@ START TRANSACTION;
INSERT INTO t1 VALUES (NULL, 'first row t2');
SET autocommit=OFF;
ALTER TABLE t1 AUTO_INCREMENT = 10;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
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;
diff --git a/mysql-test/suite/parts/t/partition_special_innodb.test b/mysql-test/suite/parts/t/partition_special_innodb.test
index b9fc8bdcd56..eac19f6d588 100644
--- a/mysql-test/suite/parts/t/partition_special_innodb.test
+++ b/mysql-test/suite/parts/t/partition_special_innodb.test
@@ -68,10 +68,12 @@ INSERT INTO t1 VALUES (NULL, 'first row t2');
--connection con2
SET autocommit=OFF;
+--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 AUTO_INCREMENT = 10;
--connection con1
INSERT INTO t1 VALUES (NULL, 'second row t2');
+SELECT a,b FROM t1 ORDER BY a;
--disconnect con2
--disconnect con1
--connection default
diff --git a/mysql-test/t/partition_mgm.test b/mysql-test/t/partition_mgm.test
index 524a2e04b25..67544471a8d 100644
--- a/mysql-test/t/partition_mgm.test
+++ b/mysql-test/t/partition_mgm.test
@@ -3,6 +3,17 @@
DROP TABLE IF EXISTS t1;
--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
# REORGANIZE command
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index 5ca9c7afd76..d840e14ba5f 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -551,4 +551,29 @@ INSERT INTO t1 VALUES (0), (0);
SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
DROP TABLE t1;
+#
+# BUG#38227 EXTRACTVALUE doesn't work with DTD declarations
+#
+# Check that quoted strings work fine in DOCTYPE declaration.
+#
+
+SET @xml=
+'
+
+
+ Title - document with document declaration
+
+ Hi, Im a webpage with document a declaration
+';
+
+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('CharData', '/xml');
+SELECT ExtractValue('CharData', '/xml');
+
+
--echo End of 5.1 tests
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 0c96b06381c..852f437b213 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3431,7 +3431,7 @@ int ha_partition::rnd_next(uchar *buf)
while (TRUE)
{
- int result= file->rnd_next(buf);
+ result= file->rnd_next(buf);
if (!result)
{
m_last_part= part_id;
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 02f2c9b0ab1..e2027d3571e 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -867,6 +867,7 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
if (part_type != HASH_PARTITION || !list_of_part_fields)
{
+ DBUG_ASSERT(part_expr);
err= part_expr->walk(&Item::check_partition_func_processor, 0,
NULL);
if (!err && is_sub_partitioned() && !list_of_subpart_fields)
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 8eabded623c..c1df5552eb9 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -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
without any changes at all.
*/
- DBUG_RETURN(fast_end_partition(thd, ULL(0), ULL(0),
- table, NULL,
- TRUE, NULL, FALSE));
+ *fast_alter_partition= TRUE;
+ DBUG_RETURN(FALSE);
}
else if (new_part_no > curr_part_no)
{
diff --git a/strings/xml.c b/strings/xml.c
index 5c62a8e8603..1b697ec6b26 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -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))) ||
- (MY_XML_STRING == lex))
+ ((MY_XML_STRING == lex && exclam)))
{
MY_XML_ATTR 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)
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;
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))))
return MY_XML_ERROR;
}
+ else if ((MY_XML_STRING == lex) && exclam)
+ {
+ /*
+ We are in , e.g.
+
+
+ Just skip "SystemLiteral" and "PublicidLiteral"
+ */
+ }
else
break;
}