File tree 7 files changed +2936
-2706
lines changed
7 files changed +2936
-2706
lines changed Original file line number Diff line number Diff line change @@ -1169,6 +1169,16 @@ func (lock Lock) ToString() string {
1169
1169
return NoLockStr
1170
1170
case ForUpdateLock :
1171
1171
return ForUpdateStr
1172
+ case ForUpdateLockNoWait :
1173
+ return ForUpdateNoWaitStr
1174
+ case ForUpdateLockSkipLocked :
1175
+ return ForUpdateSkipLockedStr
1176
+ case ForShareLock :
1177
+ return ForShareStr
1178
+ case ForShareLockNoWait :
1179
+ return ForShareNoWaitStr
1180
+ case ForShareLockSkipLocked :
1181
+ return ForShareSkipLockedStr
1172
1182
case ShareModeLock :
1173
1183
return ShareModeStr
1174
1184
default :
Original file line number Diff line number Diff line change @@ -25,9 +25,14 @@ const (
25
25
SQLCalcFoundRowsStr = "sql_calc_found_rows "
26
26
27
27
// Select.Lock
28
- NoLockStr = ""
29
- ForUpdateStr = " for update"
30
- ShareModeStr = " lock in share mode"
28
+ NoLockStr = ""
29
+ ForUpdateStr = " for update"
30
+ ForUpdateNoWaitStr = " for update nowait"
31
+ ForUpdateSkipLockedStr = " for update skip locked"
32
+ ForShareStr = " for share"
33
+ ForShareNoWaitStr = " for share nowait"
34
+ ForShareSkipLockedStr = " for share skip locked"
35
+ ShareModeStr = " lock in share mode"
31
36
32
37
// Select.Cache
33
38
SQLCacheStr = "sql_cache "
@@ -468,6 +473,11 @@ const (
468
473
NoLock Lock = iota
469
474
ForUpdateLock
470
475
ShareModeLock
476
+ ForShareLock
477
+ ForShareLockNoWait
478
+ ForShareLockSkipLocked
479
+ ForUpdateLockNoWait
480
+ ForUpdateLockSkipLocked
471
481
)
472
482
473
483
// Constants for Enum Type - TrimType
Original file line number Diff line number Diff line change @@ -403,6 +403,7 @@ var keywords = []keyword{
403
403
{"localtimestamp" , LOCALTIMESTAMP },
404
404
{"locate" , LOCATE },
405
405
{"lock" , LOCK },
406
+ {"locked" , LOCKED },
406
407
{"logs" , LOGS },
407
408
{"long" , UNUSED },
408
409
{"longblob" , LONGBLOB },
@@ -447,6 +448,7 @@ var keywords = []keyword{
447
448
{"none" , NONE },
448
449
{"not" , NOT },
449
450
{"now" , NOW },
451
+ {"nowait" , NOWAIT },
450
452
{"no_write_to_binlog" , NO_WRITE_TO_BINLOG },
451
453
{"nth_value" , NTH_VALUE },
452
454
{"ntile" , NTILE },
@@ -560,6 +562,7 @@ var keywords = []keyword{
560
562
{"signal" , UNUSED },
561
563
{"signed" , SIGNED },
562
564
{"simple" , SIMPLE },
565
+ {"skip" , SKIP },
563
566
{"slow" , SLOW },
564
567
{"smallint" , SMALLINT },
565
568
{"spatial" , SPATIAL },
Original file line number Diff line number Diff line change @@ -371,8 +371,18 @@ var (
371
371
input : "select /* distinct */ distinct 1 from t" ,
372
372
}, {
373
373
input : "select /* straight_join */ straight_join 1 from t" ,
374
+ }, {
375
+ input : "select /* for share */ 1 from t for share" ,
376
+ }, {
377
+ input : "select /* for share */ 1 from t for share nowait" ,
378
+ }, {
379
+ input : "select /* for share */ 1 from t for share skip locked" ,
374
380
}, {
375
381
input : "select /* for update */ 1 from t for update" ,
382
+ }, {
383
+ input : "select /* for update */ 1 from t for update nowait" ,
384
+ }, {
385
+ input : "select /* for update */ 1 from t for update skip locked" ,
376
386
}, {
377
387
input : "select /* lock in share mode */ 1 from t lock in share mode" ,
378
388
}, {
You can’t perform that action at this time.
0 commit comments