Artifact
302b34f77faf7ee5a95c45e5ad960f0d11247240595563f1dd05a0f63a01d710:
Ticket change
[302b34f77f]
- New ticket
[7f39060a24b47353|7f39060a24] <i>LEFT JOIN malfunctions with partial ISNULL index</i>.
by
mrigger
2019-11-30 17:51:24.
0000: 44 20 32 30 31 39 2d 31 31 2d 33 30 54 31 37 3a D 2019-11-30T17:
0010: 35 31 3a 32 34 2e 39 35 33 0a 4a 20 66 6f 75 6e 51:24.953.J foun
0020: 64 69 6e 20 33 2e 33 30 2e 30 0a 4a 20 69 63 6f din 3.30.0.J ico
0030: 6d 6d 65 6e 74 20 43 6f 6e 73 69 64 65 72 5c 73 mment Consider\s
0040: 74 68 65 5c 73 66 6f 6c 6c 6f 77 69 6e 67 5c 73 the\sfollowing\s
0050: 74 65 73 74 5c 73 63 61 73 65 3a 5c 72 5c 6e 5c test\scase:\r\n\
0060: 72 5c 6e 3c 70 72 65 3e 5c 72 5c 6e 43 52 45 41 r\n<pre>\r\nCREA
0070: 54 45 5c 73 54 41 42 4c 45 5c 73 74 30 28 63 30 TE\sTABLE\st0(c0
0080: 29 3b 5c 72 5c 6e 43 52 45 41 54 45 5c 73 54 41 );\r\nCREATE\sTA
0090: 42 4c 45 5c 73 74 31 28 63 30 29 3b 5c 72 5c 6e BLE\st1(c0);\r\n
00a0: 43 52 45 41 54 45 5c 73 49 4e 44 45 58 5c 73 69 CREATE\sINDEX\si
00b0: 30 5c 73 4f 4e 5c 73 74 30 28 31 29 5c 73 57 48 0\sON\st0(1)\sWH
00c0: 45 52 45 5c 73 63 30 5c 73 49 53 4e 55 4c 4c 3b ERE\sc0\sISNULL;
00d0: 5c 72 5c 6e 49 4e 53 45 52 54 5c 73 49 4e 54 4f \r\nINSERT\sINTO
00e0: 5c 73 74 30 28 63 30 29 5c 73 56 41 4c 55 45 53 \st0(c0)\sVALUES
00f0: 5c 73 28 31 29 3b 5c 72 5c 6e 49 4e 53 45 52 54 \s(1);\r\nINSERT
0100: 5c 73 49 4e 54 4f 5c 73 74 31 28 63 30 29 5c 73 \sINTO\st1(c0)\s
0110: 56 41 4c 55 45 53 5c 73 28 31 29 3b 5c 72 5c 6e VALUES\s(1);\r\n
0120: 53 45 4c 45 43 54 5c 73 2a 5c 73 46 52 4f 4d 5c SELECT\s*\sFROM\
0130: 73 74 31 5c 73 4c 45 46 54 5c 73 4a 4f 49 4e 5c st1\sLEFT\sJOIN\
0140: 73 74 30 5c 73 57 48 45 52 45 5c 73 74 30 2e 63 st0\sWHERE\st0.c
0150: 30 5c 73 49 53 4e 55 4c 4c 3b 5c 73 2d 2d 5c 73 0\sISNULL;\s--\s
0160: 75 6e 65 78 70 65 63 74 65 64 3a 5c 73 72 6f 77 unexpected:\srow
0170: 5c 73 69 73 5c 73 66 65 74 63 68 65 64 5c 72 5c \sis\sfetched\r\
0180: 6e 3c 2f 70 72 65 3e 5c 72 5c 6e 5c 72 5c 6e 55 n</pre>\r\n\r\nU
0190: 6e 65 78 70 65 63 74 65 64 6c 79 2c 5c 73 61 5c nexpectedly,\sa\
01a0: 73 72 6f 77 5c 73 69 73 5c 73 66 65 74 63 68 65 srow\sis\sfetche
01b0: 64 2e 5c 73 49 74 5c 73 69 73 5c 73 6e 6f 74 5c d.\sIt\sis\snot\
01c0: 73 66 65 74 63 68 65 64 5c 73 77 68 65 6e 5c 73 sfetched\swhen\s
01d0: 74 68 65 5c 73 69 6e 64 65 78 5c 73 69 73 5c 73 the\sindex\sis\s
01e0: 6f 6d 69 74 74 65 64 5c 73 61 6e 64 5c 73 74 68 omitted\sand\sth
01f0: 65 5c 73 66 6f 6c 6c 6f 77 69 6e 67 5c 73 73 74 e\sfollowing\sst
0200: 61 74 65 6d 65 6e 74 5c 73 69 6e 64 69 63 61 74 atement\sindicat
0210: 65 73 5c 73 74 68 61 74 5c 73 74 30 2e 63 30 5c es\sthat\st0.c0\
0220: 73 49 53 4e 55 4c 4c 5c 73 73 68 6f 75 6c 64 5c sISNULL\sshould\
0230: 73 65 76 61 6c 75 61 74 65 5c 73 74 6f 5c 73 66 sevaluate\sto\sf
0240: 61 6c 73 65 3a 5c 72 5c 6e 5c 72 5c 6e 3c 70 72 alse:\r\n\r\n<pr
0250: 65 3e 5c 72 5c 6e 53 45 4c 45 43 54 5c 73 74 30 e>\r\nSELECT\st0
0260: 2e 63 30 5c 73 49 53 4e 55 4c 4c 5c 73 46 52 4f .c0\sISNULL\sFRO
0270: 4d 5c 73 74 31 5c 73 4c 45 46 54 5c 73 4a 4f 49 M\st1\sLEFT\sJOI
0280: 4e 5c 73 74 30 3b 5c 73 2d 2d 5c 73 30 5c 72 5c N\st0;\s--\s0\r\
0290: 6e 3c 2f 70 72 65 3e 0a 4a 20 6c 6f 67 69 6e 20 n</pre>.J login
02a0: 6d 72 69 67 67 65 72 0a 4a 20 6d 69 6d 65 74 79 mrigger.J mimety
02b0: 70 65 20 74 65 78 74 2f 78 2d 66 6f 73 73 69 6c pe text/x-fossil
02c0: 2d 77 69 6b 69 0a 4a 20 73 65 76 65 72 69 74 79 -wiki.J severity
02d0: 20 43 72 69 74 69 63 61 6c 0a 4a 20 73 74 61 74 Critical.J stat
02e0: 75 73 20 4f 70 65 6e 0a 4a 20 74 69 74 6c 65 20 us Open.J title
02f0: 4c 45 46 54 5c 73 4a 4f 49 4e 5c 73 6d 61 6c 66 LEFT\sJOIN\smalf
0300: 75 6e 63 74 69 6f 6e 73 5c 73 77 69 74 68 5c 73 unctions\swith\s
0310: 70 61 72 74 69 61 6c 5c 73 49 53 4e 55 4c 4c 5c partial\sISNULL\
0320: 73 69 6e 64 65 78 0a 4a 20 74 79 70 65 20 43 6f sindex.J type Co
0330: 64 65 5f 44 65 66 65 63 74 0a 4b 20 37 66 33 39 de_Defect.K 7f39
0340: 30 36 30 61 32 34 62 34 37 33 35 33 62 39 33 34 060a24b47353b934
0350: 33 64 62 39 63 32 31 34 65 33 37 32 37 66 38 63 3db9c214e3727f8c
0360: 36 39 38 62 0a 55 20 6d 72 69 67 67 65 72 0a 5a 698b.U mrigger.Z
0370: 20 61 62 30 34 34 64 61 36 39 65 31 63 36 64 62 ab044da69e1c6db
0380: 66 38 37 32 32 35 62 66 37 61 65 38 38 31 36 32 f87225bf7ae88162
0390: 32 0a 2.