Escape the closing quote character when quoting indentifiers
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / Oracle.pm
index 9b8adbc..34a9be8 100644 (file)
@@ -787,7 +787,9 @@ sub mk_name {
 
 sub quote {
   my ($name, $q) = @_;
-  $q && $name ? "$quote_char$name$quote_char" : $name;
+  return $name unless $q && $name;
+  $name =~ s/\Q$quote_char/$quote_char$quote_char/g;
+  return "$quote_char$name$quote_char";
 }