233
233
is ($@, q{}, $t);
235
$t='Prepare works with placeholders after double slashes';
237
$dbh->do(q{CREATE OPERATOR // ( PROCEDURE=bit, LEFTARG=int, RIGHTARG=int )});
238
$sth = $dbh->prepare(q{SELECT ? // ?});
244
$t='Dollar quotes starting with a number are not treated as valid identifiers';
246
$sth = $dbh->prepare(q{SELECT $123$ $123$});
250
like ($@, qr{Invalid placeholders}, $t);
252
$t='Dollar quotes with invalid characters are not parsed as identifiers';
253
for my $char (qw!+ / : @ [ `!) {
255
$sth = $dbh->prepare(qq{SELECT \$abc${char}\$ 123 \$abc${char}\$});
259
like ($@, qr{syntax error}, $t);
262
$t='Dollar quotes with valid characters are parsed as identifiers';
264
for my $char (qw{0 9 A Z a z}) {
266
$sth = $dbh->prepare(qq{SELECT \$abc${char}\$ 123 \$abc${char}\$});
273
$t='Backslash quoting inside double quotes is parsed correctly';
275
$sth = $dbh->prepare(q{SELECT * FROM "\" WHERE a=?});
279
like ($@, qr{relation ".*" does not exist}, $t);
283
skip 'Setting standard_conforming_strings not available', 2 if ! defined $scs;
284
$t='Backslash quoting inside single quotes is parsed correctly with standard_conforming_strings off';
286
$dbh->do(q{SET standard_conforming_strings = 'off'});
287
$sth = $dbh->prepare(q{SELECT '\', ?});
291
like ($@, qr{unterminated quoted string}, $t);
294
$t='Backslash quoting inside single quotes is parsed correctly with standard_conforming_strings on';
296
$dbh->do(q{SET standard_conforming_strings = 'on'});
297
$sth = $dbh->prepare(q{SELECT '\', ?::int});
235
304
## Begin custom type testing
240
306
$dbh->rollback();
242
308
cleanup_database($dbh,'test');