Skip to content

Commit d7382a6

Browse files
committed
Remove replace database prefix from alias
No longer needed because setAlias() now tracks the alias and prevents prefix from being added.
1 parent 2576633 commit d7382a6

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

system/Database/BaseBuilder.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,14 +2723,9 @@ protected function _deleteBatch(string $table, array $keys, array $values): stri
27232723
}
27242724
}
27252725

2726-
// remove database prefix from alias in where
2727-
$sql .= ' ' . str_replace(
2728-
$this->db->DBPrefix . trim($alias, $this->db->escapeChar),
2729-
trim($alias, $this->db->escapeChar),
2730-
$this->compileWhereHaving('QBWhere')
2731-
);
2726+
$sql .= ' ' . $this->compileWhereHaving('QBWhere');
27322727

2733-
$this->QBOptions['sql'] = $sql;
2728+
$this->QBOptions['sql'] = trim($sql);
27342729
}
27352730

27362731
if (isset($this->QBOptions['fromQuery'])) {

system/Database/OCI8/Builder.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -486,15 +486,10 @@ protected function _deleteBatch(string $table, array $keys, array $values): stri
486486
}
487487
}
488488

489-
// remove database prefix from alias in where
490489
$sql .= ' ' . str_replace(
491490
'WHERE ',
492491
'AND ',
493-
str_replace(
494-
$this->db->DBPrefix . trim($alias, $this->db->escapeChar),
495-
trim($alias, $this->db->escapeChar),
496-
$this->compileWhereHaving('QBWhere')
497-
)
492+
$this->compileWhereHaving('QBWhere')
498493
) . ')';
499494

500495
$this->QBOptions['sql'] = $sql;

system/Database/Postgre/Builder.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -460,15 +460,10 @@ protected function _deleteBatch(string $table, array $keys, array $values): stri
460460
}
461461
}
462462

463-
// remove database prefix from alias in where
464463
$sql .= ' ' . str_replace(
465464
'WHERE ',
466465
'AND ',
467-
str_replace(
468-
$this->db->DBPrefix . trim($alias, $this->db->escapeChar),
469-
trim($alias, $this->db->escapeChar),
470-
$this->compileWhereHaving('QBWhere')
471-
)
466+
$this->compileWhereHaving('QBWhere')
472467
);
473468

474469
$this->QBOptions['sql'] = $sql;

0 commit comments

Comments
 (0)