Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Saving data to XML file using DBD::AnyData

by snoopy (Deacon)
on Dec 04, 2009 at 07:02 UTC ( #811030=note: print w/replies, xml ) Need Help??

in reply to Saving data to XML file using DBD::AnyData

I added the following to the top of your program to get a trackback dump:
use Carp; $SIG{__DIE__} = \&Carp::confess;
This indicated that DBD::AnyData is dying on the following line of code in the ad_data method:
my $sth = $dbh->prepare("SELECT 1 FROM $table_name") or die DBI- +>errstr;
I then wrote the following test program to exercise SQL::Statement directly:
use common::sense; use SQL::Statement; my $sql1 = "SELECT 1+0 FROM some_table"; my $sql2 = "SELECT 1 FROM some_table"; my $parser = SQL::Parser->new(); for ($sql1, $sql2) { warn "trying: $_"; my $stmt = SQL::Statement->new($_,$parser); }
This produces:
trying: SELECT 1+0 FROM some_table at line 10. trying: SELECT 1 FROM some_table at line 10. Bad table or column name: '1' starts with non-alphabetic character! at + /usr/local/share/perl/5.10.0/SQL/ line 2894.
So "SELECT 1+0 from some_table" parses ok, but "SELECT 1 from some_table" doesn't!

I started with SQL::Statement 1.20. The problem persisted after upgrading to 1.23.

Looks to me like a bug in SQL::Statement. Its not recognising the literal value '1' as a simple expression. My guess is that this has stopped working in the last few releases of SQL::Statement, but DBD::AnyData relies on it.

Update: I've created an rt ticket.

Replies are listed 'Best First'.
Re^2: Saving data to XML file using DBD::AnyData
by warsting (Novice) on Dec 04, 2009 at 17:01 UTC

    Thanks for the in depth debugging. Being the AnyData module was new to me, I wasn't sure on how to get at that error message.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://811030]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2017-07-25 03:45 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (363 votes). Check out past polls.