Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:
I'm just testing that I've got exceptions for all the things which can go wrong.
How can I force DBI's prepare() method to fail?
I've tried putting an empty statement in there, bad MySQL code, non-ASCII characters, I can't seem to make it fail. It will fail when it tries to execute of course, but I have code for that anyway.
Can someone please let me know how to guarantee an error on prepare()? Is the trick in how I set up my DBI in the first place, with RaiseError, PrintError, PrintWarn etc?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I make DBI's prepare() fail? [MySQL]
by kschwab (Vicar) on Dec 23, 2018 at 16:32 UTC | |
|
Re: How can I make DBI's prepare() fail? [MySQL]
by Corion (Patriarch) on Dec 23, 2018 at 08:10 UTC | |
by Cody Fendant (Hermit) on Dec 23, 2018 at 10:07 UTC | |
by Corion (Patriarch) on Dec 23, 2018 at 10:48 UTC | |
|
Re: How can I make DBI's prepare() fail? [MySQL]
by Anonymous Monk on Dec 23, 2018 at 08:12 UTC | |
by Cody Fendant (Hermit) on Dec 23, 2018 at 10:11 UTC | |
by markong (Pilgrim) on Dec 23, 2018 at 13:53 UTC | |
by Anonymous Monk on Dec 23, 2018 at 12:09 UTC | |
by Cody Fendant (Hermit) on Apr 04, 2019 at 22:51 UTC |