Test escaping quote characters in identifiers
[dbsrgits/DBIx-Class.git] / t / sqlmaker / quotes.t
index 4a5357b..e4c6dbd 100644 (file)
@@ -32,6 +32,13 @@ is_same_sql_bind(
   'got correct SQL for count query with bracket quoting'
 );
 
+is_same_sql_bind(
+  $schema->resultset('Quotes')->search({})->as_query,
+  '(SELECT [me].[`has` [more]] "quotes"] FROM [`with` [some]] "quotes"] [me])',
+  [],
+  'got correct escaped quotes with bracket quoting'
+);
+
 $schema->storage->sql_maker->quote_char('`');
 $schema->storage->sql_maker->name_sep('.');
 
@@ -42,6 +49,13 @@ is_same_sql_bind (
   'got correct SQL for count query with mysql quoting'
 );
 
+is_same_sql_bind(
+  $schema->resultset('Quotes')->search({})->as_query,
+  '(SELECT `me`.```has`` [more] "quotes"` FROM ```with`` [some] "quotes"` `me`)',
+  [],
+  'got correct escaped quotes with mysql quoting'
+);
+
 # !!! talk to ribasushi *explicitly* before modfying these tests !!!
 {
   is_same_sql_bind(