We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8db1876 commit 004c737Copy full SHA for 004c737
1 file changed
t/lib/DodTestUtil.pm
@@ -196,12 +196,25 @@ sub create_sql {
196
add_drop_table => $drop_table,
197
);
198
$sql = $sqlt->translate(\$sql) or die $sqlt->error;
199
- return split_sql_for_oracle($sql) if $driver eq 'Oracle';
+ return split_sql_for_oracle(patch_oracle_drop($sql)) if $driver eq 'Oracle';
200
return split_sql($sql);
201
}
202
$sql;
203
204
205
+sub patch_oracle_drop {
206
+ my $sql = shift;
207
+ $sql =~ s{(DROP (TABLE|SEQUENCE) "(.+)".*);}{
208
+ BEGIN
209
+ EXECUTE IMMEDIATE '$1';
210
+ EXCEPTION
211
+ WHEN OTHERS THEN IF SQLCODE != -942 AND SQLCODE != -2289 THEN RAISE; END IF;
212
+ END;
213
+ /
214
+ }g;
215
+ return $sql;
216
+}
217
+
218
sub split_sql_for_oracle {
219
my ($sql) = @_;
220
return map { split_sql($_) } split(/\s*\/\s*/, $sql);
0 commit comments