arenadata / gpdb

Arenadata DB
https://docs.arenadata.io/en/ADB/current/introduction/intro.html
Apache License 2.0
40 stars 22 forks source link

ADBDEV-6389: Fix CTAS from prepared statement which contains modifying DML #1068

Closed RekGRpth closed 1 week ago

RekGRpth commented 3 weeks ago

Fix CTAS from prepared statement which contains modifying DML

The commit bad6ceb replaced the isCTAS boolean field in the Query structure with a parentStmtType uint8, but forgot to change its read/write from READ_BOOL_FIELD/WRITE_BOOL_FIELD to READ_UINT_FIELD/WRITE_UINT_FIELD and READ_UINT8_FIELD/WRITE_UINT8_FIELD. This patch fixes that bug as well.

The commit 93abe74 added conditions on modifying DMLs, but left the previous assert, which does not allow CTAS. At the same time, when executing CTAS from prepared statements which containes modifying DML, this assert should allow such case. This patch solves the problem.

The commit 19cd1cf introduced an incorrect field reading order in the _readQuery function. This patch fixes that issue as well.

red1452 commented 2 weeks ago

Remarks:

1) prepared statement WHICH contains 2) such case

RekGRpth commented 2 weeks ago

Remarks:

1. prepared statement WHICH contains

2. such case

applied

RekGRpth commented 2 weeks ago

bender build

swork12 commented 1 week ago

bender build

swork12 commented 1 week ago

bender build