knop-project / knop

Web application framework for Lasso 8 and 9
18 stars 46 forks source link

Knop8: user->login does not work with databases with hyphen in name #40

Closed stevepiercy closed 12 years ago

stevepiercy commented 12 years ago

In Knop8, with a database named "foo-test", user->login will generate an SQL action statement:

SELECT SQL_CALC_FOUND_ROWS * FROM foo-test.users WHERE (username = 'username') LIMIT 0,50

which in turn causes an SQL error.

The workaround is not to use hyphens in your database names.

jolle-c commented 12 years ago

This appears to be an issue with Lassos Inline handling rather than with the knop call. Knop_user -> login calls knop_database -> select. This in turn creates a regular inline and sends it off. Testing to create a plain inline by itself shows the same flaw. Example: local(_search = array(-returnfield = 'id', -op='bw', 'email' = 'jolle', -search)) local(db_connect = array(-database = 'knop-demo', -table = 'customer')) inline( #_search, -statementonly, #db_connect) => {^ action_statement ^} SELECT SQL_CALC_FOUND_ROWS id FROM knop-demo.customer WHERE email LIKE 'jolle%' LIMIT 0,50

Should be: SELECT SQL_CALC_FOUND_ROWS id FROM knop-demo.customer WHERE email LIKE 'jolle%' LIMIT 0,50

Can't figure out how to solve that within Knop. ->

jolle-c commented 12 years ago

Hm, interesting. The backticks disappear in the comments...

stevepiercy commented 12 years ago

Backticks are markdown for ....

Anyway, I will send a bug report to LassoSoft. That's amazing that it's never been caught!