SQLite
View Ticket
Not logged in
Ticket UUID: 689137afb6da41d0cd61de223d39fa3d5ae41dcb
Title: Casting UTF16 to numeric types fails
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2013-03-20 12:45:58
Version Found In:
User Comments:
drh added on 2013-03-20 11:08:39:

The second SELECT in the following code returns 34. The correct answer is 3, the same as the first SELECT.

PRAGMA encoding=UTF16be;
SELECT CAST('3x' AS int);
SELECT CAST(x'003301340000' AS int);

A similar error occurs for casting to "real".