polypheny / Polypheny-DB

A self-adaptive Polystore that provides cost- and workload aware access to heterogeneous data.
https://polypheny.org
Apache License 2.0
123 stars 82 forks source link

Wrong SQL query on document data deletes the document data #437

Closed Anphisa closed 1 year ago

Anphisa commented 1 year ago

Operating System (Polypheny-DB)

No response

Polypheny-DB Version

339fd10f9dc23f7c8daf8affbe6f9e01d11ad8eb

Affected Areas

DB, UI

Browser

Chrome

Client Operating System

Windows 10

Bug Description

When I use a wrong SQL query on document data, I seem to delete the document data.

Reproduction Steps

This throws an error:

Error: From line 1, column 15 to line 1, column 32: Object 'userid' not found within 'gavel_doc'

But it also deletes the document data that was added with the MQL code above. At least, it isn't visible via the UI "Data" element anymore.

Expected Behavior

Throw the same error, but keep the data.

Relevant Log Output

No response

datomo commented 1 year ago

Hey @Anphisa, thank you for this issue. Due to a missing commit on the catalog the implicit creation of the collection with the db.UserProperties.insert( { userid: "0", age: 20, eyecolor: "brown" } ) statement was still not fixed. This was then wrongfully also part of the rollback due to the incorrect query after. This should be fixed in #437 but requires some testing as I have moved the commit of the catalog into the commit of the transaction itself.

To temporarily bypass this error from happening, the explicit creation of the collection can be used: db.createCollection(("UserProperties") This has to be executed between the creation of the namespace and the insertion.

datomo commented 1 year ago

Fixed in #438.