Commit 7770bcc5 authored by catch's avatar catch
Browse files

Issue #3312641 by nkoporec, pradhumanjainOSL, Ratan Priya, Anchal_gupta,...

Issue #3312641 by nkoporec, pradhumanjainOSL, Ratan Priya, Anchal_gupta, daffie, mglaman, catch: Bring back temporary tables (Connection::queryTemporary())
parent 70794a8d
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -1814,11 +1814,6 @@ protected function generateTemporaryTableName() {
   *
   * @return string
   *   The name of the temporary table.
   *
   * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. There is no
   *   replacement.
   *
   * @see https://www.drupal.org/node/3211781
   */
  abstract public function queryTemporary($query, array $args = [], array $options = []);

+0 −1
Original line number Diff line number Diff line
@@ -251,7 +251,6 @@ public function queryRange($query, $from, $count, array $args = [], array $optio
   * {@inheritdoc}
   */
  public function queryTemporary($query, array $args = [], array $options = []) {
    @trigger_error('Connection::queryTemporary() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement. See https://www.drupal.org/node/3211781', E_USER_DEPRECATED);
    $tablename = $this->generateTemporaryTableName();
    $this->query('CREATE TEMPORARY TABLE {' . $tablename . '} Engine=MEMORY ' . $query, $args, $options);
    return $tablename;
+0 −1
Original line number Diff line number Diff line
@@ -218,7 +218,6 @@ public function queryRange($query, $from, $count, array $args = [], array $optio
   * {@inheritdoc}
   */
  public function queryTemporary($query, array $args = [], array $options = []) {
    @trigger_error('Connection::queryTemporary() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement. See https://www.drupal.org/node/3211781', E_USER_DEPRECATED);
    $tablename = $this->generateTemporaryTableName();
    $this->query('CREATE TEMPORARY TABLE {' . $tablename . '} AS ' . $query, $args, $options);
    return $tablename;
+0 −1
Original line number Diff line number Diff line
@@ -391,7 +391,6 @@ public function queryRange($query, $from, $count, array $args = [], array $optio
   * {@inheritdoc}
   */
  public function queryTemporary($query, array $args = [], array $options = []) {
    @trigger_error('Connection::queryTemporary() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement. See https://www.drupal.org/node/3211781', E_USER_DEPRECATED);
    // Generate a new temporary table name and protect it from prefixing.
    // SQLite requires that temporary tables to be non-qualified.
    $tablename = $this->generateTemporaryTableName();
+0 −1
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ public function countTableRows($table_name) {
   * Confirms that temporary tables work and are limited to one request.
   */
  public function testTemporaryQuery() {
    $this->expectDeprecation('Connection::queryTemporary() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement. See https://www.drupal.org/node/3211781');
    $this->expectDeprecation('Connection::generateTemporaryTableName() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement. See https://www.drupal.org/node/3211781');

    $connection = Database::getConnection();
Loading