silverstripe-sqlite3/code
NightjarNZ 418c1178a1 FIX preserve enum values with correct escaping
Enum values are themselves enumerated in sqlite as they are not supported
as a type. This leads to values being stored in their own table, and a
regular TEXT field being used in a MySQL ENUM's stead. The default value
for this field was being escaped with custom string replacement, and
erroneously relacing the backslash (a redundant operation). This lead
to invalid Fully Qualified Class Names in SilverStripe 4, which is a
required trait for polymorphic relationships. As a result any polymorphic
relationship not set on first write would then proceed to cause an execution
error the next time the dataobject with the relationship was fetched from
the database. By using the PHP supplied escape function for SQLite3 we can
avoid this, and restore functionality.

Relevant section of SQLite documentation to justify the removal of escaping
various characters, such as the backslash:

A string constant is formed by enclosing the string in single quotes (').
A single quote within the string can be encoded by putting two single quotes
in a row - as in Pascal. C-style escapes using the backslash character are
not supported because they are not standard SQL.

https://www.sqlite.org/lang_expr.html
2018-10-08 23:09:24 +13:00
..
SQLite3Connector.php Update config / code styles for 4.0 2017-11-23 14:11:10 +13:00
SQLite3Database.php FIX Make sure nested transactions get reset on implicit commits 2018-07-05 15:31:05 +12:00
SQLite3Query.php return 0 for non iterable results 2018-03-12 14:04:43 +01:00
SQLite3QueryBuilder.php Upgrade for silverstripe namespaces 2016-09-08 15:41:17 +12:00
SQLite3SchemaManager.php FIX preserve enum values with correct escaping 2018-10-08 23:09:24 +13:00
SQLiteDatabaseConfigurationHelper.php Merge remote-tracking branch 'origin/1.4' into 2.0 2017-12-07 16:16:11 +13:00