Fixed the helper method for inserting nulls to binary fields (#1287)
This commit is contained in:
parent
656767aa16
commit
9eef0b946c
|
@ -740,7 +740,11 @@ function insertTestRow($conn, $tbname, $index)
|
|||
$value = $value[0];
|
||||
// this might be an input to a decimal, a numeric or a binary field
|
||||
if (isBinary($col)) {
|
||||
$value = "0x" . $value; // annotate the input string as a hex string
|
||||
if (!is_null($value)) {
|
||||
$value = "0x" . $value; // annotate the input string as a hex string
|
||||
} else {
|
||||
$value = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_null($value)) {
|
||||
|
|
|
@ -23,7 +23,7 @@ function fetchFields()
|
|||
AE\createTestTable($conn1, $tableName);
|
||||
|
||||
$startRow = 1;
|
||||
$noRows = 14; // 20;
|
||||
$noRows = 20;
|
||||
AE\insertTestRowsByRange($conn1, $tableName, $startRow, $startRow + $noRows - 1);
|
||||
|
||||
$query = "SELECT * FROM [$tableName] ORDER BY c27_timestamp";
|
||||
|
@ -50,7 +50,6 @@ function fetchFields()
|
|||
// should check data even if $fld is null
|
||||
$data = AE\getInsertData($startRow + $i, $col);
|
||||
if (!checkData($col, $fld, $data, isBinary($col))) {
|
||||
// echo("\nData error\nExpected:\n$data\nActual:\n$fld\n");
|
||||
echo("\nData error\nExpected:\n");
|
||||
var_dump($data);
|
||||
echo("\nActual:\n");
|
||||
|
@ -76,7 +75,7 @@ function checkData($col, $actual, $expected, $isBinary)
|
|||
|
||||
// First check for nulls
|
||||
if (is_null($expected)) {
|
||||
$success = ($isBinary) ? empty($actual) : is_null($actual);
|
||||
$success = is_null($actual);
|
||||
if (!$success) {
|
||||
trace("\nData error\nExpected null but Actual:\n$actual\n");
|
||||
}
|
||||
|
|
|
@ -129,8 +129,7 @@ startTest($testName);
|
|||
if (isLocaleSupported()) {
|
||||
try {
|
||||
setUTF8Data(false);
|
||||
// streamRead(20, 1);
|
||||
streamRead(14, 1);
|
||||
streamRead(20, 1);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
@ -142,8 +141,7 @@ startTest($testName);
|
|||
try {
|
||||
setUTF8Data(true);
|
||||
resetLocaleToDefault();
|
||||
// streamRead(20, 1);
|
||||
streamRead(14, 1);
|
||||
streamRead(20, 1);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
|
|
@ -152,8 +152,7 @@ startTest($testName);
|
|||
if (isLocaleSupported()) {
|
||||
try {
|
||||
setUTF8Data(false);
|
||||
// streamScroll(20, 1);
|
||||
streamScroll(14, 1);
|
||||
streamScroll(20, 1);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
@ -165,8 +164,7 @@ startTest($testName);
|
|||
try {
|
||||
setUTF8Data(true);
|
||||
resetLocaleToDefault();
|
||||
// streamScroll(20, 1);
|
||||
streamScroll(14, 1);
|
||||
streamScroll(20, 1);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue