Author: turnstep
Date: Thu Jan 17 08:10:47 2008
New Revision: 10582
Modified:
DBD-Pg/trunk/Pg.pm
Log:
Documentation fixes for quoted placeholders, thanks to Daniel Verite.
Modified: DBD-Pg/trunk/Pg.pm
==============================================================================
--- DBD-Pg/trunk/Pg.pm (original)
+++ DBD-Pg/trunk/Pg.pm Thu Jan 17 08:10:47 2008
@@ -2277,19 +2277,19 @@
Not legal:
- $SQL = "SELECT count(*) FROM pg_class WHERE relpages > $2";
+ $SQL = 'SELECT count(*) FROM pg_class WHERE relpages > $2';
- $SQL = "SELECT count(*) FROM pg_class WHERE relpages BETWEEN $1 AND $3";
+ $SQL = 'SELECT count(*) FROM pg_class WHERE relpages BETWEEN $1 AND $3';
Legal:
- $SQL = "SELECT count(*) FROM pg_class WHERE relpages > $1";
+ $SQL = 'SELECT count(*) FROM pg_class WHERE relpages > $1';
- $SQL = "SELECT count(*) FROM pg_class WHERE relpages BETWEEN $1 AND $2";
+ $SQL = 'SELECT count(*) FROM pg_class WHERE relpages BETWEEN $1 AND $2';
- $SQL = "SELECT count(*) FROM pg_class WHERE relpages BETWEEN $1 AND $2 AND
reltuples > $1";
+ $SQL = 'SELECT count(*) FROM pg_class WHERE relpages BETWEEN $1 AND $2 AND
reltuples > $1';
- $SQL = "SELECT count(*) FROM pg_class WHERE relpages > $1 AND reltuples >
$1";
+ $SQL = 'SELECT count(*) FROM pg_class WHERE relpages > $1 AND reltuples >
$1';
In the final statement above, DBI thinks there is only one placeholder, so this
statement will replace both placeholders:
@@ -2913,10 +2913,10 @@
## Set the second placeholder's value and data type.
## We don't send a third argument, so the default "varchar" is used
- $sth->bind_param("$2", "Zool");
+ $sth->bind_param('$2', "Zool");
## We realize that the wrong data type was set above, so we change it:
- $sth->bind_param("$1", 234, { pg_type => SQL_INTEGER });
+ $sth->bind_param('$1', 234, { pg_type => SQL_INTEGER });
## We also got the wrong value, so we change that as well.
## Because the data type is sticky, we don't need to change it