diff --git a/src/Mysqldump.php b/src/Mysqldump.php index 896fb24c..ad4e8144 100644 --- a/src/Mysqldump.php +++ b/src/Mysqldump.php @@ -950,9 +950,11 @@ private function endListValues(string $tableName, int $count = 0) protected function getColumnStmt(string $tableName): array { $colStmt = []; - foreach ($this->tableColumnTypes[$tableName] as $colName => $colType) { - if ($colType['type'] == 'bit' && $this->settings->isEnabled('hex-blob')) { + // TODO handle bug where PHP 8.1 returns double field wrong + if ($colType['type'] == 'double' && PHP_VERSION_ID > 80100) { + $colStmt[] = sprintf("CONCAT(`%s`) AS `%s`", $colName, $colName); + } elseif ($colType['type'] === 'bit' && $this->settings->isEnabled('hex-blob')) { $colStmt[] = sprintf("LPAD(HEX(`%s`),2,'0') AS `%s`", $colName, $colName); } elseif ($colType['is_blob'] && $this->settings->isEnabled('hex-blob')) { $colStmt[] = sprintf("HEX(`%s`) AS `%s`", $colName, $colName); diff --git a/tests/scripts/test.sh b/tests/scripts/test.sh index c64a3104..ff2d3b47 100755 --- a/tests/scripts/test.sh +++ b/tests/scripts/test.sh @@ -152,8 +152,11 @@ $MYSQLDUMP_CMD test001 \ errCode=$?; ret[((index++))]=$errCode printf "\nRun mysqldump with PHP:\n\n" -php pdo_checks.php $HOST || { echo "ERROR running pdo_checks.php" && exit -1; } -errCode=$?; ret[((index++))]=$errCode + +# Uncomment following 2 lines if you wanna test PDO +#php pdo_checks.php $HOST || { echo "ERROR running pdo_checks.php" && exit -1; } +#errCode=$?; ret[((index++))]=$errCode + php test.php $HOST || { echo "ERROR running test.php" && exit -1; } errCode=$?; ret[((index++))]=$errCode