--TEST-- PDO Fetch LOB Test --DESCRIPTION-- Verification for LOB handling. --ENV-- PHPT_EXEC=true --SKIPIF-- --FILE-- getMessage(); } function fetchLob($offset, $conn, $table, $sqlType, $data1, $data2) { $id = null; $label = null; createTable($conn, $table, array(new ColumnMeta("int", "id", "NOT NULL PRIMARY KEY"), "label" => $sqlType)); insertRow($conn, $table, array("id" => $data1, "label" => $data2)); // Check data fetched with PDO::FETCH_BOUND $stmt = $conn->query("SELECT * FROM [$table]"); if (!$stmt->bindColumn(1, $id, PDO::PARAM_INT)) { logInfo($offset, "Cannot bind integer column"); } if (!$stmt->bindColumn(2, $label, PDO::PARAM_LOB)) { logInfo($offset, "Cannot bind LOB column"); } if (!$stmt->fetch(PDO::FETCH_BOUND)) { logInfo($offset, "Cannot fetch bound data"); } if ($id != $data1) { logInfo($offset, "ID data corruption: [$id] instead of [$data1]"); } if (PHP_VERSION_ID < 80100) { if ($label != $data2) { logInfo($offset, "Label data corruption: [$label] instead of [$data2]"); } } else { if (!compareResourceToInput($label, $data2)) { logInfo($offset, "Label data corruption"); } } unset($stmt); unset($label); // Check data fetched with PDO::FETCH_ASSOC $stmt = $conn->query("SELECT * FROM [$table]"); $refData = $stmt->fetch(PDO::FETCH_ASSOC); if ($refData['id'] != $data1) { $id = $refData['id']; logInfo($offset, "ID data corruption: [$id] instead of [$data1]"); } if ($refData['label'] != $data2) { $label = $refData['label']; logInfo($offset, "Label data corruption: [$label] instead of [$data2]"); } unset($stmt); unset($refData); } function logInfo($offset, $msg) { printf("[%03d] %s\n", $offset, $msg); } ?> --EXPECT-- Test 'PDO Statement - Fetch LOB' completed successfully.