|
Lygaios Newbie
Joined: 12 Oct 2000 Posts: 9 Location: USA
|
Posted: Sat Mar 14, 2009 1:09 pm
[3.05] #WALK Case Sensitive |
Just converted to 3.05 from 2.37. The conversion went without problems, as far as I can tell. However, it appeared at first that #WALK was not working. After looking at it a bit more closely, it seems that #WALK is case-sensitive in 3.05, where it was insensitive in 2.37; i.e., if a room has a short name of "TollHouse", 2.37 would be OK with #WALK tollhouse or #WALK Tollhouse or whatever. 3.05 seems to require an exact match. I don't know if this is an intended change or not, but figured a note here might save some others some time tracking it down.
|
|
|
|
jpolen2 Beginner
Joined: 14 Jan 2004 Posts: 18
|
Posted: Sat Mar 14, 2009 6:15 pm |
I also just upgraded to 3.05 and noticed that #teleport is also now case sensitive.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Mar 16, 2009 5:34 pm |
I'll add that to the bug list. It was not intended to be case sensitive.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Apr 16, 2009 9:13 pm |
Well, I thought this one was going to be easy, but I was wrong.
Turns out that SQLite is CASE SENSITIVE!! MySQL isn't. ADO/MDAC isn't. But SQLite is. You can specify that a column is case INsensitive at the time the table is created using the COLLATE NOCASE option, like this:
CREATE TABLE MyTable (Name VARCHAR(80) COLLATE NOCASE)
However, you CANNOT change an existing column of an existing table. The ALTER TABLE command in SQLite3 doesn't support altering columns. Which is a huge pain.
I don't know why they decided to make this the default when many of the other databases being used (especially by the free, open source community) have case insensitive as the default.
So, I have modified CMUD to create the new map database tables with text fields marked as COLLATE NOCASE. However, there isn't any way for me to modify *existing* map databases without a lot more work (essentially rewriting the entire database file).
If you want to use case-insensitive searches in the next version, you'll need to reconvert your map database from your original zMUD or CMUD 2.37 map files. Sorry for the inconvenience, but that's how I do it with Beta versions. If there was a Public version with this problem, then I'd write the code to convert existing map databases. But since we are just using beta versions, it shouldn't be a big problem to re-convert your maps if you need this feature.
If you don't want to reconvert your CMUD map 3.x map files, then you'll just need to be aware that all commands and functions that accept a room ID name will be case sensitive in your existing maps.
Sure would be nice if SQL was an actual *STANDARD* that specified stuff like this. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Apr 16, 2009 9:55 pm |
OK, more info on this. I found that the LIKE operator in SQLite is already case insensitive. So I changed my SQL statement from Name="value" to Name LIKE "value" and now it works. I did some basic performance testing and it doesn't seem to have any impact on performance.
I've decided that this is actually a better way to handle it rather than add all of the COLLATE commands. It also allows you to use wildcards to return the first value that matches a partial name in case anyone has any use for that in the future.
This also fixes the bug without needing to alter the map database, so you can ignore my comments in the previous post about it not working unless you reconvert your map. It will work fine now on existing maps. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|