[Mysql-cocoa-commits] CVS: SMySQL SMySQLResult.m,1.8.2.1,1.8.2.2
Brought to you by:
sergecohen
From: Serge C. <ser...@us...> - 2003-08-22 04:43:28
|
Update of /cvsroot/mysql-cocoa/SMySQL In directory sc8-pr-cvs1:/tmp/cvs-serv7098 Modified Files: Tag: version-1 SMySQLResult.m Log Message: Corrected the issue (raised by Lorenz Textor) on BigInt MySQL type (corresponding to long long, not long int), where a BIGINT would be passed back as a 32 bits integer instead of 64 bits. Now SMySQLResult handles properly BIGINT. Added a BIGINT column in the test1 table (CLI_Test), to check if it is working. NB : Unsigned int (both INT and BIGINT) might still causes problem if they are in the higher half of their range (because they will be interpreted as signed integers). Version get from 1.0.0 to 1.0.1 2003-08-21; Serge Cohen. Index: SMySQLResult.m =================================================================== RCS file: /cvsroot/mysql-cocoa/SMySQL/Attic/SMySQLResult.m,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -C2 -d -r1.8.2.1 -r1.8.2.2 *** SMySQLResult.m 16 Jan 2003 12:16:05 -0000 1.8.2.1 --- SMySQLResult.m 21 Aug 2003 06:33:54 -0000 1.8.2.2 *************** *** 213,216 **** --- 213,217 ---- id theCurrentObj,theDataObj; char *theData = calloc(sizeof(char),theLengths[i]+1); + char *theUselLess; if (theRow[i] == NULL) { theCurrentObj = [NSNull null]; *************** *** 223,234 **** switch (theField[i].type) { ! case FIELD_TYPE_TINY: ! case FIELD_TYPE_SHORT: ! case FIELD_TYPE_LONG: ! case FIELD_TYPE_INT24: ! case FIELD_TYPE_LONGLONG: ! theCurrentObj = [NSNumber numberWithLong:atol(theData)]; ! break; ! case FIELD_TYPE_DECIMAL: case FIELD_TYPE_FLOAT: case FIELD_TYPE_DOUBLE: --- 224,237 ---- switch (theField[i].type) { ! case FIELD_TYPE_TINY: ! case FIELD_TYPE_SHORT: ! case FIELD_TYPE_INT24: ! case FIELD_TYPE_LONG: ! theCurrentObj = [NSNumber numberWithLong:atol(theData)]; ! break; ! case FIELD_TYPE_LONGLONG: ! theCurrentObj = [NSNumber numberWithLongLong:strtoq(theData, &theUselLess, 0)]; ! break; ! case FIELD_TYPE_DECIMAL: case FIELD_TYPE_FLOAT: case FIELD_TYPE_DOUBLE: *************** *** 330,333 **** --- 333,337 ---- id theCurrentObj,theDataObj; char *theData = calloc(sizeof(char),theLengths[i]+1); + char *theUselLess; if (theRow[i] == NULL) { theCurrentObj = [NSNull null]; *************** *** 341,352 **** switch (theField[i].type) { ! case FIELD_TYPE_TINY: ! case FIELD_TYPE_SHORT: ! case FIELD_TYPE_LONG: ! case FIELD_TYPE_INT24: ! case FIELD_TYPE_LONGLONG: ! theCurrentObj = [NSNumber numberWithLong:atol(theData)]; ! break; ! case FIELD_TYPE_DECIMAL: case FIELD_TYPE_FLOAT: case FIELD_TYPE_DOUBLE: --- 345,358 ---- switch (theField[i].type) { ! case FIELD_TYPE_TINY: ! case FIELD_TYPE_SHORT: ! case FIELD_TYPE_INT24: ! case FIELD_TYPE_LONG: ! theCurrentObj = [NSNumber numberWithLong:atol(theData)]; ! break; ! case FIELD_TYPE_LONGLONG: ! theCurrentObj = [NSNumber numberWithLongLong:strtoq(theData, &theUselLess, 0)]; ! break; ! case FIELD_TYPE_DECIMAL: case FIELD_TYPE_FLOAT: case FIELD_TYPE_DOUBLE: |