Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Avoid sql error on postgres #859

Merged
merged 3 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,15 @@ jobs:
fail-fast: false
matrix:
server-versions: ['stable25', 'stable27', 'master']
php-versions: ['8.1']
databases: ['mysql']
include:
- php-versions: '8.1'
- server-versions: 'stable25'
databases: 'sqlite'
- server-versions: 'stable27'
databases: 'mysql'
- server-versions: 'master'
databases: 'sqlite'
- server-versions: 'master'
databases: 'mysql'
- server-versions: 'master'
php-versions: '8.3'
databases: 'pgsql'
- server-versions: 'master'
php-versions: '8.3'
databases: 'mysql'
databases: 'sqlite'

name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

Expand Down Expand Up @@ -118,6 +112,11 @@ jobs:
working-directory: apps/${{ env.APP_NAME }}/tests/integration
run: ./run.sh

- name: Print logs
if: always()
run: |
cat data/nextcloud.log

- name: Query count
if: ${{ matrix.databases == 'mysql' && matrix.php-versions == '8.2' && matrix.server-versions == 'master' && github.event_name == 'pull_request' }}
uses: actions/github-script@v6
Expand Down
5 changes: 3 additions & 2 deletions lib/Db/Row2Mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ private function getRows(array $rowIds, array $columnIds): array {
$qbSqlForColumnTypes = null;
foreach ($this->columnsHelper->columns as $columnType) {
$qbTmp = $this->db->getQueryBuilder();
$qbTmp->select('*')
$qbTmp->select('row_id', 'column_id', 'last_edit_at', 'last_edit_by')
->selectAlias($qb->expr()->castColumn('value', IQueryBuilder::PARAM_STR), 'value')
->from('tables_row_cells_'.$columnType)
->where($qb->expr()->in('column_id', $qb->createNamedParameter($columnIds, IQueryBuilder::PARAM_INT_ARRAY, ':columnIds')))
->andWhere($qb->expr()->in('row_id', $qb->createNamedParameter($rowIds, IQueryBuilder::PARAM_INT_ARRAY, ':rowsIds')));
Expand All @@ -208,7 +209,7 @@ private function getRows(array $rowIds, array $columnIds): array {

$qb->select('row_id', 'column_id', 'created_by', 'created_at', 't1.last_edit_by', 't1.last_edit_at', 'value', 'table_id')
->from($qb->createFunction($qbSqlForColumnTypes), 't1')
->innerJoin('t1', 'tables_row_sleeves', 'rowSleeve', 'rowSleeve.id = t1.row_id');
->innerJoin('t1', 'tables_row_sleeves', 'rs', 'rs.id = t1.row_id');

try {
$result = $this->db->executeQuery($qb->getSQL(), $qb->getParameters(), $qb->getParameterTypes());
Expand Down
Loading