diff options
author | Narayanan V <v.narayanan@sun.com> | 2009-06-01 12:52:10 +0530 |
---|---|---|
committer | Narayanan V <v.narayanan@sun.com> | 2009-06-01 12:52:10 +0530 |
commit | 8880590158afce8c141516d5674735fd47058f3b (patch) | |
tree | fba55df06a527218a96096baf3eba5d6a702f63d /storage/ibmdb2i | |
parent | 4a9a103d620f0b1ec08ee76c0c36184f33d8cb4d (diff) | |
download | mariadb-git-8880590158afce8c141516d5674735fd47058f3b.tar.gz |
Bug#45197 cp1250 character set with IBMDB2I generates 2027 error
Running a SELECT query over an IBMDB2I table with a cp1250 character set
was producing an error 2027 (ibmdb2i error 2027: Error converting single-byte
sort sequence to UCS-2).
The QMY_DESCRIBE_RANGE API was returning error 2027 to the storage engine
because the CCSID used for a cp1250 column (870) does not match the CCSID
used by the DB2 sort sequences associated with cp1250_* collations (1153).
This was because the storage engine relies on a set of system APIs to
determine which CCSID value most closely matches a particular MySQL
character set. However, in the case of cp1250, the system is returning
CCSID 870, which does not have a codepoint for the euro symbol, making it
an incorrect match.
This patch overrides the selection of a compatible CCSID to always return
1153 for cp1250.
Diffstat (limited to 'storage/ibmdb2i')
-rw-r--r-- | storage/ibmdb2i/db2i_charsetSupport.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/storage/ibmdb2i/db2i_charsetSupport.cc b/storage/ibmdb2i/db2i_charsetSupport.cc index 1479776d71a..7ff3a8c98f6 100644 --- a/storage/ibmdb2i/db2i_charsetSupport.cc +++ b/storage/ibmdb2i/db2i_charsetSupport.cc @@ -245,11 +245,16 @@ static int32 getNewTextDesc(const int32 inType, else if ((inType == Qlg_TypeAS400CCSID) && (outType == Qlg_TypeAix41)) { // Override non-standard charsets - if (unlikely(strcmp("1148", in) == 0)) + if (strcmp("1148", in) == 0) { strcpy(out, "IBM-1148"); DBUG_RETURN(0); } + else if (unlikely(strcmp("1153", in) == 0)) + { + strcpy(out, "IBM-1153"); + DBUG_RETURN(0); + } } char argBuf[sizeof(ArgList)+15]; @@ -583,6 +588,11 @@ int32 getAssociatedCCSID(const uint16 inCcsid, const int inEncodingScheme, uint1 *outCcsid = 1148; DBUG_RETURN(0); } + else if ((inCcsid == 1250) && (inEncodingScheme == 0x1100)) + { + *outCcsid = 1153; + DBUG_RETURN(0); + } if (!ptrInited) { |