cosmetic changes

This commit is contained in:
v-kaywon 2017-10-13 15:50:50 -07:00
parent 628e04e402
commit b5a0d1f859
5 changed files with 23 additions and 23 deletions

View file

@ -386,7 +386,7 @@ void core_sqlsrv_bind_param( _Inout_ sqlsrv_stmt* stmt, _In_ SQLUSMALLINT param_
}
if( zval_was_long ){
convert_to_string( param_z );
encoding = SQLSRV_ENCODING_SYSTEM;
encoding = SQLSRV_ENCODING_SYSTEM;
match = Z_TYPE_P( param_z ) == IS_STRING;
}
else {
@ -565,7 +565,7 @@ void core_sqlsrv_bind_param( _Inout_ sqlsrv_stmt* stmt, _In_ SQLUSMALLINT param_
buffer, buffer_len TSRMLS_CC );
// save the parameter to be adjusted and/or converted after the results are processed
sqlsrv_output_param output_param( param_ref, encoding, param_num, static_cast<SQLUINTEGER>( buffer_len ), zval_was_long );
sqlsrv_output_param output_param( param_ref, encoding, param_num, static_cast<SQLUINTEGER>( buffer_len ), zval_was_long );
save_output_param_for_later( stmt, output_param TSRMLS_CC );

View file

@ -12,7 +12,7 @@ $conn = connect();
$tbname = "bigint_table";
createTable($conn, $tbname, array("c1_bigint" => "bigint"));
// Create a Store Procedure
// Create a Stored Procedure
$spname = "selectBigint";
$spSql = "CREATE PROCEDURE $spname (@c1_bigint bigint OUTPUT) AS
SELECT @c1_bigint = c1_bigint FROM $tbname";
@ -21,7 +21,7 @@ $conn->query($spSql);
// Insert a large bigint
insertRow($conn, $tbname, array("c1_bigint" => 922337203685479936));
// Call store procedure with output
// Call stored procedure with output
$outSql = "{CALL $spname (?)}";
$bigintOut = 0;
$stmt = $conn->prepare($outSql);
@ -31,7 +31,7 @@ printf("Large bigint output:\n" );
var_dump($bigintOut);
printf("\n");
// Call store procedure with inout
// Call stored procedure with inout
$bigintOut = 0;
$stmt = $conn->prepare($outSql);
$stmt->bindParam(1, $bigintOut, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT, PDO::SQLSRV_PARAM_OUT_DEFAULT_SIZE);
@ -45,7 +45,7 @@ $conn->exec("TRUNCATE TABLE $tbname");
// Insert a small bigint
insertRow($conn, $tbname, array("c1_bigint" => 922337203));
// Call store procedure with output
// Call stored procedure with output
$bigintOut = 0;
$stmt = $conn->prepare($outSql);
$stmt->bindParam(1, $bigintOut, PDO::PARAM_INT, PDO::SQLSRV_PARAM_OUT_DEFAULT_SIZE);
@ -54,7 +54,7 @@ printf("Small bigint output:\n" );
var_dump($bigintOut);
printf("\n");
// Call store procedure with inout
// Call stored procedure with inout
$bigintOut = 0;
$stmt = $conn->prepare($outSql);
$stmt->bindParam(1, $bigintOut, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT, PDO::SQLSRV_PARAM_OUT_DEFAULT_SIZE);

View file

@ -12,7 +12,7 @@ $conn = connect();
$tbname = "bool_table";
createTable($conn, $tbname, array("c1_bool" => "int"));
// Create a Store Procedure
// Create a Stored Procedure
$spname = "selectBool";
$spSql = "CREATE PROCEDURE $spname (@c1_bool int OUTPUT) AS
SELECT @c1_bool = c1_bool FROM $tbname";
@ -21,7 +21,7 @@ $conn->query($spSql);
// Insert 1
insertRow($conn, $tbname, array("c1_bool" => 1));
// Call store procedure with output
// Call stored procedure with output
$outSql = "{CALL $spname (?)}";
$boolOut = false;
$stmt = $conn->prepare($outSql);
@ -31,7 +31,7 @@ printf("True bool output:\n" );
var_dump($boolOut);
printf("\n");
// Call store procedure with inout
// Call stored procedure with inout
$boolOut = false;
$stmt = $conn->prepare($outSql);
$stmt->bindParam(1, $boolOut, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT, PDO::SQLSRV_PARAM_OUT_DEFAULT_SIZE);
@ -45,7 +45,7 @@ $conn->exec("TRUNCATE TABLE $tbname");
// Insert 0
insertRow($conn, $tbname, array("c1_bool" => 0));
// Call store procedure with output
// Call stored procedure with output
$boolOut = true;
$stmt = $conn->prepare($outSql);
$stmt->bindParam(1, $boolOut, PDO::PARAM_INT, PDO::SQLSRV_PARAM_OUT_DEFAULT_SIZE);
@ -54,7 +54,7 @@ printf("True bool output:\n" );
var_dump($boolOut);
printf("\n");
// Call store procedure with inout
// Call stored procedure with inout
$boolOut = true;
$stmt = $conn->prepare($outSql);
$stmt->bindParam(1, $boolOut, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT, PDO::SQLSRV_PARAM_OUT_DEFAULT_SIZE);

View file

@ -13,16 +13,16 @@ $tbname = "bigint_table";
AE\createTable($conn, $tbname, array(new AE\ColumnMeta("bigint", "c1_bigint")));
// Create a Store Procedure with output
// Create a Stored Procedure with output
$spname = "selectBigint";
$spSql = "CREATE PROCEDURE $spname (@c1_bigint bigint OUTPUT) AS
SELECT @c1_bigint = c1_bigint FROM $tbname";
sqlsrv_query( $conn, $spSql );
// Insert a large bigint
AE\insertRow($conn, $tbname, array("c1_bigint" => 922337203685479936));
AE\insertRow($conn, $tbname, array("c1_bigint" => 922,337,203,685,479,936));
// Call store procedure with SQLSRV_PARAM_OUT
// Call stored procedure with SQLSRV_PARAM_OUT
$outSql = "{CALL $spname (?)}";
$bigintOut = 0;
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_OUT)));
@ -31,7 +31,7 @@ printf("Large bigint output:\n");
var_dump($bigintOut);
printf("\n");
// Call store procedure with SQLSRV_PARAM_INOUT
// Call stored procedure with SQLSRV_PARAM_INOUT
$bigintOut = 0;
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_INOUT)));
sqlsrv_execute($stmt);
@ -43,7 +43,7 @@ sqlsrv_query($conn, "TRUNCATE TABLE $tbname");
// Insert a small bigint
AE\insertRow($conn, $tbname, array("c1_bigint" => 922337203));
// Call store procedure with SQLSRV_PARAM_OUT
// Call stored procedure with SQLSRV_PARAM_OUT
$bigintOut = 0;
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_OUT)));
sqlsrv_execute($stmt);
@ -51,7 +51,7 @@ printf("Small bigint output:\n");
var_dump($bigintOut);
printf("\n");
// Call store procedure with SQLSRV_PARAM_INOUT
// Call stored procedure with SQLSRV_PARAM_INOUT
$bigintOut = 0;
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_INOUT)));
sqlsrv_execute($stmt);

