diff options
author | unknown <paul@frost.snake.net> | 2005-08-29 11:25:12 -0500 |
---|---|---|
committer | unknown <paul@frost.snake.net> | 2005-08-29 11:25:12 -0500 |
commit | d09c4f6e80814a447a136d811623f3f4de9ea235 (patch) | |
tree | c5f4850ce093b72c6e35288acd814f6f72a55592 | |
parent | 4fca19b3ae0fe100d05f3efe01973a0f3d626f73 (diff) | |
parent | c61fa49cbf5187192c84c3198e5216fda1b2d57d (diff) | |
download | mariadb-git-d09c4f6e80814a447a136d811623f3f4de9ea235.tar.gz |
Merge paul@bk-internal.mysql.com:/home/bk/mysql-4.1
into frost.snake.net:/Volumes/frost2/MySQL/bk/mysql-4.1
-rw-r--r-- | Makefile.am | 19 | ||||
-rw-r--r-- | mysql-test/r/ctype_utf8.result | 12 | ||||
-rw-r--r-- | mysql-test/t/ctype_utf8.test | 14 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp | 4 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp | 4 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp | 11 | ||||
-rw-r--r-- | sql/item.cc | 26 | ||||
-rw-r--r-- | sql/item.h | 1 |
8 files changed, 85 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am index 96f3561e31c..59a977a2633 100644 --- a/Makefile.am +++ b/Makefile.am @@ -97,7 +97,22 @@ tags: support-files/build-tags .PHONY: init-db bin-dist -# Test installation +# Test installation. Ports are configurable from the environment. + +MYSQL_TEST_MANAGER_PORT = 9305 +MYSQL_TEST_MASTER_PORT = 9306 +MYSQL_TEST_SLAVE_PORT = 9308 +MYSQL_TEST_NDB_PORT = 9350 test: - cd mysql-test; perl mysql-test-run.pl && perl mysql-test-run.pl --ps-protocol + cd mysql-test ; \ + ./mysql-test-run.pl \ + --manager-port=$(MYSQL_TEST_MANAGER_PORT) \ + --master_port=$(MYSQL_TEST_MASTER_PORT) \ + --slave_port=$(MYSQL_TEST_SLAVE_PORT) \ + --ndbcluster_port=$(MYSQL_TEST_NDB_PORT) && \ + ./mysql-test-run.pl --ps-protocol \ + --manager-port=$(MYSQL_TEST_MANAGER_PORT) \ + --master_port=$(MYSQL_TEST_MASTER_PORT) \ + --slave_port=$(MYSQL_TEST_SLAVE_PORT) \ + --ndbcluster_port=$(MYSQL_TEST_NDB_PORT) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index bb3222ca98b..748361d3178 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -993,6 +993,18 @@ select * from t1 where a like "%abc\d%"; a abcd drop table t1; +set names utf8; +create table t1 (a char(3), b varchar(10)); +insert into t1 values ('bar','kostja'); +prepare my_stmt from "select * from t1 where a=?"; +set @a:='bar'; +execute my_stmt using @a; +a b +bar kostja +set @a:=NULL; +execute my_stmt using @a; +a b +drop table t1; CREATE TABLE t1 ( a varchar(255) NOT NULL default '', KEY a (a) diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index a09618df7c0..e6342777839 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -832,6 +832,20 @@ drop table t1; # +# Bug #12371 executing prepared statement fails (illegal mix of collations) +# +set names utf8; +create table t1 (a char(3), b varchar(10)); +insert into t1 values ('bar','kostja'); +prepare my_stmt from "select * from t1 where a=?"; +set @a:='bar'; +execute my_stmt using @a; +set @a:=NULL; +execute my_stmt using @a; +drop table t1; + + +# # Bug#9557 MyISAM utf8 table crash # CREATE TABLE t1 ( diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp index 092b7840c20..63c271d6b80 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp @@ -79,6 +79,7 @@ NdbOut& operator<<(NdbOut& no, const CommitTransactionRecord& ctr) { no << "----------COMMIT TRANSACTION RECORD------------" << endl << endl; printOut("Record type:", ctr.m_recordType); printOut("TableId", ctr.m_tableId); + printOut("SchemaVersion:", ctr.m_schemaVersion); printOut("FfragmentId", ctr.m_fragmentId); printOut("File no. of Prep. Op.", ctr.m_fileNumberOfPrepareOperation); printOut("Start page no. of Prep. Op.", ctr.m_startPageNumberOfPrepareOperation); @@ -127,7 +128,7 @@ bool PrepareOperationRecord::check() { if (m_operationType == 3 && m_attributeLength != 0) return false; - if (m_logRecordSize != (m_attributeLength + m_keyLength + 7)) + if (m_logRecordSize != (m_attributeLength + m_keyLength + 6)) return false; return true; @@ -142,7 +143,6 @@ NdbOut& operator<<(NdbOut& no, const PrepareOperationRecord& por) { printOut("Record type:", por.m_recordType); printOut("logRecordSize:", por.m_logRecordSize); printOut("hashValue:", por.m_hashValue); - printOut("schemaVersion:", por.m_schemaVersion); switch (por.m_operationType) { case 0: ndbout_c("%-30s%-12u%-6s", "operationType:", diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp index e73986e4d73..27f2399abbe 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp @@ -36,7 +36,7 @@ #define NO_PAGES_IN_MBYTE 32 #define NO_MBYTE_IN_FILE 16 -#define COMMITTRANSACTIONRECORDSIZE 8 +#define COMMITTRANSACTIONRECORDSIZE 9 #define COMPLETEDGCIRECORDSIZE 2 #define PAGEHEADERSIZE 32 #define FILEDESCRIPTORHEADERSIZE 3 @@ -89,7 +89,6 @@ protected: Uint32 m_recordType; Uint32 m_logRecordSize; Uint32 m_hashValue; - Uint32 m_schemaVersion; Uint32 m_operationType; // 0 READ, 1 UPDATE, 2 INSERT, 3 DELETE Uint32 m_attributeLength; Uint32 m_keyLength; @@ -190,6 +189,7 @@ public: protected: Uint32 m_recordType; Uint32 m_tableId; + Uint32 m_schemaVersion; Uint32 m_fragmentId; Uint32 m_fileNumberOfPrepareOperation; Uint32 m_startPageNumberOfPrepareOperation; diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp index 67e59c48ea6..cea05aebc64 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp @@ -105,6 +105,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*thePageHeader); if (theCheckFlag) { if(!thePageHeader->check()) { + ndbout << "Error in thePageHeader->check()" << endl; doExit(); } @@ -146,6 +147,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*fdRecord); if (theCheckFlag) { if(!fdRecord->check()) { + ndbout << "Error in fdRecord->check()" << endl; doExit(); } } @@ -163,6 +165,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*nlRecord); if (theCheckFlag) { if(!nlRecord->check()) { + ndbout << "Error in nlRecord->check()" << endl; doExit(); } } @@ -176,6 +179,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*cGCIrecord); if (theCheckFlag) { if(!cGCIrecord->check()) { + ndbout << "Error in cGCIrecord->check()" << endl; doExit(); } } @@ -189,6 +193,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*poRecord); if (theCheckFlag) { if(!poRecord->check()) { + ndbout << "Error in poRecord->check()" << endl; doExit(); } } @@ -205,6 +210,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*ctRecord); if (theCheckFlag) { if(!ctRecord->check()) { + ndbout << "Error in ctRecord->check()" << endl; doExit(); } } @@ -221,6 +227,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*ictRecord); if (theCheckFlag) { if(!ictRecord->check()) { + ndbout << "Error in ictRecord->check()" << endl; doExit(); } } @@ -243,6 +250,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*atRecord); if (theCheckFlag) { if(!atRecord->check()) { + ndbout << "Error in atRecord->check()" << endl; doExit(); } } @@ -329,6 +337,7 @@ Uint32 readRecordOverPageBoundary(Uint32 *pagePtr, Uint32 pageIndex, Uint32 old if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { if (theCheckFlag) { if(!poRecord->check()) { + ndbout << "Error in poRecord->check() (readRecordOverPageBoundary)" << endl; doExit(); } } @@ -344,6 +353,7 @@ Uint32 readRecordOverPageBoundary(Uint32 *pagePtr, Uint32 pageIndex, Uint32 old if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { if (theCheckFlag) { if(!ctRecord->check()) { + ndbout << "Error in ctRecord->check() (readRecordOverPageBoundary)" << endl; doExit(); } } @@ -359,6 +369,7 @@ Uint32 readRecordOverPageBoundary(Uint32 *pagePtr, Uint32 pageIndex, Uint32 old if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { if (theCheckFlag) { if(!ictRecord->check()) { + ndbout << "Error in ictRecord->check() (readRecordOverPageBoundary)" << endl; doExit(); } } diff --git a/sql/item.cc b/sql/item.cc index 2ae56d17b07..2d4f9138a51 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -284,6 +284,32 @@ Item *Item_string::safe_charset_converter(CHARSET_INFO *tocs) } +Item *Item_param::safe_charset_converter(CHARSET_INFO *tocs) +{ + if (const_item()) + { + Item_string *conv; + uint conv_errors; + char buf[MAX_FIELD_WIDTH]; + String tmp(buf, sizeof(buf), &my_charset_bin); + String cstr, *ostr= val_str(&tmp); + /* + As safe_charset_converter is not executed for + a parameter bound to NULL, ostr should never be 0. + */ + cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &conv_errors); + if (conv_errors || !(conv= new Item_string(cstr.ptr(), cstr.length(), + cstr.charset(), + collation.derivation))) + return NULL; + conv->str_value.copy(); + conv->str_value.shrink_to_length(); + return conv; + } + return NULL; +} + + bool Item_string::eq(const Item *item, bool binary_cmp) const { if (type() == item->type() && item->basic_const_item()) diff --git a/sql/item.h b/sql/item.h index 080b804c730..e683cda5786 100644 --- a/sql/item.h +++ b/sql/item.h @@ -618,6 +618,7 @@ public: basic_const_item returned TRUE. */ Item *new_item(); + Item *safe_charset_converter(CHARSET_INFO *tocs); /* Implement by-value equality evaluation if parameter value is set and is a basic constant (integer, real or string). |