Changeset 196025 in webkit


Ignore:
Timestamp:
Feb 2, 2016 12:51:46 PM (8 years ago)
Author:
beidson@apple.com
Message:

Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
https://bugs.webkit.org/show_bug.cgi?id=153791

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Existing test now unskipped).

There was a preexisting check in the SQLite cursor for remembering the current record and
refusing to refetch it.

This check was causing this bug, because we needed to refetch the current record.

Removing the check (and its associated flag) doesn't regress any other test, and fixes this one.

  • Modules/indexeddb/server/SQLiteIDBCursor.cpp:

(WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):

  • Modules/indexeddb/server/SQLiteIDBCursor.h:

LayoutTests:

In addition to unskipping the test, I augmented it to print out more of what was going on.

The additional printed info is what helped me track down the bug, and will make it more
likely to catch any future regressions.

  • platform/mac-wk1/TestExpectations:
  • storage/indexeddb/cursor-continue-validity-expected.txt:
  • storage/indexeddb/cursor-continue-validity-private-expected.txt:
  • storage/indexeddb/resources/cursor-continue-validity.js:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r196024 r196025  
     12016-02-02  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
     4        https://bugs.webkit.org/show_bug.cgi?id=153791
     5
     6        Reviewed by Alex Christensen.
     7
     8        In addition to unskipping the test, I augmented it to print out more of what was going on.
     9       
     10        The additional printed info is what helped me track down the bug, and will make it more
     11        likely to catch any future regressions.
     12       
     13        * platform/mac-wk1/TestExpectations:
     14        * storage/indexeddb/cursor-continue-validity-expected.txt:
     15        * storage/indexeddb/cursor-continue-validity-private-expected.txt:
     16        * storage/indexeddb/resources/cursor-continue-validity.js:
     17
    1182016-02-01  Dave Hyatt  <hyatt@apple.com>
    219
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r196021 r196025  
    257257imported/w3c/indexeddb/idbindex-multientry-big.htm [ Failure ]
    258258
    259 # Cursor iterates one less time than expected
    260 storage/indexeddb/cursor-continue-validity.html [ Failure ]
    261 
    262259# Integer part of the test iterates 0, 1, 2, Inf, -1, -2, -Inf - Should be in order from -Inf to Inf.
    263260storage/indexeddb/cursor-primary-key-order.html [ Failure ]
  • trunk/LayoutTests/storage/indexeddb/cursor-continue-validity-expected.txt

    r195181 r196025  
    784784self.continueValue = 0
    785785cursor = event.target.result
    786 cursor.continue()
    787 cursor = event.target.result
    788 cursor.update({ x: 100 + self.continueValue })
    789 cursor.continue()
    790 cursor = event.target.result
     786
     787Index key is: 0
     788Primary key is: 0
     789Value.x is: 0
     790Continue value: 1
     791cursor.continue()
     792cursor = event.target.result
     793
     794Index key is: 1
     795Primary key is: 1
     796Value.x is: 1
     797Continue value: 2
     798New Index key for primary key 1 is 102
     799cursor.update({ x: 100 + self.continueValue })
     800cursor.continue()
     801cursor = event.target.result
     802
     803Index key is: 2
     804Primary key is: 2
     805Value.x is: 2
     806Continue value: 3
     807Deleting primary key 2 which currently has Index key 2
    791808cursor.delete()
    792809cursor.continue()
    793810cursor = event.target.result
    794 cursor.update({ x: 100 + self.continueValue })
    795 cursor.continue()
    796 cursor = event.target.result
    797 cursor.continue()
     811
     812Index key is: 3
     813Primary key is: 3
     814Value.x is: 3
     815Continue value: 4
     816New Index key for primary key 3 is 104
     817cursor.update({ x: 100 + self.continueValue })
     818cursor.continue()
     819cursor = event.target.result
     820
     821Index key is: 4
     822Primary key is: 4
     823Value.x is: 4
     824Continue value: 5
     825cursor.continue()
     826Expecting exception setting new Index key for primary key 4 to 105
    798827Expecting exception from cursor.update({ x: 100 + self.continueValue})
    799828PASS Exception was thrown.
     
    801830Exception message: Failed to execute 'update' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
    802831cursor = event.target.result
    803 cursor.update({ x: 100 + self.continueValue })
    804 cursor.continue()
    805 cursor = event.target.result
    806 cursor.continue()
     832
     833Index key is: 5
     834Primary key is: 5
     835Value.x is: 5
     836Continue value: 6
     837New Index key for primary key 5 is 106
     838cursor.update({ x: 100 + self.continueValue })
     839cursor.continue()
     840cursor = event.target.result
     841
     842Index key is: 6
     843Primary key is: 6
     844Value.x is: 6
     845Continue value: 7
     846cursor.continue()
     847Expecting exception deleting primary key 6 which currently has Index key 6
    807848Expecting exception from cursor.delete()
    808849PASS Exception was thrown.
     
    810851Exception message: Failed to execute 'delete' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
    811852cursor = event.target.result
    812 cursor.update({ x: 100 + self.continueValue })
    813 cursor.continue()
    814 cursor = event.target.result
     853
     854Index key is: 7
     855Primary key is: 7
     856Value.x is: 7
     857Continue value: 8
     858New Index key for primary key 7 is 108
     859cursor.update({ x: 100 + self.continueValue })
     860cursor.continue()
     861cursor = event.target.result
     862
     863Index key is: 8
     864Primary key is: 8
     865Value.x is: 8
     866Continue value: 9
     867Deleting primary key 8 which currently has Index key 8
    815868cursor.delete()
    816869cursor.continue()
    817870cursor = event.target.result
    818 cursor.update({ x: 100 + self.continueValue })
    819 cursor.continue()
    820 cursor = event.target.result
    821 cursor.continue()
    822 cursor = event.target.result
    823 cursor.update({ x: 100 + self.continueValue })
    824 cursor.continue()
    825 cursor = event.target.result
    826 cursor.continue()
    827 cursor = event.target.result
    828 cursor.update({ x: 100 + self.continueValue })
    829 cursor.continue()
    830 cursor = event.target.result
     871
     872Index key is: 9
     873Primary key is: 9
     874Value.x is: 9
     875Continue value: 10
     876New Index key for primary key 9 is 110
     877cursor.update({ x: 100 + self.continueValue })
     878cursor.continue()
     879cursor = event.target.result
     880
     881Index key is: 10
     882Primary key is: 10
     883Value.x is: 10
     884Continue value: 11
     885cursor.continue()
     886cursor = event.target.result
     887
     888Index key is: 11
     889Primary key is: 11
     890Value.x is: 11
     891Continue value: 12
     892New Index key for primary key 11 is 112
     893cursor.update({ x: 100 + self.continueValue })
     894cursor.continue()
     895cursor = event.target.result
     896
     897Index key is: 12
     898Primary key is: 12
     899Value.x is: 12
     900Continue value: 13
     901cursor.continue()
     902cursor = event.target.result
     903
     904Index key is: 13
     905Primary key is: 13
     906Value.x is: 13
     907Continue value: 14
     908New Index key for primary key 13 is 114
     909cursor.update({ x: 100 + self.continueValue })
     910cursor.continue()
     911cursor = event.target.result
     912
     913Index key is: 14
     914Primary key is: 14
     915Value.x is: 14
     916Continue value: 15
     917Deleting primary key 14 which currently has Index key 14
    831918cursor.delete()
    832919cursor.continue()
    833920cursor = event.target.result
    834 cursor.update({ x: 100 + self.continueValue })
    835 cursor.continue()
    836 cursor = event.target.result
    837 cursor.continue()
    838 cursor = event.target.result
    839 cursor.update({ x: 100 + self.continueValue })
    840 cursor.continue()
    841 cursor = event.target.result
    842 cursor.continue()
    843 cursor = event.target.result
    844 cursor.update({ x: 100 + self.continueValue })
    845 cursor.continue()
    846 cursor = event.target.result
     921
     922Index key is: 15
     923Primary key is: 15
     924Value.x is: 15
     925Continue value: 16
     926New Index key for primary key 15 is 116
     927cursor.update({ x: 100 + self.continueValue })
     928cursor.continue()
     929cursor = event.target.result
     930
     931Index key is: 16
     932Primary key is: 16
     933Value.x is: 16
     934Continue value: 17
     935cursor.continue()
     936cursor = event.target.result
     937
     938Index key is: 17
     939Primary key is: 17
     940Value.x is: 17
     941Continue value: 18
     942New Index key for primary key 17 is 118
     943cursor.update({ x: 100 + self.continueValue })
     944cursor.continue()
     945cursor = event.target.result
     946
     947Index key is: 18
     948Primary key is: 18
     949Value.x is: 18
     950Continue value: 19
     951cursor.continue()
     952cursor = event.target.result
     953
     954Index key is: 19
     955Primary key is: 19
     956Value.x is: 19
     957Continue value: 20
     958New Index key for primary key 19 is 120
     959cursor.update({ x: 100 + self.continueValue })
     960cursor.continue()
     961cursor = event.target.result
     962
     963Index key is: 20
     964Primary key is: 20
     965Value.x is: 20
     966Continue value: 21
     967Deleting primary key 20 which currently has Index key 20
    847968cursor.delete()
    848969cursor.continue()
    849970cursor = event.target.result
    850 cursor.update({ x: 100 + self.continueValue })
    851 cursor.continue()
    852 cursor = event.target.result
    853 cursor.continue()
    854 cursor = event.target.result
    855 cursor.update({ x: 100 + self.continueValue })
    856 cursor.continue()
    857 cursor = event.target.result
    858 cursor.continue()
     971
     972Index key is: 21
     973Primary key is: 21
     974Value.x is: 21
     975Continue value: 22
     976New Index key for primary key 21 is 122
     977cursor.update({ x: 100 + self.continueValue })
     978cursor.continue()
     979cursor = event.target.result
     980
     981Index key is: 22
     982Primary key is: 22
     983Value.x is: 22
     984Continue value: 23
     985cursor.continue()
     986cursor = event.target.result
     987
     988Index key is: 23
     989Primary key is: 23
     990Value.x is: 23
     991Continue value: 24
     992New Index key for primary key 23 is 124
     993cursor.update({ x: 100 + self.continueValue })
     994cursor.continue()
     995cursor = event.target.result
     996
     997Index key is: 24
     998Primary key is: 24
     999Value.x is: 24
     1000Continue value: 25
     1001cursor.continue()
     1002Expecting exception setting new Index key for primary key 24 to 125
    8591003Expecting exception from cursor.update({ x: 100 + self.continueValue})
    8601004PASS Exception was thrown.
     
    8621006Exception message: Failed to execute 'update' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
    8631007cursor = event.target.result
    864 cursor.update({ x: 100 + self.continueValue })
    865 cursor.continue()
    866 cursor = event.target.result
     1008
     1009Index key is: 102
     1010Primary key is: 1
     1011Value.x is: 102
     1012Continue value: 26
     1013New Index key for primary key 1 is 126
     1014cursor.update({ x: 100 + self.continueValue })
     1015cursor.continue()
     1016cursor = event.target.result
     1017
     1018Index key is: 104
     1019Primary key is: 3
     1020Value.x is: 104
     1021Continue value: 27
     1022Deleting primary key 3 which currently has Index key 104
    8671023cursor.delete()
    8681024cursor.continue()
    8691025cursor = event.target.result
    870 cursor.update({ x: 100 + self.continueValue })
    871 cursor.continue()
    872 cursor = event.target.result
    873 cursor.continue()
    874 cursor = event.target.result
    875 cursor.update({ x: 100 + self.continueValue })
    876 cursor.continue()
    877 cursor = event.target.result
    878 cursor.continue()
    879 cursor = event.target.result
    880 cursor.update({ x: 100 + self.continueValue })
    881 cursor.continue()
    882 cursor = event.target.result
     1026
     1027Index key is: 106
     1028Primary key is: 5
     1029Value.x is: 106
     1030Continue value: 28
     1031New Index key for primary key 5 is 128
     1032cursor.update({ x: 100 + self.continueValue })
     1033cursor.continue()
     1034cursor = event.target.result
     1035
     1036Index key is: 108
     1037Primary key is: 7
     1038Value.x is: 108
     1039Continue value: 29
     1040cursor.continue()
     1041cursor = event.target.result
     1042
     1043Index key is: 110
     1044Primary key is: 9
     1045Value.x is: 110
     1046Continue value: 30
     1047New Index key for primary key 9 is 130
     1048cursor.update({ x: 100 + self.continueValue })
     1049cursor.continue()
     1050cursor = event.target.result
     1051
     1052Index key is: 112
     1053Primary key is: 11
     1054Value.x is: 112
     1055Continue value: 31
     1056cursor.continue()
     1057cursor = event.target.result
     1058
     1059Index key is: 114
     1060Primary key is: 13
     1061Value.x is: 114
     1062Continue value: 32
     1063New Index key for primary key 13 is 132
     1064cursor.update({ x: 100 + self.continueValue })
     1065cursor.continue()
     1066cursor = event.target.result
     1067
     1068Index key is: 116
     1069Primary key is: 15
     1070Value.x is: 116
     1071Continue value: 33
     1072Deleting primary key 15 which currently has Index key 116
    8831073cursor.delete()
    8841074cursor.continue()
    8851075cursor = event.target.result
    886 cursor.update({ x: 100 + self.continueValue })
    887 cursor.continue()
    888 cursor = event.target.result
    889 cursor.continue()
     1076
     1077Index key is: 118
     1078Primary key is: 17
     1079Value.x is: 118
     1080Continue value: 34
     1081New Index key for primary key 17 is 134
     1082cursor.update({ x: 100 + self.continueValue })
     1083cursor.continue()
     1084cursor = event.target.result
     1085
     1086Index key is: 120
     1087Primary key is: 19
     1088Value.x is: 120
     1089Continue value: 35
     1090cursor.continue()
     1091Expecting exception setting new Index key for primary key 19 to 135
    8901092Expecting exception from cursor.update({ x: 100 + self.continueValue})
    8911093PASS Exception was thrown.
     
    8931095Exception message: Failed to execute 'update' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
    8941096cursor = event.target.result
    895 cursor.update({ x: 100 + self.continueValue })
    896 cursor.continue()
    897 cursor = event.target.result
    898 cursor.continue()
    899 cursor = event.target.result
    900 cursor.update({ x: 100 + self.continueValue })
    901 cursor.continue()
    902 cursor = event.target.result
     1097
     1098Index key is: 122
     1099Primary key is: 21
     1100Value.x is: 122
     1101Continue value: 36
     1102New Index key for primary key 21 is 136
     1103cursor.update({ x: 100 + self.continueValue })
     1104cursor.continue()
     1105cursor = event.target.result
     1106
     1107Index key is: 124
     1108Primary key is: 23
     1109Value.x is: 124
     1110Continue value: 37
     1111cursor.continue()
     1112cursor = event.target.result
     1113
     1114Index key is: 126
     1115Primary key is: 1
     1116Value.x is: 126
     1117Continue value: 38
     1118New Index key for primary key 1 is 138
     1119cursor.update({ x: 100 + self.continueValue })
     1120cursor.continue()
     1121cursor = event.target.result
     1122
     1123Index key is: 128
     1124Primary key is: 5
     1125Value.x is: 128
     1126Continue value: 39
     1127Deleting primary key 5 which currently has Index key 128
    9031128cursor.delete()
    9041129cursor.continue()
    9051130cursor = event.target.result
    906 cursor.update({ x: 100 + self.continueValue })
    907 cursor.continue()
    908 cursor = event.target.result
    909 cursor.continue()
    910 cursor = event.target.result
    911 cursor.update({ x: 100 + self.continueValue })
    912 cursor.continue()
    913 cursor = event.target.result
    914 cursor.continue()
    915 cursor = event.target.result
    916 cursor.update({ x: 100 + self.continueValue })
    917 cursor.continue()
    918 cursor = event.target.result
     1131
     1132Index key is: 130
     1133Primary key is: 9
     1134Value.x is: 130
     1135Continue value: 40
     1136New Index key for primary key 9 is 140
     1137cursor.update({ x: 100 + self.continueValue })
     1138cursor.continue()
     1139cursor = event.target.result
     1140
     1141Index key is: 132
     1142Primary key is: 13
     1143Value.x is: 132
     1144Continue value: 41
     1145cursor.continue()
     1146cursor = event.target.result
     1147
     1148Index key is: 134
     1149Primary key is: 17
     1150Value.x is: 134
     1151Continue value: 42
     1152New Index key for primary key 17 is 142
     1153cursor.update({ x: 100 + self.continueValue })
     1154cursor.continue()
     1155cursor = event.target.result
     1156
     1157Index key is: 136
     1158Primary key is: 21
     1159Value.x is: 136
     1160Continue value: 43
     1161cursor.continue()
     1162cursor = event.target.result
     1163
     1164Index key is: 138
     1165Primary key is: 1
     1166Value.x is: 138
     1167Continue value: 44
     1168New Index key for primary key 1 is 144
     1169cursor.update({ x: 100 + self.continueValue })
     1170cursor.continue()
     1171cursor = event.target.result
     1172
     1173Index key is: 140
     1174Primary key is: 9
     1175Value.x is: 140
     1176Continue value: 45
     1177Deleting primary key 9 which currently has Index key 140
    9191178cursor.delete()
    9201179cursor.continue()
    9211180cursor = event.target.result
    922 cursor.update({ x: 100 + self.continueValue })
    923 cursor.continue()
    924 cursor = event.target.result
    925 cursor.continue()
    926 cursor = event.target.result
    927 cursor.update({ x: 100 + self.continueValue })
    928 cursor.continue()
    929 cursor = event.target.result
    930 cursor.continue()
     1181
     1182Index key is: 142
     1183Primary key is: 17
     1184Value.x is: 142
     1185Continue value: 46
     1186New Index key for primary key 17 is 146
     1187cursor.update({ x: 100 + self.continueValue })
     1188cursor.continue()
     1189cursor = event.target.result
     1190
     1191Index key is: 144
     1192Primary key is: 1
     1193Value.x is: 144
     1194Continue value: 47
     1195cursor.continue()
     1196cursor = event.target.result
     1197
     1198Index key is: 146
     1199Primary key is: 17
     1200Value.x is: 146
     1201Continue value: 48
     1202New Index key for primary key 17 is 148
     1203cursor.update({ x: 100 + self.continueValue })
     1204cursor.continue()
     1205cursor = event.target.result
     1206
     1207Index key is: 148
     1208Primary key is: 17
     1209Value.x is: 148
     1210Continue value: 49
     1211cursor.continue()
     1212Expecting exception deleting primary key 17 which currently has Index key 148
    9311213Expecting exception from cursor.delete()
    9321214PASS Exception was thrown.
  • trunk/LayoutTests/storage/indexeddb/cursor-continue-validity-private-expected.txt

    r195247 r196025  
    784784self.continueValue = 0
    785785cursor = event.target.result
    786 cursor.continue()
    787 cursor = event.target.result
    788 cursor.update({ x: 100 + self.continueValue })
    789 cursor.continue()
    790 cursor = event.target.result
     786
     787Index key is: 0
     788Primary key is: 0
     789Value.x is: 0
     790Continue value: 1
     791cursor.continue()
     792cursor = event.target.result
     793
     794Index key is: 1
     795Primary key is: 1
     796Value.x is: 1
     797Continue value: 2
     798New Index key for primary key 1 is 102
     799cursor.update({ x: 100 + self.continueValue })
     800cursor.continue()
     801cursor = event.target.result
     802
     803Index key is: 2
     804Primary key is: 2
     805Value.x is: 2
     806Continue value: 3
     807Deleting primary key 2 which currently has Index key 2
    791808cursor.delete()
    792809cursor.continue()
    793810cursor = event.target.result
    794 cursor.update({ x: 100 + self.continueValue })
    795 cursor.continue()
    796 cursor = event.target.result
    797 cursor.continue()
     811
     812Index key is: 3
     813Primary key is: 3
     814Value.x is: 3
     815Continue value: 4
     816New Index key for primary key 3 is 104
     817cursor.update({ x: 100 + self.continueValue })
     818cursor.continue()
     819cursor = event.target.result
     820
     821Index key is: 4
     822Primary key is: 4
     823Value.x is: 4
     824Continue value: 5
     825cursor.continue()
     826Expecting exception setting new Index key for primary key 4 to 105
    798827Expecting exception from cursor.update({ x: 100 + self.continueValue})
    799828PASS Exception was thrown.
     
    801830Exception message: Failed to execute 'update' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
    802831cursor = event.target.result
    803 cursor.update({ x: 100 + self.continueValue })
    804 cursor.continue()
    805 cursor = event.target.result
    806 cursor.continue()
     832
     833Index key is: 5
     834Primary key is: 5
     835Value.x is: 5
     836Continue value: 6
     837New Index key for primary key 5 is 106
     838cursor.update({ x: 100 + self.continueValue })
     839cursor.continue()
     840cursor = event.target.result
     841
     842Index key is: 6
     843Primary key is: 6
     844Value.x is: 6
     845Continue value: 7
     846cursor.continue()
     847Expecting exception deleting primary key 6 which currently has Index key 6
    807848Expecting exception from cursor.delete()
    808849PASS Exception was thrown.
     
    810851Exception message: Failed to execute 'delete' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
    811852cursor = event.target.result
    812 cursor.update({ x: 100 + self.continueValue })
    813 cursor.continue()
    814 cursor = event.target.result
     853
     854Index key is: 7
     855Primary key is: 7
     856Value.x is: 7
     857Continue value: 8
     858New Index key for primary key 7 is 108
     859cursor.update({ x: 100 + self.continueValue })
     860cursor.continue()
     861cursor = event.target.result
     862
     863Index key is: 8
     864Primary key is: 8
     865Value.x is: 8
     866Continue value: 9
     867Deleting primary key 8 which currently has Index key 8
    815868cursor.delete()
    816869cursor.continue()
    817870cursor = event.target.result
    818 cursor.update({ x: 100 + self.continueValue })
    819 cursor.continue()
    820 cursor = event.target.result
    821 cursor.continue()
    822 cursor = event.target.result
    823 cursor.update({ x: 100 + self.continueValue })
    824 cursor.continue()
    825 cursor = event.target.result
    826 cursor.continue()
    827 cursor = event.target.result
    828 cursor.update({ x: 100 + self.continueValue })
    829 cursor.continue()
    830 cursor = event.target.result
     871
     872Index key is: 9
     873Primary key is: 9
     874Value.x is: 9
     875Continue value: 10
     876New Index key for primary key 9 is 110
     877cursor.update({ x: 100 + self.continueValue })
     878cursor.continue()
     879cursor = event.target.result
     880
     881Index key is: 10
     882Primary key is: 10
     883Value.x is: 10
     884Continue value: 11
     885cursor.continue()
     886cursor = event.target.result
     887
     888Index key is: 11
     889Primary key is: 11
     890Value.x is: 11
     891Continue value: 12
     892New Index key for primary key 11 is 112
     893cursor.update({ x: 100 + self.continueValue })
     894cursor.continue()
     895cursor = event.target.result
     896
     897Index key is: 12
     898Primary key is: 12
     899Value.x is: 12
     900Continue value: 13
     901cursor.continue()
     902cursor = event.target.result
     903
     904Index key is: 13
     905Primary key is: 13
     906Value.x is: 13
     907Continue value: 14
     908New Index key for primary key 13 is 114
     909cursor.update({ x: 100 + self.continueValue })
     910cursor.continue()
     911cursor = event.target.result
     912
     913Index key is: 14
     914Primary key is: 14
     915Value.x is: 14
     916Continue value: 15
     917Deleting primary key 14 which currently has Index key 14
    831918cursor.delete()
    832919cursor.continue()
    833920cursor = event.target.result
    834 cursor.update({ x: 100 + self.continueValue })
    835 cursor.continue()
    836 cursor = event.target.result
    837 cursor.continue()
    838 cursor = event.target.result
    839 cursor.update({ x: 100 + self.continueValue })
    840 cursor.continue()
    841 cursor = event.target.result
    842 cursor.continue()
    843 cursor = event.target.result
    844 cursor.update({ x: 100 + self.continueValue })
    845 cursor.continue()
    846 cursor = event.target.result
     921
     922Index key is: 15
     923Primary key is: 15
     924Value.x is: 15
     925Continue value: 16
     926New Index key for primary key 15 is 116
     927cursor.update({ x: 100 + self.continueValue })
     928cursor.continue()
     929cursor = event.target.result
     930
     931Index key is: 16
     932Primary key is: 16
     933Value.x is: 16
     934Continue value: 17
     935cursor.continue()
     936cursor = event.target.result
     937
     938Index key is: 17
     939Primary key is: 17
     940Value.x is: 17
     941Continue value: 18
     942New Index key for primary key 17 is 118
     943cursor.update({ x: 100 + self.continueValue })
     944cursor.continue()
     945cursor = event.target.result
     946
     947Index key is: 18
     948Primary key is: 18
     949Value.x is: 18
     950Continue value: 19
     951cursor.continue()
     952cursor = event.target.result
     953
     954Index key is: 19
     955Primary key is: 19
     956Value.x is: 19
     957Continue value: 20
     958New Index key for primary key 19 is 120
     959cursor.update({ x: 100 + self.continueValue })
     960cursor.continue()
     961cursor = event.target.result
     962
     963Index key is: 20
     964Primary key is: 20
     965Value.x is: 20
     966Continue value: 21
     967Deleting primary key 20 which currently has Index key 20
    847968cursor.delete()
    848969cursor.continue()
    849970cursor = event.target.result
    850 cursor.update({ x: 100 + self.continueValue })
    851 cursor.continue()
    852 cursor = event.target.result
    853 cursor.continue()
    854 cursor = event.target.result
    855 cursor.update({ x: 100 + self.continueValue })
    856 cursor.continue()
    857 cursor = event.target.result
    858 cursor.continue()
     971
     972Index key is: 21
     973Primary key is: 21
     974Value.x is: 21
     975Continue value: 22
     976New Index key for primary key 21 is 122
     977cursor.update({ x: 100 + self.continueValue })
     978cursor.continue()
     979cursor = event.target.result
     980
     981Index key is: 22
     982Primary key is: 22
     983Value.x is: 22
     984Continue value: 23
     985cursor.continue()
     986cursor = event.target.result
     987
     988Index key is: 23
     989Primary key is: 23
     990Value.x is: 23
     991Continue value: 24
     992New Index key for primary key 23 is 124
     993cursor.update({ x: 100 + self.continueValue })
     994cursor.continue()
     995cursor = event.target.result
     996
     997Index key is: 24
     998Primary key is: 24
     999Value.x is: 24
     1000Continue value: 25
     1001cursor.continue()
     1002Expecting exception setting new Index key for primary key 24 to 125
    8591003Expecting exception from cursor.update({ x: 100 + self.continueValue})
    8601004PASS Exception was thrown.
     
    8621006Exception message: Failed to execute 'update' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
    8631007cursor = event.target.result
    864 cursor.update({ x: 100 + self.continueValue })
    865 cursor.continue()
    866 cursor = event.target.result
     1008
     1009Index key is: 102
     1010Primary key is: 1
     1011Value.x is: 102
     1012Continue value: 26
     1013New Index key for primary key 1 is 126
     1014cursor.update({ x: 100 + self.continueValue })
     1015cursor.continue()
     1016cursor = event.target.result
     1017
     1018Index key is: 104
     1019Primary key is: 3
     1020Value.x is: 104
     1021Continue value: 27
     1022Deleting primary key 3 which currently has Index key 104
    8671023cursor.delete()
    8681024cursor.continue()
    8691025cursor = event.target.result
    870 cursor.update({ x: 100 + self.continueValue })
    871 cursor.continue()
    872 cursor = event.target.result
    873 cursor.continue()
    874 cursor = event.target.result
    875 cursor.update({ x: 100 + self.continueValue })
    876 cursor.continue()
    877 cursor = event.target.result
    878 cursor.continue()
    879 cursor = event.target.result
    880 cursor.update({ x: 100 + self.continueValue })
    881 cursor.continue()
    882 cursor = event.target.result
     1026
     1027Index key is: 106
     1028Primary key is: 5
     1029Value.x is: 106
     1030Continue value: 28
     1031New Index key for primary key 5 is 128
     1032cursor.update({ x: 100 + self.continueValue })
     1033cursor.continue()
     1034cursor = event.target.result
     1035
     1036Index key is: 108
     1037Primary key is: 7
     1038Value.x is: 108
     1039Continue value: 29
     1040cursor.continue()
     1041cursor = event.target.result
     1042
     1043Index key is: 110
     1044Primary key is: 9
     1045Value.x is: 110
     1046Continue value: 30
     1047New Index key for primary key 9 is 130
     1048cursor.update({ x: 100 + self.continueValue })
     1049cursor.continue()
     1050cursor = event.target.result
     1051
     1052Index key is: 112
     1053Primary key is: 11
     1054Value.x is: 112
     1055Continue value: 31
     1056cursor.continue()
     1057cursor = event.target.result
     1058
     1059Index key is: 114
     1060Primary key is: 13
     1061Value.x is: 114
     1062Continue value: 32
     1063New Index key for primary key 13 is 132
     1064cursor.update({ x: 100 + self.continueValue })
     1065cursor.continue()
     1066cursor = event.target.result
     1067
     1068Index key is: 116
     1069Primary key is: 15
     1070Value.x is: 116
     1071Continue value: 33
     1072Deleting primary key 15 which currently has Index key 116
    8831073cursor.delete()
    8841074cursor.continue()
    8851075cursor = event.target.result
    886 cursor.update({ x: 100 + self.continueValue })
    887 cursor.continue()
    888 cursor = event.target.result
    889 cursor.continue()
     1076
     1077Index key is: 118
     1078Primary key is: 17
     1079Value.x is: 118
     1080Continue value: 34
     1081New Index key for primary key 17 is 134
     1082cursor.update({ x: 100 + self.continueValue })
     1083cursor.continue()
     1084cursor = event.target.result
     1085
     1086Index key is: 120
     1087Primary key is: 19
     1088Value.x is: 120
     1089Continue value: 35
     1090cursor.continue()
     1091Expecting exception setting new Index key for primary key 19 to 135
    8901092Expecting exception from cursor.update({ x: 100 + self.continueValue})
    8911093PASS Exception was thrown.
     
    8931095Exception message: Failed to execute 'update' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
    8941096cursor = event.target.result
    895 cursor.update({ x: 100 + self.continueValue })
    896 cursor.continue()
    897 cursor = event.target.result
    898 cursor.continue()
    899 cursor = event.target.result
    900 cursor.update({ x: 100 + self.continueValue })
    901 cursor.continue()
    902 cursor = event.target.result
     1097
     1098Index key is: 122
     1099Primary key is: 21
     1100Value.x is: 122
     1101Continue value: 36
     1102New Index key for primary key 21 is 136
     1103cursor.update({ x: 100 + self.continueValue })
     1104cursor.continue()
     1105cursor = event.target.result
     1106
     1107Index key is: 124
     1108Primary key is: 23
     1109Value.x is: 124
     1110Continue value: 37
     1111cursor.continue()
     1112cursor = event.target.result
     1113
     1114Index key is: 126
     1115Primary key is: 1
     1116Value.x is: 126
     1117Continue value: 38
     1118New Index key for primary key 1 is 138
     1119cursor.update({ x: 100 + self.continueValue })
     1120cursor.continue()
     1121cursor = event.target.result
     1122
     1123Index key is: 128
     1124Primary key is: 5
     1125Value.x is: 128
     1126Continue value: 39
     1127Deleting primary key 5 which currently has Index key 128
    9031128cursor.delete()
    9041129cursor.continue()
    9051130cursor = event.target.result
    906 cursor.update({ x: 100 + self.continueValue })
    907 cursor.continue()
    908 cursor = event.target.result
    909 cursor.continue()
    910 cursor = event.target.result
    911 cursor.update({ x: 100 + self.continueValue })
    912 cursor.continue()
    913 cursor = event.target.result
    914 cursor.continue()
    915 cursor = event.target.result
    916 cursor.update({ x: 100 + self.continueValue })
    917 cursor.continue()
    918 cursor = event.target.result
     1131
     1132Index key is: 130
     1133Primary key is: 9
     1134Value.x is: 130
     1135Continue value: 40
     1136New Index key for primary key 9 is 140
     1137cursor.update({ x: 100 + self.continueValue })
     1138cursor.continue()
     1139cursor = event.target.result
     1140
     1141Index key is: 132
     1142Primary key is: 13
     1143Value.x is: 132
     1144Continue value: 41
     1145cursor.continue()
     1146cursor = event.target.result
     1147
     1148Index key is: 134
     1149Primary key is: 17
     1150Value.x is: 134
     1151Continue value: 42
     1152New Index key for primary key 17 is 142
     1153cursor.update({ x: 100 + self.continueValue })
     1154cursor.continue()
     1155cursor = event.target.result
     1156
     1157Index key is: 136
     1158Primary key is: 21
     1159Value.x is: 136
     1160Continue value: 43
     1161cursor.continue()
     1162cursor = event.target.result
     1163
     1164Index key is: 138
     1165Primary key is: 1
     1166Value.x is: 138
     1167Continue value: 44
     1168New Index key for primary key 1 is 144
     1169cursor.update({ x: 100 + self.continueValue })
     1170cursor.continue()
     1171cursor = event.target.result
     1172
     1173Index key is: 140
     1174Primary key is: 9
     1175Value.x is: 140
     1176Continue value: 45
     1177Deleting primary key 9 which currently has Index key 140
    9191178cursor.delete()
    9201179cursor.continue()
    9211180cursor = event.target.result
    922 cursor.update({ x: 100 + self.continueValue })
    923 cursor.continue()
    924 cursor = event.target.result
    925 cursor.continue()
    926 cursor = event.target.result
    927 cursor.update({ x: 100 + self.continueValue })
    928 cursor.continue()
    929 cursor = event.target.result
    930 cursor.continue()
     1181
     1182Index key is: 142
     1183Primary key is: 17
     1184Value.x is: 142
     1185Continue value: 46
     1186New Index key for primary key 17 is 146
     1187cursor.update({ x: 100 + self.continueValue })
     1188cursor.continue()
     1189cursor = event.target.result
     1190
     1191Index key is: 144
     1192Primary key is: 1
     1193Value.x is: 144
     1194Continue value: 47
     1195cursor.continue()
     1196cursor = event.target.result
     1197
     1198Index key is: 146
     1199Primary key is: 17
     1200Value.x is: 146
     1201Continue value: 48
     1202New Index key for primary key 17 is 148
     1203cursor.update({ x: 100 + self.continueValue })
     1204cursor.continue()
     1205cursor = event.target.result
     1206
     1207Index key is: 148
     1208Primary key is: 17
     1209Value.x is: 148
     1210Continue value: 49
     1211cursor.continue()
     1212Expecting exception deleting primary key 17 which currently has Index key 148
    9311213Expecting exception from cursor.delete()
    9321214PASS Exception was thrown.
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-continue-validity.js

    r163963 r196025  
    126126    self.continueValue++;
    127127    if (cursor) {
     128        debug("");
     129        debug("Index key is: " + cursor.key);
     130        debug("Primary key is: " + cursor.primaryKey);
     131        debug("Value.x is: " + cursor.value.x);
     132        debug("Continue value: " + self.continueValue);
     133
    128134        // we sprinkle these checks across the dataset, to sample
    129135        // behavior against pre-fetching. Make sure to use prime
     
    131137        if (self.continueValue % 2 == 0) {
    132138            // it's ok to call update() and then continue..
     139            debug("New Index key for primary key " + cursor.primaryKey + " is " + (100 + self.continueValue));
    133140            evalAndLog("cursor.update({ x: 100 + self.continueValue })");
    134141            evalAndLog("cursor.continue()");
    135142        } else if (self.continueValue % 3 == 0) {
    136143            // it's ok to call delete() and then continue
     144            debug("Deleting primary key " + cursor.primaryKey + " which currently has Index key " + cursor.key);
    137145            evalAndLog("cursor.delete()");
    138146            evalAndLog("cursor.continue()");
     
    140148            // it's NOT ok to call continue and then update
    141149            evalAndLog("cursor.continue()");
     150            debug("Expecting exception setting new Index key for primary key " + cursor.primaryKey + " to " + (100 + self.continueValue));
    142151            evalAndExpectException("cursor.update({ x: 100 + self.continueValue})",
    143152                                   "DOMException.INVALID_STATE_ERR");
     
    145154            // it's NOT ok to call continue and then delete
    146155            evalAndLog("cursor.continue()");
     156            debug("Expecting exception deleting primary key " + cursor.primaryKey + " which currently has Index key " + cursor.key);
    147157            evalAndExpectException("cursor.delete()",
    148158                                   "DOMException.INVALID_STATE_ERR");
  • trunk/Source/WebCore/ChangeLog

    r196024 r196025  
     12016-02-02  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
     4        https://bugs.webkit.org/show_bug.cgi?id=153791
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests (Existing test now unskipped).
     9
     10        There was a preexisting check in the SQLite cursor for remembering the current record and
     11        refusing to refetch it.
     12       
     13        This check was causing this bug, because we needed to refetch the current record.
     14       
     15        Removing the check (and its associated flag) doesn't regress any other test, and fixes this one.
     16
     17        * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
     18        (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
     19        (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
     20        * Modules/indexeddb/server/SQLiteIDBCursor.h:
     21
    1222016-02-01  Dave Hyatt  <hyatt@apple.com>
    223
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp

    r195787 r196025  
    231231            m_keyRange.lowerKey = m_currentLowerKey;
    232232            m_statement = nullptr;
    233             m_currentRecordID = -1;
    234233        }
    235234    } else {
     
    239238            m_keyRange.upperKey = m_currentUpperKey;
    240239            m_statement = nullptr;
    241             m_currentRecordID = -1;
    242240        }
    243241    }
     
    358356        return AdvanceResult::Failure;
    359357    }
    360 
    361     int64_t recordID = m_statement->getColumnInt64(0);
    362 
    363     // If the recordID of the record just fetched is the same as the current record ID
    364     // then this statement must have been re-prepared in response to an object store change.
    365     // We don't want to re-use the current record so we'll move on to the next one.
    366     if (recordID == m_currentRecordID)
    367         return AdvanceResult::ShouldAdvanceAgain;
    368 
    369     m_currentRecordID = recordID;
    370358
    371359    Vector<uint8_t> keyData;
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h

    r195784 r196025  
    101101    IDBKeyData m_currentUpperKey;
    102102
    103     int64_t m_currentRecordID { -1 };
    104103    IDBKeyData m_currentKey;
    105104    IDBKeyData m_currentPrimaryKey;
Note: See TracChangeset for help on using the changeset viewer.