diff --git a/.github/workflows/mysqli.yml b/.github/workflows/mysqli.yml index 554b76787..ea9a2a315 100644 --- a/.github/workflows/mysqli.yml +++ b/.github/workflows/mysqli.yml @@ -30,13 +30,13 @@ jobs: fail-fast: false matrix: php-version: - - "8.1" + - "8.2" test-args: - "--group Database" - "-v --group Cache" - "-v --group Config" - "-v --group Entity" - - "-v --group Installer" +# - "-v --group Installer" services: mysql: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 84ab5b880..d1c72ce3e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -9,35 +9,38 @@ env: DRUDBAL_DRUPAL_PROFILE: "standard" SIMPLETEST_BASE_URL: "http://localhost:8080" PHPUNIT_SKIP_CLASS: '[ - "Drupal\\KernelTests\\Core\\Cache\\ApcuBackendTest", - "Drupal\\Tests\\file\\Functional\\DownloadTest" + "Drupal\\KernelTests\\Core\\Cache\\ApcuBackendTest" ]' jobs: ################################# - sqlite-pdo: - name: "SQLite with PDO" - runs-on: ubuntu-20.04 + mariadb-pdo: + name: "MariaDb" + runs-on: ubuntu-latest env: - DRUDBAL_ENV: "dbal/sqlite/file" - DBAL_URL: "sqlite://localhost/sites/drudbal.sqlite" - SIMPLETEST_DB: "dbal://localhost/sites/drudbal.sqlite?module=drudbal&dbal_driver=pdo_sqlite" + DRUDBAL_ENV: "dbal/mariadb" + DBAL_URL: "mysql://root:@0.0.0.0:3306/drudbal" + SIMPLETEST_DB: "dbal://root:@0.0.0.0:3306/drudbal?module=drudbal&dbal_driver=pdo_mysql" strategy: fail-fast: false matrix: php-version: -# - "8.1" - - "8.2" + - "8.1" +# - "8.2" test-args: - "--group Database" -# - "--group Entity" -# - "--group Cache,Config" -# - "--group field,Field" -# - "--group file" -# - "--group views" + + services: + mariadb: + image: "mariadb:10.5" + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: "drudbal" + ports: + - "3306:3306" steps: - name: Install PHP @@ -45,6 +48,7 @@ jobs: with: php-version: "${{ matrix.php-version }}" coverage: "none" + extensions: "pdo_mysql" ini-values: "zend.assertions=1" - name: Checkout Drupal @@ -61,6 +65,7 @@ jobs: - name: Install Composer dependencies run: | composer install --no-progress --ansi + composer config --no-plugins allow-plugins.composer/package-versions-deprecated true - name: Composer require DruDbal from local staging run: | diff --git a/src/Driver/Database/dbal/DbalExtension/AbstractMySqlExtension.php b/src/Driver/Database/dbal/DbalExtension/AbstractMySqlExtension.php index d2944a364..ec35bdd8a 100644 --- a/src/Driver/Database/dbal/DbalExtension/AbstractMySqlExtension.php +++ b/src/Driver/Database/dbal/DbalExtension/AbstractMySqlExtension.php @@ -556,23 +556,6 @@ public function delegateTableExists(&$result, $drupal_table_name) { return TRUE; } - /** - * {@inheritdoc} - */ - public function delegateFieldExists(&$result, $drupal_table_name, $field_name) { - // The DBAL Schema manager is quite slow here. - // Instead, we try to select from the table and field in question. If it - // fails, the most likely reason is that it does not exist. - try { - $this->getDbalConnection()->executeQuery("SELECT $field_name FROM " . $this->connection->getPrefixedTableName($drupal_table_name) . " LIMIT 1 OFFSET 0"); - $result = TRUE; - } - catch (\Exception $e) { - $result = FALSE; - } - return TRUE; - } - /** * {@inheritdoc} */ diff --git a/src/Driver/Database/dbal/Schema.php b/src/Driver/Database/dbal/Schema.php index 1c8abe0d7..57903b25e 100644 --- a/src/Driver/Database/dbal/Schema.php +++ b/src/Driver/Database/dbal/Schema.php @@ -826,11 +826,11 @@ public function fieldExists($table, $column) { //if ($xxx) dump(['fieldExists notableexist']); return FALSE; } -//if ($xxx) dump([ -// 'fieldExists list', -// $this->dbalExtension->getDbFieldName($column, FALSE), -// array_keys($this->dbalSchemaManager->listTableColumns($this->connection()->getPrefixedTableName($table))) -//]); +/*if ($xxx) dump([ + 'fieldExists list', + $this->dbalExtension->getDbFieldName($column, FALSE), + array_keys($this->dbalSchemaManager->listTableColumns($this->connection()->getPrefixedTableName($table))) +]);*/ // Column name must not be quoted here. return in_array( $this->dbalExtension->getDbFieldName($column, FALSE),