You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to parse Oracle SQL where a column definition has a default value of CURRENT_TIMESTAMP the parser will fail with the following error:
ERROR (line 1): Invalid statement: Was expecting remark, or run, or
prompt, or create, or table comment, or comment on
table, or comment on column, or alter, or drop
translate: Error with parser 'SQL::Translator::Parser::Oracle': Parse failed.
You can recreate the error with the following script:
#!/usr/bin/env perluse strict;
use warnings;
use FindBin;
use SQL::Translator;
my$translator = SQL::Translator->new(
# Print debug infodebug=> 1,
# Print Parse::RecDescent tracetrace=> 1,
# Don't include comments in outputno_comments=> 0,
# Print name mutations, conflictsshow_warnings=> 1,
# Add "drop table" statementsadd_drop_table=> 1,
# to quote or not to quote, thats the questionquote_identifiers=> 1,
# Validate schema objectvalidate=> 1,
# Make all table names CAPS in producers which support this optionformat_table_name=>sub {my$tablename = shift; returnuc($tablename)},
# Null-op formatting, only here for documentation's sakeformat_package_name=>sub {returnshift},
format_fk_name=>sub {returnshift},
format_pk_name=>sub {returnshift},
);
my$output = $translator->translate(
from=>'Oracle',
to=>'MySQL',
# Or an arrayref of filenames, i.e. [ $file1, $file2, $file3 ]filename=>"$FindBin::Bin/../db_versions/just_person_test.sql",
) ordie$translator->error;
print$output;
just_person_test.sql contains the following
CREATETABLEperson (
id varchar2(32) NOT NULL,
added date DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
If you remove DEFAULT CURRENT_TIMESTAMP it will parse just fine.
The text was updated successfully, but these errors were encountered:
When attempting to parse Oracle SQL where a column definition has a default value of CURRENT_TIMESTAMP the parser will fail with the following error:
You can recreate the error with the following script:
just_person_test.sql contains the following
If you remove
DEFAULT CURRENT_TIMESTAMPit will parse just fine.The text was updated successfully, but these errors were encountered: