-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes made to source and tests to support PHP 7.3 (#822)
* Changes made to support php 7.3 * Correct use of the smart pointer * Fixed the tests for 7.3 * Some clean up for array_init() * Fixed formattings and clean up
- Loading branch information
Showing
9 changed files
with
143 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
--TEST-- | ||
crash caused by a statement being orphaned when an error occurred during sqlsrv_conn_execute. | ||
--SKIPIF-- | ||
<?php require('skipif.inc'); ?> | ||
--FILE-- | ||
<?php | ||
|
||
sqlsrv_configure( 'WarningsReturnAsErrors', 0 ); | ||
sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL ); | ||
|
||
require( 'MsCommon.inc' ); | ||
|
||
$conn1 = Connect(); | ||
$stmt1 = sqlsrv_query($conn1, "SELECT * FROM Servers"); | ||
sqlsrv_close($conn1); | ||
$row1 = sqlsrv_fetch_array($stmt1); | ||
$conn3 = Connect(); | ||
|
||
echo "Test successful\n"; | ||
|
||
?> | ||
--EXPECTREGEX-- | ||
Warning: sqlsrv_fetch_array\(\) expects parameter 1 to be resource, boolean given in .+(\/|\\)test_conn_execute\.php on line 11 | ||
Test successful | ||
--TEST-- | ||
crash caused by a statement being orphaned when an error occurred during sqlsrv_conn_execute. | ||
--SKIPIF-- | ||
<?php require('skipif.inc'); ?> | ||
--FILE-- | ||
<?php | ||
|
||
sqlsrv_configure( 'WarningsReturnAsErrors', 0 ); | ||
sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL ); | ||
|
||
require( 'MsCommon.inc' ); | ||
|
||
$conn1 = Connect(); | ||
$stmt1 = sqlsrv_query($conn1, "SELECT * FROM Servers"); | ||
sqlsrv_close($conn1); | ||
$row1 = sqlsrv_fetch_array($stmt1); | ||
$conn3 = Connect(); | ||
|
||
echo "Test successful\n"; | ||
|
||
?> | ||
--EXPECTREGEX-- | ||
Warning: sqlsrv_fetch_array\(\) expects parameter 1 to be resource, bool(ean){0,1} given in .+(\/|\\)test_conn_execute\.php on line 11 | ||
Test successful |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
--TEST-- | ||
password with non alphanumeric characters | ||
--DESCRIPTION-- | ||
The first three cases should have no problem connecting. Only the last case fails because the | ||
right curly brace should be escaped with another right brace. | ||
In Azure for this test to pass do not specify any particular database when connecting | ||
--SKIPIF-- | ||
<?php require('skipif.inc'); ?> | ||
--FILE-- | ||
<?php | ||
sqlsrv_configure( 'WarningsReturnAsErrors', 0 ); | ||
sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL ); | ||
|
||
require 'MsSetup.inc'; | ||
function toConnect($options = array()) | ||
{ | ||
global $server; | ||
|
||
// this function makes a connection to the server WITHOUT specifying the database | ||
return sqlsrv_connect($server, $options); | ||
} | ||
|
||
$conn = toConnect(array( "UID" => "test_password", "pwd" => "! ;4triou" )); | ||
if (!$conn) | ||
{ | ||
$errors = sqlsrv_errors(); | ||
echo( $errors[0]["message"]); | ||
} | ||
sqlsrv_close( $conn ); | ||
|
||
$conn = toConnect(array( "UID" => "test_password2", "pwd" => "!}} ;4triou" )); | ||
if (!$conn) | ||
{ | ||
$errors = sqlsrv_errors(); | ||
echo( $errors[0]["message"]); | ||
} | ||
sqlsrv_close( $conn ); | ||
|
||
$conn = toConnect(array( "UID" => "test_password3", "pwd" => "! ;4triou}}" )); | ||
if (!$conn) | ||
{ | ||
$errors = sqlsrv_errors(); | ||
echo( $errors[0]["message"]); | ||
} | ||
sqlsrv_close( $conn ); | ||
|
||
$conn = toConnect(array( "UID" => "test_password3", "pwd" => "! ;4triou}" )); | ||
if ($conn) | ||
{ | ||
echo( "Shouldn't have connected" ); | ||
} | ||
$errors = sqlsrv_errors(); | ||
echo $errors[0]["message"]; | ||
sqlsrv_close( $conn ); | ||
|
||
print "Test successful"; | ||
?> | ||
--EXPECTREGEX-- | ||
An unescaped right brace \(}\) was found in either the user name or password. All right braces must be escaped with another right brace \(}}\)\. | ||
Warning: sqlsrv_close\(\) expects parameter 1 to be resource, boolean given in .+(\/|\\)test_non_alpha_password\.php on line 45 | ||
Test successful | ||
--TEST-- | ||
password with non alphanumeric characters | ||
--DESCRIPTION-- | ||
The first three cases should have no problem connecting. Only the last case fails because the | ||
right curly brace should be escaped with another right brace. | ||
In Azure for this test to pass do not specify any particular database when connecting | ||
--SKIPIF-- | ||
<?php require('skipif.inc'); ?> | ||
--FILE-- | ||
<?php | ||
sqlsrv_configure( 'WarningsReturnAsErrors', 0 ); | ||
sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL ); | ||
|
||
require 'MsSetup.inc'; | ||
function toConnect($options = array()) | ||
{ | ||
global $server; | ||
|
||
// this function makes a connection to the server WITHOUT specifying the database | ||
return sqlsrv_connect($server, $options); | ||
} | ||
|
||
$conn = toConnect(array( "UID" => "test_password", "pwd" => "! ;4triou" )); | ||
if (!$conn) | ||
{ | ||
$errors = sqlsrv_errors(); | ||
echo( $errors[0]["message"]); | ||
} | ||
sqlsrv_close( $conn ); | ||
|
||
$conn = toConnect(array( "UID" => "test_password2", "pwd" => "!}} ;4triou" )); | ||
if (!$conn) | ||
{ | ||
$errors = sqlsrv_errors(); | ||
echo( $errors[0]["message"]); | ||
} | ||
sqlsrv_close( $conn ); | ||
|
||
$conn = toConnect(array( "UID" => "test_password3", "pwd" => "! ;4triou}}" )); | ||
if (!$conn) | ||
{ | ||
$errors = sqlsrv_errors(); | ||
echo( $errors[0]["message"]); | ||
} | ||
sqlsrv_close( $conn ); | ||
|
||
$conn = toConnect(array( "UID" => "test_password3", "pwd" => "! ;4triou}" )); | ||
if ($conn) | ||
{ | ||
echo( "Shouldn't have connected" ); | ||
} | ||
$errors = sqlsrv_errors(); | ||
echo $errors[0]["message"]; | ||
sqlsrv_close( $conn ); | ||
|
||
print "Test successful"; | ||
?> | ||
--EXPECTREGEX-- | ||
An unescaped right brace \(}\) was found in either the user name or password. All right braces must be escaped with another right brace \(}}\)\. | ||
Warning: sqlsrv_close\(\) expects parameter 1 to be resource, bool(ean){0,1} given in .+(\/|\\)test_non_alpha_password\.php on line 45 | ||
Test successful |