summaryrefslogtreecommitdiff
path: root/src/common/sql.c
AgeCommit message (Collapse)AuthorFilesLines
2013-12-17Fixed several compiler warningsHaru1-2/+2
- Warnings detected thanks to Xcode's compiler settings (more strict by default) and clang, warnings mostly but not only related to data sizes on 64 bit systems, that were silenced until now by very lax compiler settings. - This also decreases by a great deal the amount of warnings produced by MSVC in x64 mode (for the adventurous ones who tried that) - Also fixed (or silenced in case of false positives) the potential issues pointed out by the (awesome) clang static analyzer. - Patch co-produced with Ind, I'm merging and committing in his place! Signed-off-by: Haru <haru@dotalux.com>
2013-11-14Updated db2sql plugin for the needs of the new itemdbshennetsind1-0/+3
May be used as ./map-server --db2sql or by typing "server tools db2sql" within map-server console parse. Special Thanks to Haruna. Signed-off-by: shennetsind <ind@henn.et>
2013-10-26Changed 'tick' variables to 64 bitHaru1-1/+1
- This fixes an issue with timers that stop working after about 24-49 days when the tick overflows (note that this may happen much earlier than that, and at hard to predict times, on some systems) - Updated the RDTSC help message in the configure script to also warn users about issues with SpeedStep enabled systems. - On Windows, tick() still has a resolution of 10~15ms (or even as low as 100ms on some systems). A TODO comment (thanks, Ai4rei) was added for a follow-up patch, as I want this one to be as small as possible) - Note: on Windows versions earlier than 6.x (Vista, Server 2008), the tick overflow issue is NOT fixed, since they don't support the function used to retrieve a 64 bit tick. This isn't a big issue, since those platforms are already - or going soon to be - out of their extended support period, and it's already advisable to upgrade, for other reasons. If you're the unfortunate user of such a system, it is recommended that you reboot your machine at least once every 49 days for Hercules to work reliably. - Note: To clear some doubts, since I've already been asked, this has absolutely NOTHING to do with 32/64 bit CPUs or OSes. It's all about a variable's size, not the size of registers of your CPU, and your 32bit CPU will be able to handle this just fine. Signed-off-by: Haru <haru@dotalux.com>
2013-09-25Renamed iTimer interface to timer.shennetsind1-2/+2
Also removed duplicate mentions of timer within calls to shorten.
2013-07-21HCache & SQL Update Checker minor changeshennetsind1-1/+1
Files loaded by HCache now display a green C to distinguish whether it was loaded from cache or not Fixed a typo in the SQL Update Checker. Signed-off-by: shennetsind <ind@henn.et>
2013-07-08Cygwin Fix for the Hercules SQL Update Checkshennetsind1-4/+48
Also modified the output (i think its sightly improved), also added a console command to skip updates so no need to go add the query yourself 'sql update skip <file name>' Signed-off-by: shennetsind <ind@henn.et>
2013-06-10Added SqlStmt functions to the SQL interfaceSusu1-64/+81
2013-06-07Hercules Renewal Phase One : pc, party, map, timerSusu1-2/+2
Added iPc, iParty, iMap, iTimer to HPM exported interfaces
2013-05-15HPM Updateshennetsind1-64/+70
Made SQL and strlib functions HPM-friendly, special thanks to Yommy for bringing the issue up. Added partial map.c support, for the all-handy map[] array, beware that soon the whole map.c renewal design will be commit and when that happens your usage of map.c functions in plugins might require some updates. Signed-off-by: shennetsind <ind@henn.et>
2013-02-16Updating the Headers across source filesshennetsind1-1/+1
And adding missing ones. Signed-off-by: shennetsind <ind@henn.et>
2013-02-15MySQL Update Checker: Updatedshennetsind1-0/+3
Added a primary key to the `sql_updates` table (special thanks to Trojal) Modified the parser to ignore new/empty lines and added support for "//" comments in the index file. Signed-off-by: shennetsind <ind@henn.et>
2013-02-14Introducing MySQL DB Update Checkershennetsind1-0/+47
First version. Signed-off-by: shennetsind <ind@henn.et>
2013-02-07Fixing mistake in modified source code headersshennetsind1-1/+1
Signed-off-by: shennetsind <ind@henn.et>
2013-02-03Fixed Bug #7051shennetsind1-1/+1
http://hercules.ws/board/tracker/issue-7051-warning-when-compiling/ Signed-off-by: shennetsind <ind@henn.et>
2013-02-03Updating the headers of so-far modified files with outdated headersshennetsind1-2/+3
Signed-off-by: shennetsind <ind@henn.et>
2013-02-03Introducing MySQL Reconnectshennetsind1-1/+73
* mysql_reconnect_type ** 1: when mysql disconnects during runtime, the server tries to reconnect mysql_reconnect_count times and, if unsuccessful, the server is shut down ** 2: when mysql disconnects during runtime it tries to reconnect indefinitely mysql_reconnect_type:2 * mysql_reconnect_count ** number of reconnect attempts the server should do when the database disconnects during runtime ** only used when mysql_reconnect_type is 1 mysql_reconnect_count:1 ~Ind Signed-off-by: shennetsind <ind@henn.et>
2012-12-05- Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).brianluau1-600/+616
[16969:16991/trunk/src/] will be re-committed in the next 24 hours. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16992 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-11-25Applied AStyle code formating as discussed on tid:74602.greenboxal21-616/+600
Removed /SAFESEH option from MSVC11 projects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-03cleaned up windows header usage (added one central file to use windows / ↵blacksirius1-1/+1
winapi specific stuff, to be able to set the appropriate flags before including it correctly) Note: this may screw up mingw or cygwin building, ill fix it later... git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16219 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Replaced custom type 'intptr' with standard 'intptr_t'.ultramage1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14873 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-20* Fixed a crash when SqlStmt_ShowDebug is given NULL pointer as statement ↵ai4rei1-1/+1
handle (since r10753, related r10818). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14473 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-19* Various VC6-related fixes and tweaks. [Ai4rei]ai4rei1-2/+2
- Fixed a typo in VC6 project files, that prevented login-server from compiling (bugreport:4061, since r12727). - Fixed usage of 'long long' in Sql_P_BindSqlDataType preventing SQL VC6 projects from compiling (bugreport:1741, since r10779). - Fixed usage of 'long long' in strtoull preventing VC6 projects from compiling (bugreport:4059, follow up to r14245). - Made strtoull default to base 10 and actually process base 8, to match the normal behavior of this function (bugreport:4059, follow up to r14245). - Fixed functions in db.c not being returned as pointer, causing warnings on VC6. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14466 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-01-13Fixed Sql_SetEncoding() returning SQL_ERROR when it succeeds and vice versa ↵ultramage1-1/+1
(thanks to Rail for noticing it). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13447 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-11-22* Hunted down the simpler 64bit pointer truncations.FlavioJS1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13380 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-07-29Fixed Sql object not initializing default values properly.ultramage1-1/+6
Fixed Sql_Free producing timer deallocation errors when called without first establishing a database connection. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13011 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-07-26Merged the /loginmerge branch (topic:192754)ultramage1-0/+51
* the login server storage, ipban and logging systems have been abstracted and now provide a common interface; the rest has been merged into a single login server core (no more login/login_sql duplicity) * storage systems are now added via compiler options (WITH_SQL / WITH_TXT) * multiple storage engines can be compiled in at the same time, and the config option account.engine defines which one will be used. * due to MySQL autoincrement limitations, accounts with id '0' will not be supported; account IDs from this point on should start from '1'. * login_log() functions now again record IP addresses in dotted format, not as 4-byte integers (undo from r6868). * removed config options that defined column names in the login table * removed `memo` and `error message` columns from login db/savefile * moved `loginlog` table to the logs database * added sql files upgrade_svn12975.sql and upgrade_svn12975_log.sql * due to changes to the login table layout, I added an !optional! sql file (upgrade_svn12975_view.sql) that will provide a certain degree of backwards compatibility with existing software; read the instructions inside carefully! * moved third-party includes/libs to a separate directory * updated project files / makefiles Changed the way GM levels are handled * removed conf/gm_account.txt * added the gm level column to the txt savefile (after 'email' column) * gm level information is now transferred along with account data For open problems see bugreport:1889. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13000 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-21upsFlavioJS1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11775 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-21* Fixed Sql_SetEncoding not setting the encoding of the connection properly. ↵FlavioJS1-2/+4
(fixes bugreport:30) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11774 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-24* Limited manual detection of data truncation to string/enum/blob columns.FlavioJS1-4/+20
* Renamed conf-tmpl to conf. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11284 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-23* Added flag svn:executable to the configure script.FlavioJS1-13/+36
* Added code for MySQL versions (below 5.0) that don't have MYSQL_DATA_TRUNCATED. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11281 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-20* Merged the tmpsql branch:FlavioJS1-0/+851
- Abstraction for the sql code (sql.c/h). - New configure script and makefiles. - Restored txt zeny logging code. (r10814) - Rewrote mapserver's sql code - itemdb, mobdb, mapreg, logs. (r10814) - Fixed a precedence issue (&& and ) in char_sql/char.c. (r10833) - Improved db reading code a bit for consistency. (r11077) - Added separate atcommand for mail deletion. (r11077) - Corrected a few messages that said "new" instead of "unread". (r11077) - Broadcast (*) messages now use "*" as the target's name (not ""). (r11077) - Moved StringBuf code from utils.c/h to strlib.c/h. (r11084 r11117) - Some misc login server cleanups (reformatting etc). (r11136) - Corrected/modified some header entries. (r11141 r11147 11148) - Adjusted VS project files. (r11147) - Adjusted the way the sql charserver does item saving. (r11192) - Corrected usage of reserved keyword 'friend' in mmo.h. (r11192) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11245 54d463be-8e91-2dee-dedb-b68131a5f0ec