Use more widely supported quoting in DBICTest::Year2000CDs view
Dagfinn Ilmari Mannsåker [Wed, 10 Dec 2014 17:37:37 +0000 (17:37 +0000)]
This lets DBICTEST_SQLT_DEPLOY=1 work with more non-SQLite DBICTEST_DSNs

The "number as quoted string" is necessary because some databases
(e.g. PostgreSQL) do not do implicit casting between integers and strings

t/lib/DBICTest/Schema/Year2000CDs.pm
t/lib/sqlite.sql

index 3ae7de5..6ee67d5 100644 (file)
@@ -11,7 +11,7 @@ __PACKAGE__->table('year2000cds');
 
 # need to operate on the instance for things to work
 __PACKAGE__->result_source_instance->view_definition( sprintf (
-  'SELECT %s FROM cd WHERE year = "2000"',
+  "SELECT %s FROM cd WHERE year = '2000'",
   join (', ', __PACKAGE__->columns),
 ));
 
index 64ddc33..67c2028 100644 (file)
@@ -370,4 +370,4 @@ CREATE INDEX "fourkeys_to_twokeys_idx_f_foo_f_bar_f_hello_f_goodbye" ON "fourkey
 CREATE INDEX "fourkeys_to_twokeys_idx_t_artist_t_cd" ON "fourkeys_to_twokeys" ("t_artist", "t_cd");
 
 CREATE VIEW "year2000cds" AS
-    SELECT cdid, artist, title, year, genreid, single_track FROM cd WHERE year = "2000";
+    SELECT cdid, artist, title, year, genreid, single_track FROM cd WHERE year = '2000';