Hi Enrico
I'm gonna try once again with luasql = require 'luasql.mysql' and
see if it indeed works, but the question remains, did I write "good"
code that just broke for no reason.
Actually assigning to a local variable the result of require is a good
Lua practice. What was wrong was the behaviour of require that was
assigning a global variable, a sort of unavoidable side effect that was
escaping any form of sandboxing. Lua 5.2 fixed that.
In fact, the functions that assign to the global variable was
module and luaL_openlib, not require.
But you are right, the upgrate broke legitimate code, so this is a bug.
How to deal with it is a bit unclear to me.
If Tomas thinks luasql should be fixed, I'll try to upload an updated
version of the package before the freeze (that will be really soon!).
If the change was intended, I'll just add a note in NEWS.Debian.
I noted that incompatibility but no one has mentioned any problem until
now.
I thought that, in fact, the correct way to use LuaSQL was not
to assume the global luasql, but I think the example does not follow
that principle. Anyway, I think the actual version being compatible with
both Lua 5.1 and 5.2 pays off the price of the mentioned incompatibility.
But do you think this incompatibility deserves a special conditional
compilation that could just assign to the global variable to guarantee
backwards compatibility? I think this is easy to do!
Regards,
Tomás