Skip to content

2.25.2.0-b280

@timothy-e timothy-e tagged this 04 Apr 12:25
Summary:
Setting the defaults for `BasePgRegressTestPorted` to match more closely with Postgres behaviour will help simplify efforts to port more Postgres tests.

5aea237b1b34 / D42034 enabled inheritance on Yugabyte, but did not update all of the regression tests. This diff sets `ysql_enable_inheritance=true` for all tests that derive from `BasePgRegressTestPorted`. This cascades into some changes:
* any Java test deriving from this class doesn't need to explicitly set the flag anymore.
* regress tests that use table inheritance no longer have an error in their output. Many of these tests have a comment similar to "TODO: port more once inheritance is enabled".  Generally, uncommenting the following lines results in the expected output. This change touches only lines related to `INHERITS`, and does not attempt to re-port other sections of the affected files.
* `yb_enable_read_committed_isolation` is also now enabled by default in `BasePgRegressTestPorted` to enable some new test cases. This does not set the isolation level to read committed, but just **allows** it to be set.

To help review, it's helpful to diff the `yb.port.*.sql` and `yb.port.*.out` files with their sources.
```
function portdiffsql() {
  diff src/postgres/src/test/regress/sql/$1.sql src/postgres/src/test/regress/sql/yb.port.$1.sql
}
function portdiffout() {
  diff src/postgres/src/test/regress/expected/$1.out src/postgres/src/test/regress/expected/yb.port.$1.out
}
portdiffsql foreign_data
portdiffsql foreign_key
portdiffsql generated
portdiffsql insert_conflict
portdiffsql privileges
portdiffsql rowsecurity
portdiffsql truncate

portdiffout foreign_data
portdiffout foreign_key
portdiffout generated
portdiffout insert_conflict
portdiffout privileges
portdiffout rowsecurity
portdiffout truncate
```

Differences worth calling out:
* There are a few cases where we need to delete + reinsert rows to get match the ctid update behaviour of Postgres
* `yb.port.foreign_key` has extra changes because indexes on `INET` are not supported.
* `yb.port.truncate` has some tests for `TRUNCATE ONLY` that depend on `TRUNCATE` being transactional. It's not transactional in YB,  so to keep the coverage of `TRUNCATE ONLY`, manually reset the table after each `ROLLBACK`. (lines ~1640 in yb.port.truncate.sql`). The results of the `SELECT`s are identical to PG.
Jira: DB-15944

Test Plan:
```
./yb_build.sh --java-test TestPgRegressPgAuth
./yb_build.sh --java-test TestPgRegressPgDml
./yb_build.sh --java-test TestPgRegressPgForeignData
./yb_build.sh --java-test TestPgRegressPgGenerated
./yb_build.sh --java-test TestPgRegressPgMiscIndependent
./yb_build.sh --java-test TestPgRegressForeignKey
```

Jenkins

Reviewers: fizaa, sanketh

Reviewed By: sanketh

Subscribers: smishra, yql

Differential Revision: https://phorge.dev.yugabyte.com/D42816
Assets 2
Loading