[Mysql-cocoa-commits] CVS: SMySQL/CLI_Test Make_DB_and_table.mysql,1.2,1.3 main.m,1.2,1.3
Brought to you by:
sergecohen
From: Serge C. <ser...@us...> - 2004-08-04 23:31:43
|
Update of /cvsroot/mysql-cocoa/SMySQL/CLI_Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4169/CLI_Test Modified Files: Make_DB_and_table.mysql main.m Log Message: Added the MCPNumber class to handle the unsigned integer numbers (so that there later printout/comparison/equality are coherent with there signedness). Adde support to the MCPNumber in the MCPResult, as well as proper support for the TEXT type (will now get output as NSString while it was NSData in previous release). Declare this version to be 2.3.0. 2004-08-05; Serge Cohen. Index: Make_DB_and_table.mysql =================================================================== RCS file: /cvsroot/mysql-cocoa/SMySQL/CLI_Test/Make_DB_and_table.mysql,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Make_DB_and_table.mysql 21 Aug 2003 06:30:52 -0000 1.2 --- Make_DB_and_table.mysql 4 Aug 2004 23:31:31 -0000 1.3 *************** *** 14,17 **** --- 14,18 ---- test1_text text NOT NULL default '', test1_ll bigint NOT NULL, + test1_ull bigint unsigned NOT NULL, PRIMARY KEY (test1_id) ) TYPE=MyISAM COMMENT='A simple test table for CLI_Test application running with SMySQL framework.'; *************** *** 21,23 **** --- 22,25 ---- INSERT INTO test1 (test1_id, test1_name, test1_desc, test1_text, test1_ll) VALUES (2,'second','second entry in the table', 'just to have more than just one line in the test1 table...', '2147483648'); INSERT INTO test1 (test1_id, test1_name, test1_desc, test1_text, test1_ll) VALUES (3,'third','third, and last, entry in the table', 'I like multiple lines in DB tables, but I\'m too lazy to go further than 3!!', '9223372036854775806'); + INSERT INTO test1 (test1_id, test1_name, test1_desc, test1_text, test1_ll, test1_ull) VALUES (4,'fourth','fourth entry in the table', 'just to UNSIGNED BIGINT...', '18446744073709551612', '18446744073709551612'); Index: main.m =================================================================== RCS file: /cvsroot/mysql-cocoa/SMySQL/CLI_Test/main.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.m 1 Mar 2004 11:49:17 -0000 1.2 --- main.m 4 Aug 2004 23:31:31 -0000 1.3 *************** *** 39,45 **** NSArray *names, *types; NSDictionary *row; ! unsigned int count, i; // insert code here... connection = [[MCPConnection alloc] initToHost:@"localhost" withLogin:@"ObjC" password:@"MySQL_class" usingPort:0]; [connection selectDB:@"test_mysqlclass"]; --- 39,51 ---- NSArray *names, *types; NSDictionary *row; ! unsigned int count, i; ! char *aBigIntegerAsString = "18446744073709551612"; ! // char *aBigIntegerAsString = "184467440737095516"; // insert code here... + NSLog(@"A big integer (64b required) : string : %s, as integer (using strtoull) : %llu, NSNumber :%@", aBigIntegerAsString, strtoull(aBigIntegerAsString, NULL, 0), [MCPNumber numberWithUnsignedLongLong:strtoull(aBigIntegerAsString, NULL, 0)]); + printf("The value of the strtoull functions is : %llu\n\n", strtoull(aBigIntegerAsString, NULL, 0)); + printf("The value of the strtoll functions is : %lli\n\n", strtoll(aBigIntegerAsString, NULL, 0)); + NSLog(@"And now, the NSNumber again, but this time asking for the unsigned value : %llu", [[MCPNumber numberWithUnsignedLongLong:strtoull(aBigIntegerAsString, NULL, 0)] unsignedLongLongValue]); connection = [[MCPConnection alloc] initToHost:@"localhost" withLogin:@"ObjC" password:@"MySQL_class" usingPort:0]; [connection selectDB:@"test_mysqlclass"]; *************** *** 96,100 **** connect2 = [[MCPConnection alloc] init]; [connect2 setConnectionOption:CLIENT_SSL toValue:YES]; ! [connect2 connectWithLogin:@"ObjC" password:@"MySQL_class" host:@"localhost" port:0 socket:nil]; [connect2 selectDB:@"test_mysqlclass"]; result = [connect2 listTables]; --- 102,107 ---- connect2 = [[MCPConnection alloc] init]; [connect2 setConnectionOption:CLIENT_SSL toValue:YES]; ! // [connect2 connectWithLogin:@"ObjC" password:@"MySQL_class" host:@"localhost" port:0 socket:nil]; ! [connect2 connectWithLogin:@"ObjC" password:@"MySQL_class" host:@"balsa.local" port:3306 socket:nil]; [connect2 selectDB:@"test_mysqlclass"]; result = [connect2 listTables]; *************** *** 104,107 **** --- 111,115 ---- NSLog (@"Here comes the last error information : %@\n", [connect2 getLastErrorMessage]); //*/ + [connect2 release]; [pool release]; return 0; |