Comments (9)
This is not intended, looks like there's some inconsistency for the connection option. I'll look into a fix.
from msphpsql.
I believe I have found the issue. It looks like Encrypt
is using srv_encrypt_set_func
and TrustServerCertificate
is using bool_conn_str_func
. bool_conn_str_func
does not handle 'Yes'
and 'No'
.
https://github.com/microsoft/msphpsql/blob/servicing_v5.11.1/source/sqlsrv/conn.cpp#L456-L462
https://github.com/microsoft/msphpsql/blob/servicing_v5.11.1/source/sqlsrv/conn.cpp#L563C1-L571C7
from msphpsql.
I may be incorrect but it seems like #1460 changed bool_conn_str_func from defaulting to True to defaulting to False. May it be that in 5.11.0 setting bool-options to "yes" and "no" was interpreted as True and now in 5.11.1 they are not?
This should possibly be reported as a separate issue but MultiSubnetFailover also seems to be affected by this change.
As https://www.php.net/manual/en/function.sqlsrv-connect.php refers to connectionOptions using the following link http://msdn.microsoft.com/en-us/library/ff628167.aspx in which MultiSubnetFailover is documented as a "yes/no" option it is a bit confusing.
from msphpsql.
The new release accepts true
or false
for connection options. You could change it like this.
'Encrypt' => 'True',
'TrustServerCertificate' => 'True'
from msphpsql.
Was this change documented somewhere? Previously 'Yes'
and 'No'
were the only values that seemed to work.
from msphpsql.
The new release accepts
true
orfalse
for connection options. You could change it like this.'Encrypt' => 'True', 'TrustServerCertificate' => 'True'
I tried changing the values per your recommendation and I now get the following error:
Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver 18 for SQL Server]Invalid value specified for connection string attribute 'Encrypt' [message] => [Microsoft][ODBC Driver 18 for SQL Server]Invalid value specified for connection string attribute 'Encrypt' ) )
It looks as though only the following works:
'Encrypt' => 'Yes',
'TrustServerCertificate' => 'True'
Is this the expected behavior? It seems really odd for a point release to introduce this change without any release notes.
from msphpsql.
I'm thinking of accepting yes/no/true/false
for all options to avoid confusion.
from msphpsql.
I'm thinking of accepting
yes/no/true/false
for all options to avoid confusion.
Sounds good!
Any idea if 1/0 is also used?
It may be that in 5.11.0 '1' was interpreted as true while the string '0' was interpreted as false. I have not investigated this further though.
from msphpsql.
I'm thinking of accepting
yes/no/true/false
for all options to avoid confusion.
I'm good with that as long as it also supports the capital case variants of 'Yes'
and 'No'
as well. It won't personally affect us, since we will modify our own code to use the true
/ false
variants.
from msphpsql.
Related Issues (20)
- SQLSTATE[HY000]: [Microsoft][ODBC Driver 18 for SQL Server]Unicode conversion failed HOT 14
- CentOS9 SQL Server 2014 connect failed. Microsoft ODBC Driver 18 for SQL Server : TCP Provider: Error code 0x2746. HOT 6
- Cakephp2 Application takes longer time to fetch data from sql server database resulting php memory error HOT 3
- Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server HOT 1
- Memory leak in Microsoft ODBC Driver 17.10.5 for SQL Server HOT 4
- HY104 Invalid precision value when reusing prepared statement HOT 4
- SQLSTATE[01002] Adaptive Server connection failed (xxx.xx.xx.xxx) HOT 1
- Issue connecting to SQL server from Openshift HOT 1
- Unable to build version 5.12.0beta1 on Windows HOT 2
- New attribute for sql bigint and decimal/numeric types to php int and float types HOT 1
- Performance problem when using params on select query HOT 2
- Error on both ARM64 and AMD64 docker build HOT 1
- apt fails to install from pmc-geofence.trafficmanager.net: 403 Forbidden HOT 10
- Error requesting access token while Azure webapps (php) connect to Azure SQL server by UMI HOT 4
- Windows DLL available to download
- unable to install in ubuntu 22.04 container HOT 1
- SQL server connection HOT 8
- When will there be support for installing Ubuntu 24.04? HOT 1
- Error OpenSSL Shutdown while in init - cURL - MSSQL HOT 6
- SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [error:0A0C0103:SSL routines::internal error] HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msphpsql.