orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.75k stars 871 forks source link

sql batch doesn't respect to unique index for 2.0.8 version #4010

Closed martingg88 closed 9 years ago

martingg88 commented 9 years ago

It won't throw unique index exception for the following query. It works before 2.0.7 version but not for 2.0.8 Please take note the unique index here is "email"

BEGIN LET user_one = INSERT INTO user SET first_name = "ckgan", country = "MY", ctime = "2015-04-24T03:29:58+0000", mtime = "2015-04-24T03:29:58+0000" LET account = INSERT INTO account SET email = "ckgan@hotmail.com", password = "d8", username = "ckgan200421644", nickname = "ckgan2004", language = "en", timezone = "Asia/Kuala_Lumpur", active= false, online = false, ctime = "2015-04-24T03:29:58+0000", mtime = "2015-04-24T03:29:58+0000" COMMIT RETURN $user_one

lvca commented 9 years ago

Did you see 2 records with the same email? What kind of index id you create?

lvca commented 9 years ago

@tglman Did you already fix this in 2.0.8, right? @martingg88 reports that this worked in 2.0.7.

martingg88 commented 9 years ago

FYI. this work at 2.0.6. It won't create two duplicate records but never throw an exception when it try to insert. the behavior for 2.0.6 will throw the unique exception.