From 6f8253e66be9dac0c3c96e16d9f97fda3fc7e818 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 9 Jun 2009 22:19:15 +0000 Subject: =?UTF-8?q?=E2=80=A2=20introduced=20the=20method=20(NSArray=20*)fe?= =?UTF-8?q?tchResultFieldsStructure=20to=20CMMCPResult=20-=20it=20returns?= =?UTF-8?q?=20an=20array=20of=20dicts=20containing=20general=20information?= =?UTF-8?q?=20about=20each=20field=20of=20the=20result=20array=20of=20the?= =?UTF-8?q?=20last=20executed=20query=20dict=20example=20so=20far=20for:?= =?UTF-8?q?=20SELECT=20ucs=5Fcomp=20AS=20co=20FROM=20comp=5Fucs3=20AS=20co?= =?UTF-8?q?=5Ftable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AUTO_INCREMENT_FLAG = 0; BINARY_FLAG = 0; BLOB_FLAG = 0; ENUM_FLAG = 0; MULTIPLE_KEY_FLAG = 1; NOT_NULL_FLAG = 0; NUM_FLAG = 0; PART_KEY_FLAG = 1; PRI_KEY_FLAG = 0; SET_FLAG = 0; UNIQUE_KEY_FLAG = 0; UNSIGNED_FLAG = 0; ZEROFILL_FLAG = 0; byte_length = 30; char_length = 10; charset_collation = utf8_general_ci; charset_name = utf8; charsetnr = 33; db = test; decimals = 0; flags = 16392; max_byte_length = 4; max_char_length = 1; name = co; org_name = ucs_comp; org_table = comp_ucs3; table = co_table; type = VARCHAR; typegrouping = string; Hint: To test that new method one can add the following code after the execution of a mysql query: NSArray *fStruct = [NSArray arrayWithArray:[theResult fetchResultFieldsStructure]]; --- Source/CMMCPResult.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'Source/CMMCPResult.h') diff --git a/Source/CMMCPResult.h b/Source/CMMCPResult.h index 68f7061a..e6c99fde 100644 --- a/Source/CMMCPResult.h +++ b/Source/CMMCPResult.h @@ -26,10 +26,29 @@ #import #import -#define FIELD_TYPE_BIT 16 +#define FIELD_TYPE_BIT 16 +#define MAGIC_BINARY_CHARSET_NR 63 @interface CMMCPResult : MCPResult +typedef struct st_our_charset +{ + unsigned int nr; + const char *name; + const char *collation; + unsigned int char_minlen; + unsigned int char_maxlen; +} OUR_CHARSET; + + - (id)fetchRowAsType:(MCPReturnType)aType; +- (NSArray *)fetchResultFieldsStructure; + + +- (NSString *)mysqlTypeToStringForType:(unsigned int)type withCharsetNr:(unsigned int)charsetnr withFlags:(unsigned int)flags withLength:(unsigned long long)length; +- (NSString *)mysqlTypeToGroupForType:(unsigned int)type withCharsetNr:(unsigned int)charsetnr withFlags:(unsigned int)flags; +- (NSString *)find_charsetName:(unsigned int)charsetnr; +- (NSString *)find_charsetCollation:(unsigned int)charsetnr; +- (unsigned int)find_charsetMaxByteLengthPerChar:(unsigned int)charsetnr; @end -- cgit v1.2.3