[Bast-commits] r9447 -
DBIx-Class/0.08/branches/oracle_returning/t/sqlahacks
abraxxa at dev.catalyst.perl.org
abraxxa at dev.catalyst.perl.org
Wed May 26 16:44:00 GMT 2010
Author: abraxxa
Date: 2010-05-26 17:44:00 +0100 (Wed, 26 May 2010)
New Revision: 9447
Modified:
DBIx-Class/0.08/branches/oracle_returning/t/sqlahacks/oracle.t
Log:
added tests for SQLAHacks::Oracle with quoting
Modified: DBIx-Class/0.08/branches/oracle_returning/t/sqlahacks/oracle.t
===================================================================
--- DBIx-Class/0.08/branches/oracle_returning/t/sqlahacks/oracle.t 2010-05-26 16:40:29 UTC (rev 9446)
+++ DBIx-Class/0.08/branches/oracle_returning/t/sqlahacks/oracle.t 2010-05-26 16:44:00 UTC (rev 9447)
@@ -49,4 +49,46 @@
);
}
+{
+ $sql_maker->quote_char('`');
+
+ my ($sql, @bind) = $sql_maker->insert(
+ 'artist',
+ {
+ 'name' => 'Testartist',
+ },
+ {
+ 'returning' => [ 'artistid' ],
+ },
+ );
+
+ is_same_sql_bind(
+ $sql, \@bind,
+ q/INSERT INTO `artist` (`name`) VALUES (?) RETURNING `artistid` INTO :artistid/,
+ [ 'Testartist' ],
+ 'got correct SQL and bind parameters for insert query with one returned column and quoting'
+ );
+}
+
+{
+ $sql_maker->quote_char('`');
+
+ my ($sql, @bind) = $sql_maker->insert(
+ 'computed_column_test',
+ {
+ 'a_timestamp' => '2010-05-26 18:22:00',
+ },
+ {
+ 'returning' => [ 'id', 'a_computed_column', 'charfield' ],
+ },
+ );
+
+ is_same_sql_bind(
+ $sql, \@bind,
+ q/INSERT INTO `computed_column_test` (`a_timestamp`) VALUES (?) RETURNING `id`, `a_computed_column`, `charfield` INTO :id, :a_computed_column, :charfield/,
+ [ '2010-05-26 18:22:00' ],
+ 'got correct SQL and bind parameters for insert query with multiple returned column and quoting'
+ );
+}
+
done_testing;
More information about the Bast-commits
mailing list