View previous topic :: View next topic |
Author |
Message |
Aerisarn
Joined: 11 Mar 2008 Posts: 14
|
Posted: Sun May 18, 2008 18:00 Post subject: SQLFetch and TEXT fields on MySQL |
|
|
Hi, I got the following problem. When i try to select a Text field on a MyISAM table of my DB, I can only fetch the first 1024 bytes of the resultset. If the TEXT field exceeds 1024 bytes, I fetch nothing. Here is the the dump on nwnx_odbc log:
...
o Got request: SELECT dialog FROM quest_main WHERE quest_id='q_goblin'
o Sent response (0 bytes):
o Got request: SELECT dialog FROM quest_main WHERE quest_id='q_goblin'
o Sent response (1023 bytes): <init>
...
Between the two queries I obviously changed the text field (truncated to 1023 bytes). Am i doing something weird? My current specs are:
Ubuntu Edgy with vanilla mysql 5 from the distro packages.
nwnx 2.7-beta4 (which is supposed to dinamically allocate resultsets, so i see no reason why it stops on 1024 bytes)
latest ODBC2 driver
I receive no error from nwnx nor odbc, please help |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Thu Feb 12, 2009 5:27 Post subject: |
|
|
I just ran into the same problem *bump* |
|
Back to top |
|
|
Asparius
Joined: 18 Sep 2007 Posts: 52
|
Posted: Thu Feb 12, 2009 18:48 Post subject: |
|
|
Did you try to increase size of NWNX!ODBC!SPACER variable?... |
|
Back to top |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Thu Feb 12, 2009 22:54 Post subject: |
|
|
Asparius wrote: | Did you try to increase size of NWNX!ODBC!SPACER variable?... |
That would do it. As a general rule, don't store massive amounts of text data on the database. Store it in a file instead, and use nwnx_files to access it. Or else split it up into several rows on the database. |
|
Back to top |
|
|
Quixsilver
Joined: 20 Jan 2009 Posts: 30
|
Posted: Fri Feb 13, 2009 2:40 Post subject: |
|
|
Interesting idea. nwnx_files is Windows only though, right? |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Fri Feb 13, 2009 3:15 Post subject: |
|
|
Quixsilver wrote: | Interesting idea. nwnx_files is Windows only though, right? | Yes it is only windows now and I have no plans to port it as I don't understand linux at all. Maybe someone else... _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Fri Feb 13, 2009 16:18 Post subject: |
|
|
In that case, I would split it up into multiple rows on the database. Example table structure (very general PseudoSQL):
ITEM:
ItemID PRIMARY KEY
ItemName
ItemRecords
ITEM_RECORD:
RecordNo
ItemID
Text
PRIMARY KEY (RecordNo, ItemID) |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Fri Feb 13, 2009 18:54 Post subject: |
|
|
if it's just plain text, you could set is as description of an item and store that. |
|
Back to top |
|
|
|