@@ -4900,7 +4900,7 @@ sub export_sequence
49004900 if ($self->{sequences}{$seq}->[1] eq '' || $self->{sequences}{$seq}->[1] < (-2**63-1)) {
49014901 $sql_output .= " NO MINVALUE";
49024902 } else {
4903- $sql_output .= " MINVALUE $seq->[1]";
4903+ $sql_output .= " MINVALUE $self->{sequences}{$ seq} ->[1]";
49044904 }
49054905 # Max value lower than start value are not allowed
49064906 if (($self->{sequences}{$seq}->[2] > 0) && ($self->{sequences}{$seq}->[2] < $self->{sequences}{$seq}->[4])) {
@@ -11891,7 +11891,7 @@ AND IC.TABLE_OWNER = ?
1189111891 $row->[1] =~ s/"//g;
1189211892 $row->[1] =~ s/'//g if ($row->[1] =~ /^'[^'\s]+'$/);
1189311893 # Single row constraint based on a constant and a function based unique index
11894- if ($row->[2] eq 'UNIQUE' && $ nc->[0] =~ /^\d+$/ && $row->[4] =~ /FUNCTION-BASED/i) {
11894+ if ($nc->[0] =~ /^\d+$/ && $row->[4] =~ /FUNCTION-BASED/i) {
1189511895 $row->[1] = '(' . $nc->[0] . ')';
1189611896 }
1189711897 # Enclose with double quote if required when is is not an index function
@@ -14096,7 +14096,7 @@ sub format_data_row
1409614096 }
1409714097 else
1409814098 {
14099- $row->[$idx] = "ST_Geomtry ('" . $row->[$idx] . "', $self->{spatial_srid}{$table}->[$idx])";
14099+ $row->[$idx] = "ST_Geometry ('" . $row->[$idx] . "', $self->{spatial_srid}{$table}->[$idx])";
1410014100 }
1410114101 }
1410214102 else
@@ -15247,8 +15247,15 @@ sub _convert_function
1524715247 $fname =~ s/"_"/_/gs;
1524815248
1524915249 $fct_detail{args} =~ s/\s+IN\s+/ /igs; # Remove default IN keyword
15250+
1525015251 # Replace DEFAULT EMPTY_BLOB() from function/procedure arguments by DEFAULT NULL
1525115252 $fct_detail{args} =~ s/\s+DEFAULT\s+EMPTY_[CB]LOB\(\)/DEFAULT NULL/igs;
15253+
15254+ # Input parameters after one with a default value must also have defaults
15255+ # we add DEFAULT NULL to all remaining parameter without a default value.
15256+ my @args_sorted = ();
15257+ $fct_detail{args} =~ s/^\((.*)\)(\s*\%ORA2PG_COMMENT\d+\%)*\s*$/$1$2/gs;
15258+
1525215259 # Preserve parameters with precision and scale
1525315260 my $h = 0;
1525415261 my %param_param = ();
@@ -15258,18 +15265,15 @@ sub _convert_function
1525815265 $h++;
1525915266 }
1526015267
15261- # Input parameters after one with a default value must also have defaults
15262- # we add DEFAULT NULL to all remaining parameter without a default value.
15263- my @args_sorted = ();
15264- $fct_detail{args} =~ s/^\((.*)\)(\s*\%ORA2PG_COMMENT\d+\%)*\s*$/$1$2/gs;
1526515268 if ($self->{use_default_null})
1526615269 {
1526715270 my $has_default = 0;
1526815271 @args_sorted = split(',', $fct_detail{args});
1526915272 for (my $i = 0; $i <= $#args_sorted; $i++)
1527015273 {
1527115274 $has_default = 1 if ($args_sorted[$i] =~ /\s+DEFAULT\s/i);
15272- if ($has_default && $args_sorted[$i] !~ /\s+DEFAULT\s/i) {
15275+ if ($has_default && $args_sorted[$i] !~ /\s+DEFAULT\s/i)
15276+ {
1527315277 # Add default null if this is not an OUT parameter
1527415278 if ( $args_sorted[$i] !~ /[,\(\s]OUT[\s,\)]/i && $args_sorted[$i] !~ /^OUT\s/i) {
1527515279 $args_sorted[$i] .= ' DEFAULT NULL';
0 commit comments