View file

@ -13,7 +13,7 @@ $tbname = "bool_table";
AE\createTable($conn, $tbname, array(new AE\ColumnMeta("int", "c1_bool")));
// Create a Store Procedure with output
// Create a Stored Procedure with output
$spname = "selectBool";
$spSql = "CREATE PROCEDURE $spname (@c1_bool int OUTPUT) AS
SELECT @c1_bool = c1_bool FROM $tbname";
@ -22,7 +22,7 @@ sqlsrv_query( $conn, $spSql );
// Insert 1
AE\insertRow($conn, $tbname, array("c1_bool" => 1));
// Call store procedure with SQLSRV_PARAM_OUT
// Call stored procedure with SQLSRV_PARAM_OUT
$outSql = "{CALL $spname (?)}";
$boolOut = false;
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$boolOut, SQLSRV_PARAM_OUT, SQLSRV_PHPTYPE_INT)));
@ -31,7 +31,7 @@ printf("True bool output:\n");
var_dump($boolOut);
printf("\n");
// Call store procedure with SQLSRV_PARAM_INOUT
// Call stored procedure with SQLSRV_PARAM_INOUT
$boolOut = false;
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$boolOut, SQLSRV_PARAM_INOUT, SQLSRV_PHPTYPE_INT)));
sqlsrv_execute($stmt);
@ -43,7 +43,7 @@ sqlsrv_query($conn, "TRUNCATE TABLE $tbname");
// Insert 0
AE\insertRow($conn, $tbname, array("c1_bool" => 0));
// Call store procedure with SQLSRV_PARAM_OUT
// Call stored procedure with SQLSRV_PARAM_OUT
$boolOut = true;
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$boolOut, SQLSRV_PARAM_OUT, SQLSRV_PHPTYPE_INT)));
sqlsrv_execute($stmt);
@ -51,7 +51,7 @@ printf("False bool output:\n");
var_dump($boolOut);
printf("\n");
// Call store procedure with SQLSRV_PARAM_INOUT
// Call stored procedure with SQLSRV_PARAM_INOUT
$boolOut = true;
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$boolOut, SQLSRV_PARAM_INOUT, SQLSRV_PHPTYPE_INT)));
sqlsrv_execute($stmt);