From 31086ad800b2e2e09dbc22e87d1a052370b78956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slaven=20Rezi=C4=87?= Date: Sat, 25 Nov 2023 22:13:48 +0100 Subject: [PATCH 1/3] producer Dumper: fix NULL handling for strings (#163) --- lib/SQL/Translator/Producer/Dumper.pm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/SQL/Translator/Producer/Dumper.pm b/lib/SQL/Translator/Producer/Dumper.pm index f5d1b42e..9a6a7a3a 100644 --- a/lib/SQL/Translator/Producer/Dumper.pm +++ b/lib/SQL/Translator/Producer/Dumper.pm @@ -232,17 +232,13 @@ for my $table ( @tables ) { my @vals; for my $fld ( @{ $table->{'fields'} } ) { my $val = $rec->{ $fld }; - if ( $table->{'types'}{ $fld } eq 'string' ) { - if ( defined $val ) { + if ( defined $val ) { + if ( $table->{'types'}{ $fld } eq 'string' ) { $val =~ s/'/\\'/g; $val = qq['$val'] } - else { - $val = qq['']; - } - } - else { - $val = defined $val ? $val : $mysql_loadfile ? '\N' : 'NULL'; + } else { + $val = $mysql_loadfile ? '\N' : 'NULL'; } push @vals, $val; } From 76cfd1f202f771a7c73653f4a6c9f5c263972974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slaven=20Rezi=C4=87?= Date: Sat, 25 Nov 2023 22:13:58 +0100 Subject: [PATCH 2/3] untabify lib/SQL/Translator/Parser/SQLite.pm (#164) --- lib/SQL/Translator/Parser/SQLite.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/SQL/Translator/Parser/SQLite.pm b/lib/SQL/Translator/Parser/SQLite.pm index 5e69e83b..fab52832 100644 --- a/lib/SQL/Translator/Parser/SQLite.pm +++ b/lib/SQL/Translator/Parser/SQLite.pm @@ -681,7 +681,7 @@ sub parse { size => $fdata->{'size'}, default_value => $fdata->{'default'}, is_auto_increment => $fdata->{'is_auto_inc'}, - ($fdata->{'is_auto_inc'}? ( extra => { auto_increment_type => 'monotonic' } ) : ()), + ($fdata->{'is_auto_inc'}? ( extra => { auto_increment_type => 'monotonic' } ) : ()), is_nullable => $fdata->{'is_nullable'}, comments => $fdata->{'comments'}, ) or die $table->error; From 13649ce32eece9774bfa83c39c4f7f3437f0f817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slaven=20Rezi=C4=87?= Date: Sat, 25 Nov 2023 22:24:58 +0100 Subject: [PATCH 3/3] test also xt in github workflows (#165) Co-authored-by: Veesh Goldman --- .github/workflows/linux.yml | 2 +- .github/workflows/macos.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c799555b..d3aa39fc 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -29,4 +29,4 @@ jobs: - name: Set up run: perl Makefile.PL - name: Run Tests - run: prove -lj4 t + run: prove -lj4 t xt diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 87081e7d..80acd4bb 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -22,4 +22,4 @@ jobs: - name: Set up run: perl Makefile.PL - name: Run Tests - run: prove -lj4 t + run: prove -lj4 t xt