[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  SQL error in versions 4.4+ - FIXED
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

SQL error in versions 4.4+ - FIXED

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Andala   (7 posts)  [Biography] bio
Date Wed 05 Aug 2009 04:29 AM (UTC)

Amended on Wed 05 Aug 2009 04:30 AM (UTC) by Andala

Message
Disclaimer: I'm relatively completely noob-ish when it comes to scripting and whatnot. So forgive my lack of understanding.

After upgrading my mushclient from version 4.37 to version 4.40, one of my worlds("Whyte's Mapper") seems to hang without actually connecting, and presents a series of popups, as follows:

Quote:
SQL error on statement: "SELECT value FROM worlds WHERE name = 'Whyte's Mapper World Position:wp.showCmd'" near "s": syntax error


Quote:
SQL error on statement: "SELECT value FROM worlds WHERE name = 'Whyte's Mapper World Position:wp.flags'" near "s": syntax error


Quote:
SQL error on statement: "SELECT value FROM worlds WHERE name = 'Whyte's Mapper World Position:wp.ptMinPosition.x'" near "s": syntax error


Quote:
SQL error on statement: "SELECT value FROM worlds WHERE name = 'Whyte's Mapper World Position:wp.ptMinPosition.y'" near "s": syntax error


Quote:
SQL error on statement: "SELECT value FROM worlds WHERE name = 'Whyte's Mapper World Position:wp.ptMaxPosition.x'" near "s": syntax error


Quote:
SQL error on statement: "SELECT value FROM worlds WHERE name = 'Whyte's Mapper World Position:wp.ptMaxPosition.y'" near "s": syntax error


Quote:
SQL error on statement: "SELECT value FROM worlds WHERE name = 'Whyte's Mapper World Position:wp.left'" near "s": syntax error


Quote:
SQL error on statement: "SELECT value FROM worlds WHERE name = 'Whyte's Mapper World Position:wp.right'" near "s": syntax error


Quote:
SQL error on statement: "SELECT value FROM worlds WHERE name = 'Whyte's Mapper World Position:wp.bottom'" near "s": syntax error


Quote:
SQL error on statement: "SELECT value FROM worlds WHERE name = 'Whyte's Mapper:Top Height'" near "s": syntax error


Quote:
SQL error on statement: "SELECT value FROM worlds WHERE name = 'Whyte's Mapper:Bottom Height'" near "s": syntax error


It doesn't let me do anything except push OK until I end up at normal screen, as if it were connecting, but it never actually connects. Additionally, my input box doesn't show up. If I try to resize the window, the last two error boxes pop up again.

This doesn't seem to happen with any other world files. Also, if I disconnect it (from trying to connect), and reconnect, everything loads fine, except the input box still doesn't show.

Any thoughts? Am I missing something really obvious? Or what additional information can I give?

ETA: I've tried every version from 4.37-4.42. Everything up to 4.39 works, but beyond that..
[Go to top] top

Posted by Coderunner   USA  (27 posts)  [Biography] bio
Date Reply #1 on Wed 05 Aug 2009 04:37 AM (UTC)
Message
Hello,
I've also had this problem. It seems to be a problem with characters that need to have an escape sequence (backslash) placed before them to be successfully added to the database. I've had experience with this through php and MySQL, and in that case, I know you have to use a function like mysql_real_escape_string(), but I'm not sure what the SQLite equivalent would be. Anyway, this isn't your fault, and should be extremely easy to fix. Until then, though... There's not much you can do but not use world with apostrophes or quotes in the name.

Good luck.
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Reply #2 on Wed 05 Aug 2009 04:54 AM (UTC)
Message
It's the ' in "Whyte's".

Maybe back up the file and try editing all these out and see if it works.
[Go to top] top

Posted by Nick Gammon   Australia  (21,609 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 05 Aug 2009 06:12 AM (UTC)
Message
This is in MUSHclient itself when it reads things like the world position from the database. The world name was not having quotes doubled in it.

For now, change the "Whyte's Mapper" name to lose the quote (eg. "Whytes Mapper").

Then save the world file, and try again. Perhaps back it up first just in case.

Fixed in version 4.43.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,609 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Wed 05 Aug 2009 06:13 AM (UTC)
Message
In a script, double the quotes, like this:


      -- quotes have to be doubled
      local name = string.gsub (name, "'", "''")


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Andala   (7 posts)  [Biography] bio
Date Reply #5 on Wed 05 Aug 2009 02:43 PM (UTC)
Message
Thanks for the quick response.

Changing the name seems to have eliminated the alert boxes. The input box was still missing for a moment, which freaked me out, but I just had to resize the window until it showed up.

Thank you!
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #6 on Wed 05 Aug 2009 11:45 PM (UTC)
Message
The same spam of dialog boxes happens to me, too, except for entirely different reasons: if my thumb drive gets jiggled somehow, it seems to reset something internally, and when I close the client (or do something else that uses the database) it throws lots of dialog box errors before finally closing.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (21,609 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Thu 06 Aug 2009 12:13 AM (UTC)
Message
Perhaps it loses its connection to the database?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,609 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Thu 06 Aug 2009 12:20 AM (UTC)
Message
Can you give me one of the error messages please? I might be able to detect that the database was closed, and re-open it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #9 on Thu 06 Aug 2009 02:48 PM (UTC)
Message
Could also "fix" the error popups while we're at it? It's rather painful to have to dismiss about 20 separate dialogs.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #10 on Thu 06 Aug 2009 05:58 PM (UTC)
Message
SQL error on statement:
"UPDATE worlds SET value = '3' WHERE name = 'Main window:wp.showCmd"
disc I/O error


Lots and lots of errors after that one, but they're all disc I/O errors.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (21,609 posts)  [Biography] bio   Forum Administrator
Date Reply #11 on Thu 06 Aug 2009 09:42 PM (UTC)
Message
I am a bit wary of trying to detect the database being prematurely closed (you may as well do the same thing for log files etc.).

However I acknowledge the dozens of dialog boxes are highly annoying. The method of reporting SQL errors has changed in version 4.43 to have them written to a notepad window instead (since no world file is necessarily open).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,609 posts)  [Biography] bio   Forum Administrator
Date Reply #12 on Sun 09 Aug 2009 09:09 PM (UTC)
Message
Version 4.43 now closes and re-opens the preferences database when you save your global preferences.

So, if you believe you have jiggled your thumb drive (eg. because you get lots of error messages) you can open up global preferences, and then click OK. That should re-establish the connection to the database.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


8,583 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]