Closed moteus closed 2 years ago
Note: the (insane?) way Lua handles array tables when implementing a solution
local arr = { Nil, 3 }
print(#arr) -- prints 2
arr = { 2, 3, Nil }
print(#arr) -- prints 2
arr = { Nil, 3, Nil, 3 }
print(#arr) -- prints 4
arr = { Nil, Nil, Nil, Nil, Nil, Nil, Nil }
print(#arr) -- prints 0
arr = { 1, Nil, Nil, Nil, Nil, Nil, Nil }
print(#arr) -- prints 1
Any solution will require some extra effort on the part of the user to ensure correctness and safety.
I'm closing out very old issues. Feel free to comment if you still feel something should be addressed.
Arrays like
{NULL,"NULL"}
should be handeled to `{pg.NULL, 'NULL'}. I use yours lpeg parser with simple patch.Test case: sql -
select ARRAY[NULL,'1','NULL1','NULL',NULL,'2',NULL]
, result in text mode{NULL,1,NULL1,"NULL",NULL,2,NULL}
I think same cahnges need in Array building.