|
|
Sponsor |
Re: SQLForeignKeys result-set question: msg#00011db.mysql.odbc
Martin J. Evans wrote: On 06-Nov-2005 jbonnett@xxxxxxxxxxx wrote:Martin asked me to take a look at this. The attached patch should do the trick. The problem as far as I can see is the primary and foreign column information comes from the line InnoDB free: 11264 kB; (`type`) REFER `martin/eventtype`(`eventtype_id`); (`mark And I think the driver just needs to remove the quotes. -- Nick Gorham Easysoft Limited diff -r -u mysql-connector-odbc-3.51.12/driver/catalog.c mysql-connector-odbc-3.51.12a/driver/catalog.c --- mysql-connector-odbc-3.51.12/driver/catalog.c 2005-10-09 20:33:40.000000000 +0100 +++ mysql-connector-odbc-3.51.12a/driver/catalog.c 2005-11-08 11:02:38.000000000 +0000 @@ -1978,9 +1978,27 @@ { /* Multiple columns exists .. parse them to individual rows */ char **prev_data= data; - data[7]= strdup_root(alloc,ref_token); /* FKTABLE_COLUMN */ + /* + * remove quote chars + */ + if ( ref_token[ 0 ] == '`' ) + { + data[7]= strdup_root(alloc,ref_token+1); /* FKTABLE_COLUMN */ + data[7][strlen(data[7])-1 ] = '\0'; + } + else { + data[7]= strdup_root(alloc,ref_token); /* FKTABLE_COLUMN */ + } pktoken= my_next_token(pktoken,&pkcomment,ref_token,' '); - data[3]= strdup_root(alloc,ref_token); /* PKTABLE_COLUMN */ + if ( ref_token[ 0 ] == '`' ) + { + data[3]= strdup_root(alloc,ref_token+1); /* FKTABLE_COLUMN */ + data[3][strlen(data[3])-1 ] = '\0'; + } + else + { + data[3]= strdup_root(alloc,ref_token); /* PKTABLE_COLUMN */ + } sprintf(ref_token,"%d",key_seq++); data[8]= strdup_root(alloc,ref_token); /* KEY_SEQ */ data+= SQLFORE_KEYS_FIELDS; @@ -1988,8 +2006,25 @@ for ( fk_length= SQLFORE_KEYS_FIELDS; fk_length--; ) data[fk_length]= prev_data[fk_length]; } - data[7]= strdup_root(alloc,fkcomment); /* FKTABLE_COLUMN */ - data[3]= strdup_root(alloc,pkcomment); /* PKTABLE_COLUMN */ + /* + * remove quote chars + */ + if ( fkcomment[ 0 ] == '`' ) + { + data[7]= strdup_root(alloc,fkcomment+1); /* FKTABLE_COLUMN */ + data[7][strlen(data[7])-1 ] = '\0'; + } + else { + data[7]= strdup_root(alloc,fkcomment); /* FKTABLE_COLUMN */ + } + if ( pkcomment[ 0 ] == '`' ) + { + data[3]= strdup_root(alloc,pkcomment+1); /* PKTABLE_COLUMN */ + data[3][strlen(data[3])-1 ] = '\0'; + } + else { + data[3]= strdup_root(alloc,pkcomment); /* PKTABLE_COLUMN */ + } sprintf(ref_token,"%d",key_seq); data[8]= strdup_root(alloc,ref_token); /* KEY_SEQ */ -- MySQL ODBC Mailing List For list archives: http://lists.mysql.com/myodbc To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@xxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE Stored Procedures Triggers Views, Ryan deMelo |
|---|---|
| Next by Date: | Re: MyODBC 3.5.12 and Stored Procedures, Peter Harvey |
| Previous by Thread: | RE: SQLForeignKeys result-set question, Martin J. Evans |
| Next by Thread: | Regression in MyODBC 3.51.12, ddi |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home | sitemap
| advertise | OSDir is
an inevitable website.
|