SQLite
Artifact Content
Not logged in

Artifact 20f0d40ca31e132ae529d94400eb0eff4f00abb4:

Ticket change [20f0d40ca3] - New ticket [bfbf38e5e9] Segfault on a nested join. by drh 2012-11-02 12:30:55.
D 2012-11-02T12:30:55.380
J comment Reported\son\sthe\smailing\slist:\r\n\r\n<blockquote><pre>\r\nCREATE\sTABLE\sAAA\s(\r\n\s\saaa_id\s\s\s\s\s\s\sINTEGER\sPRIMARY\sKEY\sAUTOINCREMENT\r\n);\r\nCREATE\sTABLE\sRRR\s(\r\n\s\srrr_id\s\s\s\s\s\sINTEGER\s\s\s\s\sPRIMARY\sKEY\sAUTOINCREMENT,\r\n\s\srrr_date\s\s\s\sINTEGER\s\s\s\s\sNOT\sNULL,\r\n\s\srrr_aaa\s\s\s\s\sINTEGER\r\n);\r\nCREATE\sTABLE\sTTT\s(\r\n\s\sttt_id\s\s\s\s\s\sINTEGER\sPRIMARY\sKEY\sAUTOINCREMENT,\r\n\s\starget_aaa\s\sINTEGER\sNOT\sNULL,\r\n\s\ssource_aaa\s\sINTEGER\sNOT\sNULL\r\n);\r\ninsert\sinto\sAAA\s(aaa_id)\svalues\s(2);\r\ninsert\sinto\sTTT\s(ttt_id,\starget_aaa,\ssource_aaa)\r\nvalues\s(4469,\s2,\s2);\r\ninsert\sinto\sTTT\s(ttt_id,\starget_aaa,\ssource_aaa)\r\nvalues\s(4476,\s2,\s1);\r\ninsert\sinto\sRRR\s(rrr_id,\srrr_date,\srrr_aaa)\r\nvalues\s(0,\s0,\sNULL);\r\ninsert\sinto\sRRR\s(rrr_id,\srrr_date,\srrr_aaa)\r\nvalues\s(2,\s4312,\s2);\r\nSELECT\si.aaa_id,\r\n\s\s(SELECT\ssum(CASE\sWHEN\s(t.source_aaa\s==\si.aaa_id)\sTHEN\s1\sELSE\s0\sEND)\r\n\s\s\s\s\sFROM\sTTT\st\r\n\s\s)\sAS\ssegfault\r\nFROM\r\n\s(SELECT\scurr.rrr_aaa\sas\saaa_id\r\n\s\s\s\sFROM\sRRR\scurr\r\n\s\s\s\s\s\s--\syou\salso\scan\scomment\sout\sthe\snext\sline\r\n\s\s\s\s\s\s--\sit\scauses\ssegfault\sto\shappen\safter\sone\srow\sis\soutputted\r\n\s\s\s\s\s\sINNER\sJOIN\sAAA\sa\sON\s(curr.rrr_aaa\s=\saaa_id)\r\n\s\s\s\s\s\sLEFT\sJOIN\sRRR\sr\sON\s(r.rrr_id\s<>\s0\sAND\sr.rrr_date\s<\scurr.rrr_date)\r\n\s\s\sGROUP\sBY\scurr.rrr_id\r\n\s\sHAVING\sr.rrr_date\sIS\sNULL\r\n)\si;\r\n</pre></blockquote>
J detected Application_Fault
J foundin trunk:2012-11-02
J private_contact 21acf606a926cf9bbf2ac304bb3928dcd0e489fe
J severity Critical
J status Open
J subsystem Unknown
J title Segfault\son\sa\snested\sjoin
J type Code_Defect
K bfbf38e5e9956ac69f9491e5112636ff2ecef923
U drh
Z 8c345a0392f8c309c8c78b53337f62b6