Skip to content

Commit e887276

Browse files
authored
修复oracle数据库ping语句 (#721)
* 修复oracle数据库ping语句 * fix coding standard
1 parent 6d03c80 commit e887276

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Db/Drivers/TPdoDriver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ public function ping(): bool
8282
}
8383
try
8484
{
85-
if ($instance->query('select 1'))
85+
$driverName = $this->instance->getAttribute(\PDO::ATTR_DRIVER_NAME);
86+
$is_oci = 'oci' === $driverName;
87+
if ($instance->query($is_oci ? 'select 1 from dual' : 'select 1'))
8688
{
8789
return true;
8890
}

0 commit comments

Comments
 (0)