Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

+5 -16
View File
@@ -30,9 +30,6 @@ class _Db extends \mysqli
const SELECT_MULTIDIMENSIONAL_JOINS = 4;
const SELECT_FROM_WRITE_SERVER = 8;
/* @deprecated */
const SELECT_SQL_CALC_FOUND_ROWS = 2; // This is deprecated and will throw an exception if you attempt to use it
/**
* INSERT/UPDATE flags
*/
@@ -665,9 +662,10 @@ class _Db extends \mysqli
$count = 1;
while ( $stmt->error )
{
/* If we hit a deadlock, try again once */
if ( $stmt->errno === 1213 and $count < 2 )
/* If we hit a deadlock, try again upto 3 times total */
if ( $stmt->errno === 1213 and $count <= 3 )
{
usleep(250);
$stmt->execute();
$count++;
}
@@ -720,7 +718,7 @@ class _Db extends \mysqli
* @return \IPS\Db\Select
*
*/
public function select( $columns=NULL, $table, $where=NULL, $order=NULL, $limit=NULL, $group=NULL, $having=NULL, $flags=0 )
public function select( $columns, $table, $where=NULL, $order=NULL, $limit=NULL, $group=NULL, $having=NULL, $flags=0 )
{
$binds = array();
$query = 'SELECT ';
@@ -731,11 +729,6 @@ class _Db extends \mysqli
$query .= 'DISTINCT ';
}
if ( $flags & static::SELECT_SQL_CALC_FOUND_ROWS AND \IPS\IN_DEV )
{
throw new \IPS\Db\Exception( "Constant SELECT_SQL_CALC_FOUND_ROWS is no longer supported", -2 );
}
/* Columns */
if ( \is_string( $columns ) )
{
@@ -871,11 +864,6 @@ class _Db extends \mysqli
*/
public function union( $selects, $order, $limit, $group=NULL, $unionAll=FALSE, $flags=0, $where=NULL, $querySelect='*' )
{
if ( $flags & static::SELECT_SQL_CALC_FOUND_ROWS AND \IPS\IN_DEV )
{
throw new \IPS\Db\Exception( "Constant SELECT_SQL_CALC_FOUND_ROWS is no longer supported", -2 );
}
/* Combine selects */
$query = array();
$binds = array();
@@ -2894,6 +2882,7 @@ class _Db extends \mysqli
{
foreach ( $binds as $b )
{
$b = ( $b instanceof \IPS\Db\Select ) ? (string) $b : $b;
$query = preg_replace( '/\?/', var_export( $b, TRUE ), $query, 1 );
}
}