Skip to content

Fix getting columns when sql mode is using ansi_quotes (#669) #2506

Fix getting columns when sql mode is using ansi_quotes (#669)

Fix getting columns when sql mode is using ansi_quotes (#669) #2506

Workflow file for this run

name: Unit Tests MySQL
on:
push:
branches:
- main
pull_request:
concurrency:
group: tests-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches
cancel-in-progress: true
jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php-version: "7.2"
db-image: 'mysql:5.7'
reflector: "pdo-mysql"
mode: "recording"
dependencies: "lowest"
- php-version: "7.2"
db-image: 'mysql:5.7'
reflector: "pdo-mysql"
mode: "recording"
dependencies: "highest"
- php-version: "7.3"
db-image: 'mysql:5.7'
reflector: "pdo-mysql"
mode: "recording"
dependencies: "highest"
- php-version: "7.4"
db-image: 'mysql:8.0'
reflector: "pdo-mysql"
mode: "recording"
dependencies: "highest"
- php-version: "8.0"
db-image: 'mysql:8.0'
reflector: "pdo-mysql"
mode: "recording"
dependencies: "highest"
- php-version: "8.0"
db-image: 'mysql:8.0'
reflector: "mysqli"
mode: "recording"
dependencies: "highest"
- php-version: "8.1"
db-image: 'mysql:8.0'
reflector: "mysqli"
mode: "recording"
dependencies: "highest"
- php-version: '8.1'
db-image: 'mariadb:latest'
reflector: "mysqli"
mode: "recording"
dependencies: "highest"
- php-version: "8.2"
db-image: 'mysql:8.0'
reflector: "mysqli"
mode: "recording"
dependencies: "highest"
- php-version: '8.2'
db-image: 'mariadb:latest'
reflector: "mysqli"
mode: "recording"
dependencies: "highest"
- php-version: "8.1"
db-image: 'mysql:8.0'
reflector: "pdo-mysql"
mode: "replay-and-recording"
dependencies: "highest"
- php-version: "8.1"
db-image: 'mysql:8.0'
reflector: "pdo-mysql"
mode: "empty-recording"
dependencies: "highest"
- php-version: "8.1"
db-image: 'mysql:8.0'
reflector: "pdo-mysql"
mode: "empty-replay-and-recording"
dependencies: "highest"
env:
DBA_REFLECTOR: ${{ matrix.reflector }}
DBA_MODE: ${{ matrix.mode }}
# https://docs.github.com/en/free-pro-team@latest/actions/guides/about-service-containers
services:
database:
image: ${{ matrix.db-image }}
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: ${{ startsWith(matrix.db-image, 'mariadb') && '--health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=1s --health-timeout=10s --health-retries=60' || '--health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3' }}
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: none
- uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"
# ignore php8.2 requirement error https://github.com/sebastianbergmann/phpunit/issues/5033
composer-options: "--ignore-platform-req=php+"
- name: Install sqlftw/sqlftw (optional dependency)
run: composer require sqlftw/sqlftw --ignore-platform-req=php+
if: "${{matrix.php-version != '7.2' && matrix.php-version != '7.3'}}"
- name: Install doctrine/dbal (optional dependency)
run: composer require doctrine/dbal:^3 --ignore-platform-req=php+
if: "${{matrix.php-version != '7.2'}}"
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Lint
run: composer exec -- parallel-lint --colors src/ tests/
- name: Setup mysql
run: |
mysql -uroot -h127.0.0.1 -proot < tests/schema.sql
- run: composer run phpunit -- --colors=always
replay:
name: PHPUnit (reflection replay)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php-version: "8.1"
reflector: "pdo-mysql"
mode: "replay"
- php-version: "8.1"
reflector: "mysqli"
mode: "replay"
env:
DBA_REFLECTOR: ${{ matrix.reflector }}
DBA_MODE: ${{ matrix.mode }}
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: none
- uses: "ramsey/composer-install@v3"
with:
# ignore php8.2 requirement error https://github.com/sebastianbergmann/phpunit/issues/5033
composer-options: "--ignore-platform-req=php+"
- name: Install sqlftw/sqlftw (optional dependency)
run: composer require sqlftw/sqlftw --ignore-platform-req=php+
if: "${{matrix.php-version != '7.2' && matrix.php-version != '7.3'}}"
- name: Install doctrine/dbal (optional dependency)
run: composer require doctrine/dbal:^3 --ignore-platform-req=php+
if: "${{matrix.php-version != '7.2'}}"
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- run: composer run phpunit -- --colors=always