-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes made to source and tests to support PHP 7.3 #822
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,7 +119,7 @@ sqlsrv_close returns true even if an error happens. | |
echo "Test successfully done.\n"; | ||
?> | ||
--EXPECTF-- | ||
Warning: sqlsrv_close() expects parameter 1 to be resource, boolean given in %Ssqlsrv_errors.php on line %x | ||
Warning: sqlsrv_close() expects parameter 1 to be resource, bool%S given in %Ssqlsrv_errors.php on line %x | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PHP 7.3 changes he output to just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
Array | ||
( | ||
[0] => Array | ||
|
@@ -153,7 +153,7 @@ Array | |
|
||
) | ||
|
||
Warning: sqlsrv_free_stmt() expects parameter 1 to be resource, integer given in %Ssqlsrv_errors.php on line %x | ||
Warning: sqlsrv_free_stmt() expects parameter 1 to be resource, int%S given in %Ssqlsrv_errors.php on line %x | ||
Array | ||
( | ||
[0] => Array | ||
|
@@ -172,7 +172,7 @@ Warning: sqlsrv_close(): supplied resource is not a valid ss_sqlsrv_conn resourc | |
|
||
Warning: sqlsrv_close() expects parameter 1 to be resource, null given in %Ssqlsrv_errors.php on line %x | ||
|
||
Warning: sqlsrv_close() expects parameter 1 to be resource, integer given in %Ssqlsrv_errors.php on line %x | ||
Warning: sqlsrv_close() expects parameter 1 to be resource, int%S given in %Ssqlsrv_errors.php on line %x | ||
Array | ||
( | ||
[0] => Array | ||
|
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? What happens in PHP 7.3 if there is an error with array_init?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It used to be a function that returns either a SUCCESS or FAILURE but now a macro in 7.3