View Ticket
Not logged in
Ticket UUID: dbd65441a533ba9360d581028b04e90140f2a7a6
Title: BOOLEAN fields with value "t" or "f" cause
Status: Closed Type: Feature_Request
Severity: Important Priority: Medium
Subsystem: Convert Resolution: Fixed
Last Modified: 2016-01-19 05:55:17
Version Found In:
User Comments:
anonymous added on 2016-01-11 22:50:29: (text/x-fossil-plain)
The field type is BOOLEAN, the value of the field is "t" or "f".  When calling System.Data.SQLite.SQLiteConvert.ToBoolean("f"), a System.ArgumentException is called.  This is called when utilizing a SQLiteDataReader class to access the field.

relevant stack:

System.ArgumentException was unhandled
       at System.Data.SQLite.SQLiteConvert.ToBoolean(String source)
       at System.Data.SQLite.SQLiteConvert.ToBoolean(Object obj, IFormatProvider provider, Boolean viaFramework)
       at System.Data.SQLite.SQLite3.GetBoolean(SQLiteStatement stmt, Int32 index)
       at System.Data.SQLite.SQLite3.GetValue(SQLiteStatement stmt, SQLiteConnectionFlags flags, Int32 index, SQLiteType typ)
       at System.Data.SQLite.SQLiteDataReader.GetValue(Int32 i)
       at System.Data.SQLite.SQLiteDataReader.get_Item(String name)

mistachkin added on 2016-01-12 04:52:13: (text/x-fossil-plain)
Normally, the BOOLEAN type requires the string to be "true" or "false", not just
"t" or "f".  Did a previous version of System.Data.SQLite used to support using
just the strings "t" or "f" in this context?

mistachkin added on 2016-01-12 20:18:12: (text/x-fossil-plain)
Apparently, the previous versions silently treated all invalid BOOLEAN values as
"false" and now an exception is thrown instead.

mistachkin added on 2016-01-12 23:38:03: (text/x-fossil-plain)
The values "t" and "f" were never really supported as "BOOLEAN", per se;
however, the exception behavior was changed (inadvertently) in release

That being said, I think the new behavior is more correct.

mistachkin added on 2016-01-12 23:38:18: (text/x-fossil-plain)
I'm adding code to trunk that will allow BOOLEAN values to be recognized if
they are any valid case-insensitive prefix of "True" and "False", including
"t" and "f".

mistachkin added on 2016-01-13 00:09:12: (text/x-fossil-plain)
This has been "fixed" on trunk via check-in [ecf9a72b79755c26].