diff options
author | Haru <haru@dotalux.com> | 2013-11-18 09:29:40 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2013-11-18 09:29:40 +0100 |
commit | 4655f6611b14fca90ed38b021bf6a365cbfb335a (patch) | |
tree | f70c9f2392b7e8d2a95c2be4d99d8f8e0aa93375 /src/map/itemdb.c | |
parent | 3e9758706ecf80d7656daefb546c80bf6b549967 (diff) | |
download | hercules-4655f6611b14fca90ed38b021bf6a365cbfb335a.tar.gz hercules-4655f6611b14fca90ed38b021bf6a365cbfb335a.tar.bz2 hercules-4655f6611b14fca90ed38b021bf6a365cbfb335a.tar.xz hercules-4655f6611b14fca90ed38b021bf6a365cbfb335a.zip |
Follow-up to 1f5161a2bd3c7934373146d8cac3c131536758ba
- Added explicit column names in the item_db query, to ensure it will
throw a SQL error in case some are missing, rahter than silently
failing and returning incorrect data.
- Added sql upgrade file to add the bindonequip column to the item_db2
table for those who have it.
- As with all the item_db2 upgrade scripts, you need at least MySQL 5.0
in order to run it. If your version is not compatible, or if the
script fails for any reason, manual upgrade instructions are provided
within the script.
- Special thanks to Mumbles.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r-- | src/map/itemdb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 2214e9c64..2fcc60c70 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1939,7 +1939,13 @@ int itemdb_readdb_sql(const char *tablename) { int i = 0, count = 0; // retrieve all rows from the item database - if( SQL_ERROR == SQL->Query(map->mysql_handle, "SELECT * FROM `%s`", tablename) ) { + if( SQL_ERROR == SQL->Query(map->mysql_handle, "SELECT `id`, `name_english`, `name_japanese`, `type`," + " `price_buy`, `price_sell`, `weight`, `atk`," + " `matk`, `defence`, `range`, `slots`," + " `equip_jobs`, `equip_upper`, `equip_genders`, `equip_locations`," + " `weapon_level`, `equip_level_min`, `equip_level_max`, `refineable`," + " `view`, `bindonequip`, `script`, `equip_script`, `unequip_script`" + "FROM `%s`", tablename) ) { Sql_ShowDebug(map->mysql_handle); return 0; } |