Skip to content

Commit 9ad42e0

Browse files
committed
Added docs for escaping placeholders using a backslash and get_info(9000).
1 parent 36a243c commit 9ad42e0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Changes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ DBI::Changes - List of significant changes to the DBI
1616
Fixed compilation error on bleadperl due GVSV no longer being an lvalue
1717
[Dagfinn Ilmari Manns�ker]
1818

19+
Added docs for escaping placeholders using a backslash.
20+
Added docs for get_info(9000) indicating ability to escape placeholders.
1921
Added multi_ prefix for DBD::Multi (Dan Wright) and ad2_ prefix for
2022
DBD::AnyData2
2123

DBI.pm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,6 +2420,11 @@ If the C<:>I<N> form of placeholder is supported by the driver you're using,
24202420
then you should be able to use either L</bind_param> or L</execute> to bind
24212421
values. Check your driver documentation.
24222422
2423+
Some drivers allow you to prevent the recognition of a placeholder by placing a
2424+
single backslash character (C<\>) immediately before it. The driver will remove
2425+
the backslash character and ignore the placeholder, passing it unchanged to the
2426+
backend. If the driver supports this then L</get_info>(9000) will return true.
2427+
24232428
With most drivers, placeholders can't be used for any element of a
24242429
statement that would prevent the database server from validating the
24252430
statement and creating a query execution plan for it. For example:
@@ -4969,6 +4974,13 @@ of information types to ensure the DBI itself works properly:
49694974
41 SQL_CATALOG_NAME_SEPARATOR '.' '@'
49704975
114 SQL_CATALOG_LOCATION 1 2
49714976
4977+
Values from 9000 to 9999 for get_info are officially reserved for use by Perl DBI.
4978+
Values in that range which have been assigned a meaning are defined here:
4979+
4980+
C<9000>: true if a backslash character (C<\>) before placeholder-like text
4981+
(e.g. C<?>, C<:foo>) will prevent it being treated as a placeholder by the driver.
4982+
The backslash will be removed before the text is passed to the backend.
4983+
49724984
=head3 C<table_info>
49734985
49744986
$sth = $dbh->table_info( $catalog, $schema, $table, $type );

0 commit comments

Comments
 (0)