Errors involving partial characters
Partial characters violate the relational model if the substrings strings can be processed or presented to users in any way that can prevent the concatenation of the substrings from reconstructing the original logical string.
This can occur when a multibyte
character has a substring that is a valid character by itself. For
example, suppose a multibyte code set contains a four-byte character,
A1A2A3A4, that represents
the digit
1
and a three-byte character, A2A3A4,
that represents the digit 6
. Suppose also that your
locale is using this multibyte code set when you execute the following
query: SELECT multi_col FROM tablename WHERE multi_col[2,4] = 'A2A3A4'
The
database server interprets multi_col[2,4] as the valid three-byte
character (a multibyte 6
) instead of a substring
of the valid four-byte character ('sss').
Therefore, the WHERE
clause contains the following condition:
WHERE '6' = '6'
Partial characters do not occur in single-byte code sets because each character is stored in a single byte. If the database locale supports a single-byte code set, and you specify a column substring in a query, the query returns exactly the requested subset of data; no characters are replaced with white space.