another set of PDO tests
This commit is contained in:
parent
586b2b3e4e
commit
ca50a21bd8
186
test/pdo_sqlsrv/pdo_138_unicode_column_name.phpt
Normal file
186
test/pdo_sqlsrv/pdo_138_unicode_column_name.phpt
Normal file
|
@ -0,0 +1,186 @@
|
|||
--TEST--
|
||||
Github 138. Test for Unicode Column Metadata.
|
||||
--SKIPIF--
|
||||
<?php require('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class MyStatement extends PDOStatement {
|
||||
public function BindValues(array &$values, array &$blobs, $placeholder_prefix, $columnInformation, &$max_placeholder = NULL, $blob_suffix = NULL) {
|
||||
if (empty($max_placeholder)) {
|
||||
$max_placeholder = 0;
|
||||
}
|
||||
foreach ($values as $field_name => &$field_value) {
|
||||
$placeholder = $placeholder_prefix . $max_placeholder++;
|
||||
$blob_key = $placeholder . $blob_suffix;
|
||||
if (isset($columnInformation['blobs'][$field_name])) {
|
||||
$blobs[$blob_key] = fopen('php://memory', 'a');
|
||||
fwrite($blobs[$blob_key], $field_value);
|
||||
rewind($blobs[$blob_key]);
|
||||
$this->bindParam($placeholder, $blobs[$blob_key], PDO::PARAM_LOB, 0, PDO::SQLSRV_ENCODING_BINARY);
|
||||
}
|
||||
else {
|
||||
// Even though not a blob, make sure we retain a copy of these values.
|
||||
$blobs[$blob_key] = $field_value;
|
||||
$this->bindParam($placeholder, $blobs[$blob_key], PDO::PARAM_STR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $connection_id
|
||||
*
|
||||
* @return PDO
|
||||
*/
|
||||
function connection($connection_id) {
|
||||
include 'MsSetup.inc';
|
||||
$host = $server;
|
||||
$database = $databaseName;
|
||||
$username = $uid;
|
||||
$password = $pwd;
|
||||
|
||||
static $connections = array();
|
||||
if (!isset($connections[$connection_id])) {
|
||||
$connection_options['pdo'] = array();
|
||||
$connection_options['pdo'][PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
|
||||
|
||||
$cnn = new PDO("sqlsrv:server=$host;Database=$database", $username, $password, $connection_options['pdo']);
|
||||
$cnn->setAttribute(PDO::ATTR_STATEMENT_CLASS, [MyStatement::class]);
|
||||
$connections[$connection_id] = $cnn;
|
||||
}
|
||||
return $connections[$connection_id];
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary of prepare
|
||||
*
|
||||
* @param mixed $connection
|
||||
* @param mixed $query
|
||||
* @return PDOStatement
|
||||
*/
|
||||
function prepare($connection, $query) {
|
||||
$pdo_options = array();
|
||||
$pdo_options[PDO::ATTR_EMULATE_PREPARES] = TRUE;
|
||||
$pdo_options[PDO::SQLSRV_ATTR_DIRECT_QUERY] = TRUE;
|
||||
$pdo_options[PDO::ATTR_CURSOR] = PDO::CURSOR_SCROLL;
|
||||
$pdo_options[PDO::SQLSRV_ATTR_CURSOR_SCROLL_TYPE] = PDO::SQLSRV_CURSOR_BUFFERED;
|
||||
return $connection->prepare($query, $pdo_options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary of execute
|
||||
*
|
||||
* @param PDO $connection
|
||||
* @param string $query
|
||||
*
|
||||
* @param PDOStatement;
|
||||
*/
|
||||
function execute($connection, $query, array $args = array()) {
|
||||
$st = prepare($connection, $query);
|
||||
foreach ($args as $key => $value) {
|
||||
if (is_numeric($value)) {
|
||||
$st->bindValue($key, $value, PDO::PARAM_INT);
|
||||
}
|
||||
else {
|
||||
$st->bindValue($key, $value, PDO::PARAM_STR);
|
||||
}
|
||||
}
|
||||
|
||||
$st->execute();
|
||||
|
||||
// Bind column types properly.
|
||||
$null = array();
|
||||
$st->columnNames = array();
|
||||
for ($i = 0; $i < $st->columnCount(); $i++) {
|
||||
$meta = $st->getColumnMeta($i);
|
||||
$st->columnNames[]= $meta['name'];
|
||||
$sqlsrv_type = $meta['sqlsrv:decl_type'];
|
||||
$parts = explode(' ', $sqlsrv_type);
|
||||
$type = reset($parts);
|
||||
switch($type) {
|
||||
case 'varbinary':
|
||||
$null[$i] = NULL;
|
||||
$st->bindColumn($i + 1, $null[$i], PDO::PARAM_LOB, 0, PDO::SQLSRV_ENCODING_BINARY);
|
||||
break;
|
||||
case 'int':
|
||||
case 'bit':
|
||||
case 'smallint':
|
||||
case 'tinyint':
|
||||
case 'bigint':
|
||||
$null[$i] = NULL;
|
||||
$st->bindColumn($i + 1, $null[$i], PDO::PARAM_INT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $st;
|
||||
}
|
||||
|
||||
|
||||
//*******************************************************
|
||||
// TEST BEGIN
|
||||
//*******************************************************
|
||||
|
||||
$connection = connection('default');
|
||||
|
||||
// Drop
|
||||
try {
|
||||
execute($connection, 'DROP TABLE [mytáble]');
|
||||
}
|
||||
catch(Exception $e) {}
|
||||
|
||||
$tablescript = <<<EOF
|
||||
|
||||
CREATE TABLE [dbo].[mytáble](
|
||||
[id] [nchar](10) NULL,
|
||||
[väriable] [nchar](10) NULL,
|
||||
[tésting] [nchar](10) NULL
|
||||
) ON [PRIMARY]
|
||||
|
||||
EOF;
|
||||
|
||||
// Recreate
|
||||
execute($connection, $tablescript);
|
||||
|
||||
$query = <<<EOF
|
||||
INSERT INTO [mytáble] (id, tésting, väriable) VALUES (:db_insert0, :db_insert1, :db_insert2)
|
||||
EOF;
|
||||
|
||||
$blobs = [];
|
||||
|
||||
/** @var MyStatement */
|
||||
$st = prepare($connection, $query);
|
||||
|
||||
$st->bindValue(':db_insert0', 'a', PDO::PARAM_STR);
|
||||
$st->bindValue(':db_insert1', 'b', PDO::PARAM_STR);
|
||||
$st->bindValue(':db_insert2', 'c', PDO::PARAM_STR);
|
||||
|
||||
$st->execute();
|
||||
|
||||
$st = prepare($connection, 'SELECT * FROM [mytáble]');
|
||||
|
||||
$st->execute();
|
||||
|
||||
while($row = $st->fetchAll()){
|
||||
$row = reset($row);
|
||||
echo (isset($row['id']) ? "OK" : "FAIL") , "\n";
|
||||
echo (isset($row['tésting']) ? "OK" : "FAIL") , "\n";
|
||||
echo (isset($row['väriable']) ? "OK" : "FAIL") , "\n";
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $st->columnCount(); $i++) {
|
||||
$meta = $st->getColumnMeta($i);
|
||||
echo $meta['name'] , "\n";
|
||||
}
|
||||
?>
|
||||
|
||||
--EXPECT--
|
||||
OK
|
||||
OK
|
||||
OK
|
||||
id
|
||||
väriable
|
||||
tésting
|
55
test/pdo_sqlsrv/pdo_construct.phpt
Normal file
55
test/pdo_sqlsrv/pdo_construct.phpt
Normal file
|
@ -0,0 +1,55 @@
|
|||
--TEST--
|
||||
Test PDO::__Construct by passing connection options and attributes.
|
||||
--SKIPIF--
|
||||
<?php require('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once 'MsSetup.inc';
|
||||
|
||||
try
|
||||
{
|
||||
$attr = array(
|
||||
PDO::SQLSRV_ATTR_ENCODING => 3,
|
||||
PDO::ATTR_CASE => 2,
|
||||
PDO::ATTR_PREFETCH => false,
|
||||
PDO::ATTR_TIMEOUT => 35,
|
||||
PDO::ATTR_ERRMODE => 2,
|
||||
PDO::ATTR_STRINGIFY_FETCHES => true,
|
||||
PDO::SQLSRV_ATTR_DIRECT_QUERY => true,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL,
|
||||
PDO::SQLSRV_ATTR_CLIENT_BUFFER_MAX_KB_SIZE => 5120,
|
||||
PDO::SQLSRV_ATTR_DIRECT_QUERY => true
|
||||
);
|
||||
|
||||
$dsn = "sqlsrv:Server = $server;" .
|
||||
"ConnectionPooling = false;" .
|
||||
"APP = whatever;" .
|
||||
"LoginTimeout = 1;" .
|
||||
"ApplicationIntent = ReadOnly;" .
|
||||
"Database = $databaseName;" .
|
||||
"Encrypt = false;" .
|
||||
"Failover_Partner = whatever;" .
|
||||
"MultipleActiveResultSets = true;" .
|
||||
"MultiSubnetFailover = NO;" .
|
||||
"QuotedId = false;" .
|
||||
"TraceFile = whatever;" .
|
||||
"TraceOn = true;" .
|
||||
"TransactionIsolation = " . PDO::SQLSRV_TXN_READ_UNCOMMITTED . ";" .
|
||||
"TrustServerCertificate = false;" .
|
||||
"WSID = whatever;"
|
||||
;
|
||||
$conn = new PDO( $dsn, $uid, $pwd, $attr);
|
||||
|
||||
echo "Test Successful";
|
||||
}
|
||||
catch( PDOException $e ) {
|
||||
var_dump( $e );
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
--EXPECT--
|
||||
|
||||
Test Successful
|
460
test/pdo_sqlsrv/pdostatement_GetDataType.phpt
Normal file
460
test/pdo_sqlsrv/pdostatement_GetDataType.phpt
Normal file
|
@ -0,0 +1,460 @@
|
|||
--TEST--
|
||||
Test the different type of data for retrieving
|
||||
--SKIPIF--
|
||||
<?php require('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once 'MsCommon.inc';
|
||||
|
||||
|
||||
function testBigInt($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT BigIntCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testBit($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT BitCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testInt($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT IntCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testSmallInt($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT SmallIntCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testTinyInt($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT TinyIntCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testDecimal($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT DecimalCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testNumeric($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT NumCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testMoney($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT MoneyCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testSmallMoney($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT SmallMoneyCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testFloat($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT FloatCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testReal($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT RealCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testChar($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT CharCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testVarchar($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT VarcharCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testText($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT TextCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testNText($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT NTextCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testNChar($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT NCharCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testNVarchar($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT NVarcharCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testImage($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT ImageCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testBinary($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT BinaryCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testVarbinary($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT VarbinaryCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testDateTime2($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT DateTime2Col FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testDatetimeoffset($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT DTOffsetCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testsmalldatetime($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT SmallDTCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testDateTime($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT DateTimeCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testDate($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT DateCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testNVarcharMax($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT NVarCharMaxCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testTime($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT TimeCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testUniqueidentifier($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT Guidcol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testVarbinaryMax($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT VarbinaryMaxCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testVarcharMax($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT VarcharMaxCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function testXml($db)
|
||||
{
|
||||
$stmt = $db->query("SELECT XmlCol FROM PDO_AllTypes");
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
$db = connect();
|
||||
//$sql = "INSERT INTO PDO_AllTypes(BigIntCol,BitCol,IntCol,) VALUES(" . GetSampleData(4) . ",1,)";
|
||||
//$numRows = $db->exec($sql);
|
||||
|
||||
echo "Test_1 : bigint data type :\n";
|
||||
testBigInt($db);
|
||||
echo "Test_2 : bit data type :\n";
|
||||
testBit($db);
|
||||
echo "Test_3 : int data type :\n";
|
||||
testInt($db);
|
||||
echo "Test_4 : smallint data type:\n";
|
||||
testSmallInt($db);
|
||||
echo "Test_5 : tinyint data type:\n";
|
||||
testTinyInt($db);
|
||||
echo "Test_6 : decimal data type:\n";
|
||||
testDecimal($db);
|
||||
echo "Test_7 : numeric data type:\n";
|
||||
testNumeric($db);
|
||||
echo "Test_8 : money data type:\n";
|
||||
testMoney($db);
|
||||
echo "Test_9 : smallmoney data type:\n";
|
||||
testSmallMoney($db);
|
||||
echo "Test_10 : float data type:\n";
|
||||
testFloat($db);
|
||||
echo "Test_11 : real data type:\n";
|
||||
testReal($db);
|
||||
echo "Test_12 : char data type:\n";
|
||||
testChar($db);
|
||||
echo "Test_13 : varchar data type:\n";
|
||||
testVarchar($db);
|
||||
echo "Test_14 : text data type:\n";
|
||||
testText($db);
|
||||
echo "Test_15 : nchar data type:\n";
|
||||
testNChar($db);
|
||||
echo "Test_16 : nvarchar data type:\n";
|
||||
testNVarchar($db);
|
||||
echo "Test_17 : image data type:\n";
|
||||
testImage($db);
|
||||
echo "Test_18 : binary data type:\n";
|
||||
testBinary($db);
|
||||
echo "Test_19 : varbinary data type:\n";
|
||||
testVarbinary($db);
|
||||
echo "Test_20 : smalldatetime data type:\n";
|
||||
testsmalldatetime($db);
|
||||
echo "Test_21 : datetime data type:\n";
|
||||
testDateTime($db);
|
||||
echo "Test_22 : datetime2 data type:\n";
|
||||
testsmalldatetime($db);
|
||||
echo "Test_23 : datetimeoffset data type:\n";
|
||||
testDatetimeoffset($db);
|
||||
echo "Test_24 : time data type:\n";
|
||||
testTime($db);
|
||||
echo "Test_25 : Uniqueidentifier data type:\n";
|
||||
testUniqueidentifier($db);
|
||||
echo "Test_26 : VarbinaryMax data type:\n";
|
||||
testVarbinaryMax($db);
|
||||
echo "Test_27 : VarcharMax data type:\n";
|
||||
testVarcharMax($db);
|
||||
echo "Test_28 : xml data type:\n";
|
||||
testXml($db);
|
||||
echo "Test_29 : ntext data type:\n";
|
||||
testNText($db);
|
||||
echo "Test_30 : nvarcharmax data type:\n";
|
||||
testNVarcharMax($db);
|
||||
echo "Test_31 : date data type:\n";
|
||||
testDate($db);
|
||||
}
|
||||
catch (PDOException $e)
|
||||
{
|
||||
var_dump($e);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
--EXPECT--
|
||||
Test_1 : bigint data type :
|
||||
array(1) {
|
||||
["BigIntCol"]=>
|
||||
string(1) "1"
|
||||
}
|
||||
Test_2 : bit data type :
|
||||
array(1) {
|
||||
["BitCol"]=>
|
||||
string(1) "0"
|
||||
}
|
||||
Test_3 : int data type :
|
||||
array(1) {
|
||||
["IntCol"]=>
|
||||
string(1) "1"
|
||||
}
|
||||
Test_4 : smallint data type:
|
||||
array(1) {
|
||||
["SmallIntCol"]=>
|
||||
string(1) "1"
|
||||
}
|
||||
Test_5 : tinyint data type:
|
||||
array(1) {
|
||||
["TinyIntCol"]=>
|
||||
string(1) "1"
|
||||
}
|
||||
Test_6 : decimal data type:
|
||||
array(1) {
|
||||
["DecimalCol"]=>
|
||||
string(3) "111"
|
||||
}
|
||||
Test_7 : numeric data type:
|
||||
array(1) {
|
||||
["NumCol"]=>
|
||||
string(1) "1"
|
||||
}
|
||||
Test_8 : money data type:
|
||||
array(1) {
|
||||
["MoneyCol"]=>
|
||||
string(8) "111.1110"
|
||||
}
|
||||
Test_9 : smallmoney data type:
|
||||
array(1) {
|
||||
["SmallMoneyCol"]=>
|
||||
string(8) "111.1110"
|
||||
}
|
||||
Test_10 : float data type:
|
||||
array(1) {
|
||||
["FloatCol"]=>
|
||||
string(7) "111.111"
|
||||
}
|
||||
Test_11 : real data type:
|
||||
array(1) {
|
||||
["RealCol"]=>
|
||||
string(7) "111.111"
|
||||
}
|
||||
Test_12 : char data type:
|
||||
array(1) {
|
||||
["CharCol"]=>
|
||||
string(10) "STRINGCOL1"
|
||||
}
|
||||
Test_13 : varchar data type:
|
||||
array(1) {
|
||||
["VarcharCol"]=>
|
||||
string(10) "STRINGCOL1"
|
||||
}
|
||||
Test_14 : text data type:
|
||||
array(1) {
|
||||
["TextCol"]=>
|
||||
string(420) " 1 This is a really large string used to test certain large data types like xml data type. The length of this string is greater than 256 to correctly test a large data type. This is currently used by atleast varchar type and by xml type. The fetch tests are the primary consumer of this string to validate that fetch on large types work fine. The length of this string as counted in terms of number of characters is 417."
|
||||
}
|
||||
Test_15 : nchar data type:
|
||||
array(1) {
|
||||
["NCharCol"]=>
|
||||
string(10) "STRINGCOL1"
|
||||
}
|
||||
Test_16 : nvarchar data type:
|
||||
array(1) {
|
||||
["NVarcharCol"]=>
|
||||
string(10) "STRINGCOL1"
|
||||
}
|
||||
Test_17 : image data type:
|
||||
array(1) {
|
||||
["ImageCol"]=>
|
||||
string(1) " |