Skip to content

Commit c39225b

Browse files
Updated pdo_odbc, odbc_connect and odbc_pconnect (#4215)
Co-authored-by: Gina Peter Banyard <[email protected]>
1 parent e58094c commit c39225b

File tree

4 files changed

+74
-4
lines changed

4 files changed

+74
-4
lines changed

language-snippets.ent

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,6 +1934,33 @@ and <literal xmlns="http://docbook.org/ns/docbook">_</literal> to match a single
19341934
</entry>
19351935
</row>'>
19361936

1937+
<!ENTITY odbc.changelog.credential-params '<row xmlns="http://docbook.org/ns/docbook">
1938+
<entry>8.4.0</entry>
1939+
<entry>
1940+
<parameter>user</parameter> and <parameter>password</parameter> are now nullable,
1941+
they are now also optional and default to &null;.
1942+
</entry>
1943+
</row>
1944+
<row xmlns="http://docbook.org/ns/docbook">
1945+
<entry>8.4.0</entry>
1946+
<entry>
1947+
Previously, using an empty string for <parameter>password</parameter> would not include
1948+
<literal>pwd</literal> in the generated connection string for <parameter>dsn</parameter>.
1949+
It is now generated to include a <literal>pwd</literal> which has an empty string as its value.
1950+
To restore the previous behaviour <parameter>password</parameter> can now be set to &null;.
1951+
</entry>
1952+
</row>
1953+
<row xmlns="http://docbook.org/ns/docbook">
1954+
<entry>8.4.0</entry>
1955+
<entry>
1956+
Previously, if <parameter>dsn</parameter> contained <literal>uid</literal> or <literal>pwd</literal>
1957+
both <parameter>user</parameter> and <parameter>password</parameter> parameters were ignored.
1958+
Now <parameter>user</parameter> is only ignored if <parameter>dsn</parameter> contains
1959+
<literal>uid</literal>, and <parameter>password</parameter> is only ignored if
1960+
<parameter>dsn</parameter> contains <literal>pwd</literal>.
1961+
</entry>
1962+
</row>'>
1963+
19371964
<!ENTITY odbc.changelog.result-param '<row xmlns="http://docbook.org/ns/docbook">
19381965
<entry>8.4.0</entry>
19391966
<entry>

reference/pdo_odbc/reference.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,41 @@
116116
</variablelist>
117117
</para>
118118
</refsect1>
119+
120+
<refsect1 role="changelog">
121+
&reftitle.changelog;
122+
<informaltable>
123+
<tgroup cols="2">
124+
<thead>
125+
<row>
126+
<entry>&Version;</entry>
127+
<entry>&Description;</entry>
128+
</row>
129+
</thead>
130+
<tbody>
131+
<row>
132+
<entry>8.4.0</entry>
133+
<entry>
134+
When passing an empty <type>string</type> to the password argument in the PDO constructor, <literal>pwd</literal>
135+
was not included in the connection string created until now, but the behavior has been changed to include
136+
it as an empty string. Passing &null; for the password argument in the PDO constructor results in the same
137+
behavior as before.
138+
</entry>
139+
</row>
140+
<row>
141+
<entry>8.4.0</entry>
142+
<entry>
143+
Changed the behavior to ignore the user name argument and the password argument in the PDO constructor
144+
separately when the DSN contains <literal>uid</literal> or <literal>pwd</literal>.
145+
Previously, if included only either <literal>uid</literal> or <literal>pwd</literal> in the DSN,
146+
both the user name argument and the password argument in the PDO constructor were ignored.
147+
</entry>
148+
</row>
149+
</tbody>
150+
</tgroup>
151+
</informaltable>
152+
</refsect1>
153+
119154
<refsect1 role="examples">
120155
&reftitle.examples;
121156
<para>

reference/uodbc/functions/odbc-connect.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<methodsynopsis>
1212
<type class="union"><type>Odbc\Connection</type><type>false</type></type><methodname>odbc_connect</methodname>
1313
<methodparam><type>string</type><parameter>dsn</parameter></methodparam>
14-
<methodparam><type>string</type><parameter>user</parameter></methodparam>
15-
<methodparam><type>string</type><parameter>password</parameter></methodparam>
14+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>user</parameter><initializer>&null;</initializer></methodparam>
15+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>password</parameter><initializer>&null;</initializer></methodparam>
1616
<methodparam choice="opt"><type>int</type><parameter>cursor_option</parameter><initializer><constant>SQL_CUR_USE_DRIVER</constant></initializer></methodparam>
1717
</methodsynopsis>
1818
<simpara>
@@ -49,6 +49,9 @@
4949
<listitem>
5050
<para>
5151
The username.
52+
This parameter is ignored if <parameter>dsn</parameter> contains <literal>uid</literal>.
53+
To connect without specifying a <parameter>user</parameter>,
54+
use &null;.
5255
</para>
5356
</listitem>
5457
</varlistentry>
@@ -57,6 +60,9 @@
5760
<listitem>
5861
<para>
5962
The password.
63+
This parameter is ignored if <parameter>dsn</parameter> contains <literal>pwd</literal>.
64+
To connect without specifying a <parameter>password</parameter>,
65+
use &null;.
6066
</para>
6167
</listitem>
6268
</varlistentry>
@@ -115,6 +121,7 @@
115121
</thead>
116122
<tbody>
117123
&odbc.changelog.connection-return;
124+
&odbc.changelog.credential-params;
118125
</tbody>
119126
</tgroup>
120127
</informaltable>

reference/uodbc/functions/odbc-pconnect.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<methodsynopsis>
1212
<type class="union"><type>Odbc\Connection</type><type>false</type></type><methodname>odbc_pconnect</methodname>
1313
<methodparam><type>string</type><parameter>dsn</parameter></methodparam>
14-
<methodparam><type>string</type><parameter>user</parameter></methodparam>
15-
<methodparam><type>string</type><parameter>password</parameter></methodparam>
14+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>user</parameter><initializer>&null;</initializer></methodparam>
15+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>password</parameter><initializer>&null;</initializer></methodparam>
1616
<methodparam choice="opt"><type>int</type><parameter>cursor_option</parameter><initializer><constant>SQL_CUR_USE_DRIVER</constant></initializer></methodparam>
1717
</methodsynopsis>
1818
<para>
@@ -56,6 +56,7 @@
5656
</thead>
5757
<tbody>
5858
&odbc.changelog.connection-return;
59+
&odbc.changelog.credential-params;
5960
</tbody>
6061
</tgroup>
6162
</informaltable>

0 commit comments

Comments
 (0)