Skip Menu |

This queue is for tickets about the SQL-Statement CPAN distribution.

Report information
The Basics
Id: 86213
Status: open
Priority: 0/
Queue: SQL-Statement

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 1.404
  • 1.405
Fixed in: (no value)



Subject: SQL::Parser->dialect() silently discards new dialect.
As the attached test shows, the dialect cannot be set.  It is silently discarded without warning.  This is due to https://metacpan.org/source/REHSACK/SQL-Statement-1.405/lib/SQL/Parser.pm#L286 and that the dialect is always set on object construction.

This contradicts the documentation for dialect "Loading a new dialect configuration file erases all current parser features and resets them to those defined in the configuration file" and makes setting a new dialect anywhere else but with new impossible.
Subject: dialect.t
use strict; use warnings; use Test::More; use SQL::Parser; my $sp = SQL::Parser->new; my $orig_dialect = $sp->dialect; isnt $orig_dialect, "CSV"; $sp->dialect("CSV"); is $sp->dialect, "CSV"; done_testing;
I used your test on the first commit with a Makefile.PL (sometimes around 2005). $ perl -Mblib ./setdia.t ok 1 not ok 2 # Failed test at ./setdia.t line 13. # got: 'ANSI' # expected: 'CSV' 1..2 # Looks like you failed 1 test of 2. I agree, that documentation doesn't match behavior, and my personal intension would be to correct the documentation (dialect is only a getter after construction - setter only during construction).