salsubaiee | 201be38 | 2013-07-16 17:50:33 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Test case Name : insert-and-scan-dataset-with-index.aql |
| 3 | * Description : This test is intended to test inserting into a dataset that has a secondary index and scan |
| 4 | * the data at the same time where we insert a materializing to prevent the possibility of deadlatch. |
| 5 | * Expected Result : Success |
| 6 | * Date : July 11 2013 |
| 7 | */ |
| 8 | |
| 9 | drop dataverse test if exists; |
| 10 | create dataverse test; |
| 11 | |
| 12 | create type test.Emp as closed { |
| 13 | id:int32, |
| 14 | fname:string, |
| 15 | lname:string, |
| 16 | age:int32, |
| 17 | dept:string |
| 18 | } |
| 19 | |
| 20 | create dataset test.employee(Emp) primary key id; |
| 21 | |
| 22 | create index idx_employee_first_name on test.employee(fname); |
| 23 | |
| 24 | insert into dataset test.employee ( |
| 25 | for $x in dataset test.employee |
| 26 | return { |
| 27 | "id": $x.id + 10000, |
| 28 | "fname": $x.fname, |
| 29 | "lname": $x.lname, |
| 30 | "age": $x.age, |
| 31 | "dept": $x.dept |
| 32 | } |
| 33 | ); |