From 6f84d3642dd69a3b91344a6909fc3376eb767321 Mon Sep 17 00:00:00 2001 From: v-kaywon Date: Wed, 12 Apr 2017 12:25:40 -0700 Subject: [PATCH] fix indentations and comments --- .../pdostatement_bindcolumn_odd_types.phpt | 24 +++++++++---------- .../pdo_sqlsrv/pdostatement_get_set_attr.phpt | 4 ---- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/test/pdo_sqlsrv/pdostatement_bindcolumn_odd_types.phpt b/test/pdo_sqlsrv/pdostatement_bindcolumn_odd_types.phpt index 4fb2258a..1be5e3a6 100644 --- a/test/pdo_sqlsrv/pdostatement_bindcolumn_odd_types.phpt +++ b/test/pdo_sqlsrv/pdostatement_bindcolumn_odd_types.phpt @@ -8,17 +8,17 @@ require_once("autonomous_setup.php"); try { - $conn = new PDO( "sqlsrv:Server=$serverName; Database = tempdb ", $username, $password); + $conn = new PDO( "sqlsrv:Server=$serverName; Database = tempdb ", $username, $password); $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); - $conn->exec("IF OBJECT_ID('temptb', 'U') IS NOT NULL DROP TABLE temptb"); - $conn->exec("CREATE TABLE temptb(IntCol INT, CharCol NVARCHAR(20)) "); - $conn->exec("INSERT INTO temptb (IntCol, CharCol) VALUES (10, 'ten')"); + $conn->exec("IF OBJECT_ID('table1', 'U') IS NOT NULL DROP TABLE table1"); + $conn->exec("CREATE TABLE table1(IntCol INT, CharCol NVARCHAR(20)) "); + $conn->exec("INSERT INTO table1 (IntCol, CharCol) VALUES (10, 'ten')"); - $stmt = $conn->prepare("SELECT IntCol FROM temptb"); - $stmt->execute(); + $stmt = $conn->prepare("SELECT IntCol FROM table1"); + $stmt->execute(); // PARAM_NULL returns null - $stmt->bindColumn('IntCol', $intCol, PDO::PARAM_NULL); + $stmt->bindColumn('IntCol', $intCol, PDO::PARAM_NULL); $row = $stmt->fetch(PDO::FETCH_BOUND); if ($intCol == NULL) { echo "intCol is NULL\n"; @@ -26,18 +26,18 @@ try echo "intCol should have been NULL\n"; } - $stmt = $conn->prepare("SELECT CharCol FROM temptb"); - $stmt->execute(); + $stmt = $conn->prepare("SELECT CharCol FROM table1"); + $stmt->execute(); - // PARAM_STMT is not support and should throw an exception - $stmt->bindColumn('CharCol', $charCol, PDO::PARAM_STMT); + // PARAM_STMT is not supported and should throw an exception + $stmt->bindColumn('CharCol', $charCol, PDO::PARAM_STMT); $row = $stmt->fetch(PDO::FETCH_BOUND); echo "PARAM_STMT should have thrown an exception\n"; } catch (PDOException $e) { - print_r($e->errorInfo[2]); + print_r($e->errorInfo[2]); echo "\n"; } diff --git a/test/pdo_sqlsrv/pdostatement_get_set_attr.phpt b/test/pdo_sqlsrv/pdostatement_get_set_attr.phpt index 5013b753..b155ba77 100644 --- a/test/pdo_sqlsrv/pdostatement_get_set_attr.phpt +++ b/test/pdo_sqlsrv/pdostatement_get_set_attr.phpt @@ -116,10 +116,6 @@ require_once("autonomous_setup.php"); echo "Test6 - Set stmt option: SQLSRV_ATTR_ENCODING \n"; set_stmt_option($conn, array(PDO::SQLSRV_ATTR_ENCODING => 3)); - $attr = "PDO::ATTR_CURSOR"; - $stmt = set_stmt_attr($conn, $attr, 1); - get_stmt_attr($stmt, $attr); - $attr = "PDO::SQLSRV_ATTR_QUERY_TIMEOUT"; $stmt = set_stmt_attr($conn, $attr, 45); get_stmt_attr($stmt, $attr);