Обсуждение: Bug in execute.c
From execute.c, SC_setInsertedTable(), line 790: if (ptr = strchr(cmd + 1, '.'), NULL != ptr) len = ptr - cmd; This branch is supposed to extract an unquoted schema name from an INSERT statement. If that statement is INSERT INTO mytable VALUES (1, 1.5) , the schema name will be "mytable VALUES (1, 1", and the table name, "5)". I'm sorry I don't have a patch right now. I can come up with one, though. -- Christian
* Christian Ullrich wrote: > From execute.c, SC_setInsertedTable(), line 790: > > if (ptr = strchr(cmd + 1, '.'), NULL != ptr) > len = ptr - cmd; > I'm sorry I don't have a patch right now. I can come up with one, though. Patch attached. It may be a bit over the top. Please let me know what you think. -- Christian
Вложения
On 04/24/2015 10:48 AM, Christian Ullrich wrote: > * Christian Ullrich wrote: > >> From execute.c, SC_setInsertedTable(), line 790: >> >> if (ptr = strchr(cmd + 1, '.'), NULL != ptr) >> len = ptr - cmd; > >> I'm sorry I don't have a patch right now. I can come up with one, though. > > Patch attached. It may be a bit over the top. Please let me know what > you think. Thanks, applied! I also added a little regression test for this. I didn't try testing it exhaustively to see what kind of things would still trip it over (comments? newlines?), but this is certainly a step in the right direction. Well, it would be better to not have to do this parsing, but that's no reason to not improve what we have. - Heikki