Closed
Description
Description
These are the problems that I found out while investigating various things because #12295, which is a fix PR for #12251, did not work properly.
- If we pass an empty string for the password, the authentication information will not be passed in DSN when
direct
.
odbc_connect('Driver=FreeTDS;Server=mssql-server;Port=1433;Database=test', 'test_user2', ''); // my env
gdb
2138 rc = SQLDriverConnect((*conn)->hdbc, NULL, (SQLCHAR *) ldb, strlen(ldb), dsnbuf, sizeof(dsnbuf) - 1, &dsnbuflen, SQL_DRIVER_NOPROMPT);
(gdb) p ldb
$1 = 0x7f45d265b240 "Driver=FreeTDS;Server=mssql-server;Port=1433;Database=test"
- If only one of uid or pwd is included in the dsn, the other will not be included in the built dsn.
odbc_connect('Driver=FreeTDS;Server=mssql-server;Port=1433;Database=test;uid=test_user', 'test_user', 'p@ssw0rd'); // my env
gdb
2138 rc = SQLDriverConnect((*conn)->hdbc, NULL, (SQLCHAR *) ldb, strlen(ldb), dsnbuf, sizeof(dsnbuf) - 1, &dsnbuflen, SQL_DRIVER_NOPROMPT);
(gdb) p ldb
$1 = 0x7f089467f000 "Driver=FreeTDS;Server=mssql-server;Port=1433;Database=test;uid=test_user"
PHP Version
PHP8.2+
Operating System
Ubuntu22.04 (docker image)