diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2014-11-08 13:35:03 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2014-11-08 13:35:03 +0100 |
commit | bd4814328c0de8bec2d17f8f1f776e18115dd567 (patch) | |
tree | e7431c43384a7a335cec6cfa8dcc83343c081177 /storage/connect | |
parent | 1f9259dfea44fb2605b919d6b3b7ea9f151ed5ed (diff) | |
download | mariadb-git-bd4814328c0de8bec2d17f8f1f776e18115dd567.tar.gz |
- Calculate next position in filamap without assuming ENDING option is true.
modified:
storage/connect/filamap.cpp
- ftell error: indicate in the error msg that is can be due to wrong ENDING value.
filamtxt.cpp (MDEV-7030)
modified:
storage/connect/filamtxt.cpp
- Change STRING according to Alexander Barkov remarks.
Suppress the wrong Strz function. The unconditional function strz is no more
used for s->db and s->table_name because they are zero terminated.
modified:
storage/connect/ha_connect.cc
storage/connect/xobject.cpp
- Change version number
modified:
storage/connect/filamap.cpp
- Change PATH_MAX to FN_REFLEN (MDEV-7036)
modified:
storage/connect/os.h
storage/connect/tabmul.cpp
- Fix bug by adding a void argument for OP_NOT in Makefilter.
modified:
storage/connect/filter.cpp
- Begin implementing XMSG style
Two new system variables are defined:
msg_lang ENUM session
errmsg_dir_path STR global readonly
This is a work in progress.
modified:
storage/connect/ha_connect.cc
storage/connect/plgdbutl.cpp
storage/connect/plugutil.c
storage/connect/rcmsg.c
storage/connect/resource.h
Diffstat (limited to 'storage/connect')
-rw-r--r-- | storage/connect/filamap.cpp | 7 | ||||
-rw-r--r-- | storage/connect/filamtxt.cpp | 1 | ||||
-rw-r--r-- | storage/connect/filter.cpp | 2 | ||||
-rw-r--r-- | storage/connect/ha_connect.cc | 136 | ||||
-rw-r--r-- | storage/connect/os.h | 8 | ||||
-rw-r--r-- | storage/connect/plgdbutl.cpp | 9 | ||||
-rw-r--r-- | storage/connect/plugutil.c | 8 | ||||
-rw-r--r-- | storage/connect/rcmsg.c | 26 | ||||
-rw-r--r-- | storage/connect/resource.h | 8 | ||||
-rwxr-xr-x | storage/connect/tabmul.cpp | 2 | ||||
-rw-r--r-- | storage/connect/xobject.cpp | 2 |
11 files changed, 123 insertions, 86 deletions
diff --git a/storage/connect/filamap.cpp b/storage/connect/filamap.cpp index 8abe6cedd07..08f87e2b836 100644 --- a/storage/connect/filamap.cpp +++ b/storage/connect/filamap.cpp @@ -358,7 +358,12 @@ int MAPFAM::ReadBuffer(PGLOBAL g) while (*Mempos++ != '\n') ; // What about Unix ??? // Set caller line buffer - len = (Mempos - Fpos) - Ending; + len = (Mempos - Fpos) - 1; + + // Don't rely on ENDING setting + if (len > 0 && *(Mempos - 2) == '\r') + len--; // Line ends by CRLF + memcpy(Tdbp->GetLine(), Fpos, len); Tdbp->GetLine()[len] = '\0'; return RC_OK; diff --git a/storage/connect/filamtxt.cpp b/storage/connect/filamtxt.cpp index ffe4c92d251..a1bcc464e06 100644 --- a/storage/connect/filamtxt.cpp +++ b/storage/connect/filamtxt.cpp @@ -683,6 +683,7 @@ bool DOSFAM::RecordPos(PGLOBAL g) { if ((Fpos = ftell(Stream)) < 0) { sprintf(g->Message, MSG(FTELL_ERROR), 0, strerror(errno)); + strcat(g->Message, " (possible wrong ENDING option value)"); return true; } // endif Fpos diff --git a/storage/connect/filter.cpp b/storage/connect/filter.cpp index 6bdd175a662..949d49c2943 100644 --- a/storage/connect/filter.cpp +++ b/storage/connect/filter.cpp @@ -101,7 +101,7 @@ PFIL MakeFilter(PGLOBAL g, PFIL fp1, OPVAL vop, PFIL fp2) PFIL filp = new(g) FILTER(g, vop); filp->Arg(0) = fp1; - filp->Arg(1) = fp2; + filp->Arg(1) = (fp2) ? fp2 : pXVOID; if (filp->Convert(g, false)) return NULL; diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 60d02cacf9e..3aea9e13ac5 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,8 +170,8 @@ #define SZWMIN 4194304 // Minimum work area size 4M extern "C" { - char version[]= "Version 1.03.0004 October 13, 2014"; - char compver[]= "Version 1.03.0004 " __DATE__ " " __TIME__; + char version[]= "Version 1.03.0005 November 08, 2014"; + char compver[]= "Version 1.03.0005 " __DATE__ " " __TIME__; #if defined(WIN32) char slash= '\\'; @@ -179,9 +179,6 @@ extern "C" { char slash= '/'; #endif // !WIN32 -#if defined(XMSG) - char msglang[]; // Default message language -#endif // int trace= 0; // The general trace value int xconv= 0; // The type conversion option int zconv= SZCONV; // The text conversion size @@ -202,6 +199,11 @@ static ulong type_conv= 0; #if defined(XMAP) static my_bool indx_map= 0; #endif // XMAP +#if defined(XMSG) +extern "C" { + char *msg_path; +} // extern "C" +#endif // XMSG /***********************************************************************/ /* Utility functions. */ @@ -278,12 +280,40 @@ static MYSQL_THDVAR_ENUM( 1, // def (AUTO) &usetemp_typelib); // typelib +#if defined(XMSG) +const char *language_names[]= +{ + "default", "english", "french", NullS +}; + +TYPELIB language_typelib= +{ + array_elements(language_names) - 1, "language_typelib", + language_names, NULL +}; + +static MYSQL_THDVAR_ENUM( + msg_lang, // name + PLUGIN_VAR_RQCMDARG, // opt + "Message language", // comment + NULL, // check + NULL, // update + 1, // def (ENGLISH) + &language_typelib); // typelib +#endif // XMSG + /***********************************************************************/ /* Function to export session variable values to other source files. */ /***********************************************************************/ extern "C" int GetTraceValue(void) {return THDVAR(current_thd, xtrace);} bool ExactInfo(void) {return THDVAR(current_thd, exact_info);} USETEMP UseTemp(void) {return (USETEMP)THDVAR(current_thd, use_tempfile);} +#if defined(XMSG) +extern "C" const char *msglang(void) +{ + return language_names[THDVAR(current_thd, msg_lang)]; +} // end of msglang +#endif // XMSG /***********************************************************************/ /* Global variables update functions. */ @@ -912,15 +942,6 @@ char *ha_connect::GetRealString(const char *s) return sv; } // end of GetRealString -inline char *ha_connect::Strz(LEX_STRING &ls) -{ - if (unlikely(ls.str && ls.str[ls.length])) - return strz(xp->g, ls); - else - return ls.str; - -} // end of Strz - /****************************************************************************/ /* Return the value of a string option or NULL if not specified. */ /****************************************************************************/ @@ -934,7 +955,7 @@ char *ha_connect::GetStringOption(char *opname, char *sdef) : table->s->connect_string; if (cnc.length) - opval= GetRealString(Strz(cnc)); + opval= GetRealString(strz(xp->g, cnc)); } else if (!stricmp(opname, "Query_String")) opval= thd_query_string(table->in_use)->str; @@ -1274,13 +1295,9 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) pcf->Key= 0; // Not used when called from MySQL // Get the comment if any - if (fp->comment.str && fp->comment.length) { - if ((pcf->Remark= (char*)PlgDBSubAlloc(g, NULL, fp->comment.length + 1))) { - memcpy(pcf->Remark, fp->comment.str, fp->comment.length); - pcf->Remark[fp->comment.length]= 0; - } // endif Remark - - } else + if (fp->comment.str && fp->comment.length) + pcf->Remark= strz(g, fp->comment); + else pcf->Remark= NULL; return fldp; @@ -1309,7 +1326,7 @@ bool ha_connect::GetIndexOption(KEY *kp, char *opname) opval= options->mapped; } else if (kp->comment.str && kp->comment.length) { - char *pv, *oplist= Strz(kp->comment); + char *pv, *oplist= strz(xp->g, kp->comment); if ((pv= GetListOption(xp->g, opname, oplist))) opval= (!*pv || *pv == 'y' || *pv == 'Y' || atoi(pv) != 0); @@ -1455,12 +1472,12 @@ bool ha_connect::IsPartitioned(void) const char *ha_connect::GetDBName(const char* name) { - return (name) ? name : Strz(table->s->db); + return (name) ? name : table->s->db.str; } // end of GetDBName const char *ha_connect::GetTableName(void) { - return Strz(tshp ? tshp->table_name : table_share->table_name); + return tshp ? tshp->table_name.str : table_share->table_name.str; } // end of GetTableName char *ha_connect::GetPartName(void) @@ -3575,7 +3592,7 @@ int ha_connect::info(uint flag) // This is necessary for getting file length if (table) - SetDataPath(g, Strz(table->s->db)); + SetDataPath(g, table->s->db.str); else DBUG_RETURN(HA_ERR_INTERNAL_ERROR); // Should never happen @@ -4140,7 +4157,7 @@ int ha_connect::external_lock(THD *thd, int lock_type) DBUG_ASSERT(table && table->s); - if (check_privileges(thd, options, Strz(table->s->db))) { + if (check_privileges(thd, options, table->s->db.str)) { strcpy(g->Message, "This operation requires the FILE privilege"); htrc("%s\n", g->Message); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); @@ -4675,15 +4692,6 @@ static int init_table_share(THD* thd, sql->ptr(), sql->length()); } // end of init_table_share -static inline char *Strz(PGLOBAL g, LEX_STRING &ls) -{ - if (unlikely(ls.str && ls.str[ls.length])) - return strz(g, ls); - else - return ls.str; - -} // end of Strz - // Used to check whether a MYSQL table is created on itself bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, const char *host, const char *db, char *tab, const char *src, int port) @@ -4692,9 +4700,9 @@ bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, const char *host, return false; else if (host && stricmp(host, "localhost") && strcmp(host, "127.0.0.1")) return false; - else if (db && stricmp(db, Strz(g, s->db))) + else if (db && stricmp(db, s->db.str)) return false; - else if (tab && stricmp(tab, Strz(g, s->table_name))) + else if (tab && stricmp(tab, s->table_name.str)) return false; else if (port && port != (signed)GetDefaultPort()) return false; @@ -4799,7 +4807,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, } // endif option_list if (!(shm= (char*)db)) - db= Strz(g, table_s->db); // Default value + db= table_s->db.str; // Default value // Check table type if (ttp == TAB_UNDEF) { @@ -4849,7 +4857,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, } // endif p } else if (ttp != TAB_ODBC || !(fnc & (FNC_TABLE | FNC_COL))) - tab= Strz(g, table_s->table_name); // Default value + tab= table_s->table_name.str; // Default value #if defined(NEW_WAY) // add_option(thd, create_info, "tabname", tab); @@ -4859,7 +4867,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, switch (ttp) { #if defined(ODBC_SUPPORT) case TAB_ODBC: - dsn= Strz(g, create_info->connect_string); + dsn= strz(g, create_info->connect_string); if (fnc & (FNC_DSN | FNC_DRIVER)) { ok= true; @@ -4894,13 +4902,11 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, case TAB_MYSQL: ok= true; - if (create_info->connect_string.str) { - int len= create_info->connect_string.length; + if (create_info->connect_string.str && + create_info->connect_string.length) { PMYDEF mydef= new(g) MYSQLDEF(); - dsn= (char*)PlugSubAlloc(g, NULL, len + 1); - strncpy(dsn, create_info->connect_string.str, len); - dsn[len]= 0; + dsn= strz(g, create_info->connect_string); mydef->SetName(create_info->alias); if (!mydef->ParseURL(g, dsn, false)) { @@ -4945,7 +4951,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, case TAB_XCL: case TAB_OCCUR: if (!src && !stricmp(tab, create_info->alias) && - (!db || !stricmp(db, Strz(g, table_s->db)))) + (!db || !stricmp(db, table_s->db.str))) sprintf(g->Message, "A %s table cannot refer to itself", topt->type); else ok= true; @@ -4983,11 +4989,11 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, int i, len, prec, dec, typ, flg; // if (cat) -// cat->SetDataPath(g, Strz(g, table_s->db)); +// cat->SetDataPath(g, table_s->db.str); // else // return HA_ERR_INTERNAL_ERROR; // Should never happen - dpath= SetPath(g, Strz(g, table_s->db)); + dpath= SetPath(g, table_s->db.str); if (src && ttp != TAB_PIVOT && ttp != TAB_ODBC) { qrp= SrcColumns(g, host, db, user, pwd, src, port); @@ -5380,7 +5386,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, } else if (options->tabname) { if (!stricmp(options->tabname, create_info->alias) && (!options->dbname || - !stricmp(options->dbname, Strz(table_arg->s->db)))) { + !stricmp(options->dbname, table_arg->s->db.str))) { sprintf(g->Message, "A %s table cannot refer to itself", options->type); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); @@ -5405,14 +5411,11 @@ int ha_connect::create(const char *name, TABLE *table_arg, db= GetStringOption("database", NULL); port= atoi(GetListOption(g, "port", options->oplist, "0")); - if (create_info->connect_string.str) { - char *dsn; - int len= create_info->connect_string.length; + if (create_info->connect_string.str && + create_info->connect_string.length) { + char *dsn= strz(g, create_info->connect_string); PMYDEF mydef= new(g) MYSQLDEF(); - dsn= (char*)PlugSubAlloc(g, NULL, len + 1); - strncpy(dsn, create_info->connect_string.str, len); - dsn[len]= 0; mydef->SetName(create_info->alias); if (!mydef->ParseURL(g, dsn, false)) { @@ -5650,7 +5653,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, if (sqlcom == SQLCOM_CREATE_TABLE) push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message); - strcat(strcat(strcpy(dbpath, "./"), Strz(table->s->db)), "/"); + strcat(strcat(strcpy(dbpath, "./"), table->s->db.str), "/"); #if defined(WITH_PARTITION_STORAGE_ENGINE) } // endif part_info #endif // WITH_PARTITION_STORAGE_ENGINE @@ -5724,10 +5727,10 @@ int ha_connect::create(const char *name, TABLE *table_arg, PDBUSER dup= PlgGetUser(g); PCATLG cat= (dup) ? dup->Catalog : NULL; - SetDataPath(g, Strz(table_arg->s->db)); + SetDataPath(g, table_arg->s->db.str); if (cat) { -// cat->SetDataPath(g, Strz(table_arg->s->db)); +// cat->SetDataPath(g, table_arg->s->db.str); #if defined(WITH_PARTITION_STORAGE_ENGINE) if (part_info) @@ -5807,7 +5810,7 @@ bool ha_connect::FileExists(const char *fn, bool bf) } else strcpy(tfn, fn); - strcat(strcat(strcat(strcpy(path, "."), s), Strz(table->s->db)), s); + strcat(strcat(strcat(strcpy(path, "."), s), table->s->db.str), s); PlugSetPath(filename, tfn, path); n= stat(filename, &info); @@ -6291,6 +6294,13 @@ static MYSQL_SYSVAR_BOOL(indx_map, indx_map, PLUGIN_VAR_RQCMDARG, NULL, update_connect_xmap, 0); #endif // XMAP +#if defined(XMSG) +static MYSQL_SYSVAR_STR(errmsg_dir_path, msg_path, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Path to the directory where are the message files", + NULL, NULL, ""); +#endif // XMSG + // Size used for g->Sarea_Size static MYSQL_SYSVAR_UINT(work_size, work_size, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, @@ -6307,6 +6317,10 @@ static struct st_mysql_sys_var* connect_system_variables[]= { MYSQL_SYSVAR(work_size), MYSQL_SYSVAR(use_tempfile), MYSQL_SYSVAR(exact_info), +#if defined(XMSG) + MYSQL_SYSVAR(msg_lang), + MYSQL_SYSVAR(errmsg_dir_path), +#endif // XMSG NULL }; @@ -6323,7 +6337,7 @@ maria_declare_plugin(connect) 0x0103, /* version number (1.03) */ NULL, /* status variables */ connect_system_variables, /* system variables */ - "1.03", /* string version */ + "1.03.0005", /* string version */ MariaDB_PLUGIN_MATURITY_BETA /* maturity */ } maria_declare_plugin_end; diff --git a/storage/connect/os.h b/storage/connect/os.h index 8e94f4241bb..8f77a0ad39f 100644 --- a/storage/connect/os.h +++ b/storage/connect/os.h @@ -53,12 +53,12 @@ typedef int HANDLE; #ifdef PATH_MAX #define _MAX_PATH PATH_MAX #else -#define _MAX_PATH 260 +#define _MAX_PATH FN_REFLEN #endif #define _MAX_DRIVE 3 -#define _MAX_DIR 256 -#define _MAX_FNAME 256 -#define _MAX_EXT 256 +#define _MAX_DIR FN_REFLEN +#define _MAX_FNAME FN_HEADLEN +#define _MAX_EXT FN_EXTLEN #define INVALID_HANDLE_VALUE (-1) #define __stdcall #endif /* !WIN32 */ diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp index 47062726305..ccfc1a348b7 100644 --- a/storage/connect/plgdbutl.cpp +++ b/storage/connect/plgdbutl.cpp @@ -87,9 +87,6 @@ bool Initdone = false; bool plugin = false; // True when called by the XDB plugin handler extern "C" { -#if defined(XMSG) - char msglang[16] = "ENGLISH"; // Default language -#endif extern char version[]; } // extern "C" @@ -136,10 +133,12 @@ global_open_error_msg(GLOBAL *g, int msgid, const char *path, const char *mode) break; case MSGID_OPEN_MODE_STRERROR: + {char fmt[256]; + strcat(strcpy(fmt, MSG(OPEN_MODE_ERROR)), ": %s"); len= snprintf(g->Message, sizeof(g->Message) - 1, - MSG(OPEN_MODE_ERROR) ": %s", // Open(%s) error %d on %s: %s + fmt, // Open(%s) error %d on %s: %s mode, (int) errno, path, strerror(errno)); - break; + }break; case MSGID_OPEN_STRERROR: len= snprintf(g->Message, sizeof(g->Message) - 1, diff --git a/storage/connect/plugutil.c b/storage/connect/plugutil.c index 1bed67d402f..b195058f720 100644 --- a/storage/connect/plugutil.c +++ b/storage/connect/plugutil.c @@ -82,7 +82,8 @@ extern HINSTANCE s_hModule; /* Saved module handle */ #endif // WIN32 #if defined(XMSG) -extern char msglang[]; +extern char *msg_path; +char *msglang(void); #endif // XMSG /***********************************************************************/ @@ -326,8 +327,9 @@ char *PlugReadMessage(PGLOBAL g, int mid, char *m) char *msg; FILE *mfile = NULL; - GetPrivateProfileString("Message", msglang, "Message\\english.msg", - msgfile, _MAX_PATH, plgini); +//GetPrivateProfileString("Message", msglang, "Message\\english.msg", +// msgfile, _MAX_PATH, plgini); + strcat(strcat(strcpy(msgfile, msg_path), msglang()), ".msg"); if (!(mfile = fopen(msgfile, "rt"))) { sprintf(stmsg, "Fail to open message file %s for %s", msgfile, msglang); diff --git a/storage/connect/rcmsg.c b/storage/connect/rcmsg.c index bac420e696f..5b6955de4d3 100644 --- a/storage/connect/rcmsg.c +++ b/storage/connect/rcmsg.c @@ -21,23 +21,23 @@ char *GetMsgid(int id) char *p = NULL; switch (id) { - case IDS_00: p = "%s"; break; +// case IDS_00: p = "%s"; break; #if defined(FRENCH) case IDS_01: p = "%s: erreur d'allocation du buffer de communication de %d octets"; break; case IDS_02: p = "%s: erreur d'allocation mémoire tampon pour %d colonnes"; break; - case IDS_03: p = "%s: Commande spéciale invalide"; break; + case IDS_03: p = "%s: Commande spéciale invalide"; break; case IDS_04: p = "%s: Wrong number of arguments %d"; break; - case IDS_05: p = "%s"; break; + case IDS_05: p = "%s"; break; case IDS_06: p = "%s: Commande dépassant la taille du buffer interne (%d octets)"; break; case IDS_07: p = "%s: Données (%d octets) tronquées à la taille du buffer"; break; case IDS_08: p = "%s: Résultat dépassant la taille du buffer interne (%d octets)"; break; - case IDS_09: p = "Erreur dans %s: %s"; break; + case IDS_09: p = "Erreur dans %s: %s"; break; case IDS_10: p = "%s: erreur d'allocating mémoire de %d octets"; break; case IDS_11: p = "%s: mauvaise clé de connexion %d"; break; case IDS_12: p = "%s: Pas plus de %d connexions autorisées pour un programme"; break; case IDS_13: p = "%s: clé de connexion invalide %d"; break; case IDS_14: p = "SafeDB: %s rc=%d"; break; - case IDS_15: p = "Mauvaise Dll de communication appelée par le moteur %s"; break; + case IDS_15: p = "Mauvaise Dll de communication appelée par le moteur %s"; break; case IDS_TAB_01: p = "Catalogue"; break; case IDS_TAB_02: p = "Schéma"; break; case IDS_TAB_03: p = "Nom"; break; @@ -115,21 +115,23 @@ char *GetMsgid(int id) case IDS_DSC_01: p = "Nom"; break; case IDS_DSC_02: p = "Description"; break; #else // English +#if 0 case IDS_01: p = "%s: error allocating communication buffer of %d bytes"; break; case IDS_02: p = "%s: error allocating parser memory for %d columns"; break; - case IDS_03: p = "%s: Invalid special command"; break; + case IDS_03: p = "%s: Invalid special command"; break; case IDS_04: p = "%s: Wrong number of arguments %d"; break; - case IDS_05: p = "%s"; break; + case IDS_05: p = "%s"; break; case IDS_06: p = "%s: Command bigger than internal buffer of size = %d"; break; case IDS_07: p = "%s: Data truncated to buffer size, actual length is %d bytes"; break; case IDS_08: p = "%s: Result bigger than internal buffer of size = %d"; break; - case IDS_09: p = "Error in %s: %s"; break; + case IDS_09: p = "Error in %s: %s"; break; case IDS_10: p = "%s: error allocating instance memory of %d bytes"; break; case IDS_11: p = "%s: wrong connection key value %d"; break; case IDS_12: p = "%s: No more than %d connections allowed from one process"; break; case IDS_13: p = "%s: invalid connection key value %d"; break; case IDS_14: p = "SafeDB: %s rc=%d"; break; - case IDS_15: p = "Wrong communication Dll called for engine %s"; break; + case IDS_15: p = "Wrong communication Dll called for engine %s"; break; +#endif // 0 case IDS_TAB_01: p = "Table_Cat"; break; case IDS_TAB_02: p = "Table_Schema"; break; case IDS_TAB_03: p = "Table_Name"; break; @@ -147,6 +149,7 @@ char *GetMsgid(int id) case IDS_COL_10: p = "Radix"; break; case IDS_COL_11: p = "Nullable"; break; case IDS_COL_12: p = "Remarks"; break; +#if 0 case IDS_INF_01: p = "Type_Name"; break; case IDS_INF_02: p = "Data_Type"; break; case IDS_INF_03: p = "Precision"; break; @@ -162,12 +165,14 @@ char *GetMsgid(int id) case IDS_INF_13: p = "Local_Type_Name"; break; case IDS_INF_14: p = "Minimum_Scale"; break; case IDS_INF_15: p = "Maximum_Scale"; break; +#endif // 0 case IDS_PKY_01: p = "Table_Catalog"; break; case IDS_PKY_02: p = "Table_Schema"; break; case IDS_PKY_03: p = "Table_Name"; break; case IDS_PKY_04: p = "Column_Name"; break; case IDS_PKY_05: p = "Key_Seq"; break; case IDS_PKY_06: p = "Pk_Name"; break; +#if 0 case IDS_FKY_01: p = "PKTable_Catalog"; break; case IDS_FKY_02: p = "PKTable_Schema"; break; case IDS_FKY_03: p = "PKTable_Name"; break; @@ -181,6 +186,7 @@ char *GetMsgid(int id) case IDS_FKY_11: p = "Delete_Rule"; break; case IDS_FKY_12: p = "FK_Name"; break; case IDS_FKY_13: p = "PK_Name"; break; +#endif // 0 case IDS_STA_01: p = "Table_Catalog"; break; case IDS_STA_02: p = "Table_Schema"; break; case IDS_STA_03: p = "Table_Name"; break; @@ -194,6 +200,7 @@ char *GetMsgid(int id) case IDS_STA_11: p = "Cardinality"; break; case IDS_STA_12: p = "Pages"; break; case IDS_STA_13: p = "Filter_Condition"; break; +#if 0 case IDS_SPC_01: p = "Scope"; break; case IDS_SPC_02: p = "Column_Name"; break; case IDS_SPC_03: p = "Data_Type"; break; @@ -202,6 +209,7 @@ char *GetMsgid(int id) case IDS_SPC_06: p = "Length"; break; case IDS_SPC_07: p = "Scale"; break; case IDS_SPC_08: p = "Pseudo_Column"; break; +#endif // 0 case IDS_DRV_01: p = "Description"; break; case IDS_DRV_02: p = "Attributes"; break; case IDS_DSC_01: p = "Name"; break; diff --git a/storage/connect/resource.h b/storage/connect/resource.h index 773942cf280..8562224d403 100644 --- a/storage/connect/resource.h +++ b/storage/connect/resource.h @@ -2,6 +2,7 @@ // Microsoft Developer Studio generated include file. // Used by PlgSock.rc // +#if 0 #define IDS_00 115 #define IDS_01 116 #define IDS_02 117 @@ -24,6 +25,7 @@ #define IDS_19 134 #define IDS_20 135 #define IDS_21 136 +#endif // 0 #define IDS_TABLES 143 #define IDS_TAB_01 144 #define IDS_TAB_02 145 @@ -43,6 +45,7 @@ #define IDS_COL_10 169 #define IDS_COL_11 170 #define IDS_COL_12 171 +#if 0 #define IDS_INFO 175 #define IDS_INF_01 176 #define IDS_INF_02 177 @@ -59,6 +62,7 @@ #define IDS_INF_13 188 #define IDS_INF_14 189 #define IDS_INF_15 190 +#endif // 0 #define IDS_PKEY 191 #define IDS_PKY_01 192 #define IDS_PKY_02 193 @@ -66,6 +70,7 @@ #define IDS_PKY_04 195 #define IDS_PKY_05 196 #define IDS_PKY_06 197 +#if 0 #define IDS_FKEY 207 #define IDS_FKY_01 208 #define IDS_FKY_02 209 @@ -80,6 +85,7 @@ #define IDS_FKY_11 218 #define IDS_FKY_12 219 #define IDS_FKY_13 220 +#endif // 0 #define IDS_STAT 223 #define IDS_STA_01 224 #define IDS_STA_02 225 @@ -94,6 +100,7 @@ #define IDS_STA_11 234 #define IDS_STA_12 235 #define IDS_STA_13 236 +#if 0 #define IDS_SPCOLS 1247 #define IDS_SPC_01 1248 #define IDS_SPC_02 1249 @@ -118,6 +125,7 @@ #define IDS_PLG_07 1286 #define IDS_PLG_08 1287 #define IDS_PLG_09 1288 +#endif // 0 #define IDS_DRIVER 1290 #define IDS_DRV_01 1291 #define IDS_DRV_02 1292 diff --git a/storage/connect/tabmul.cpp b/storage/connect/tabmul.cpp index 86d4deb60f3..f1cad71044f 100755 --- a/storage/connect/tabmul.cpp +++ b/storage/connect/tabmul.cpp @@ -197,7 +197,7 @@ bool TDBMUL::InitFileNames(PGLOBAL g) #else // !WIN32 struct stat fileinfo; - char fn[PATH_MAX], direc[PATH_MAX], pattern[256], ftype[8]; + char fn[FN_REFLEN], direc[C], pattern[256], ftype[8]; DIR *dir; struct dirent *entry; diff --git a/storage/connect/xobject.cpp b/storage/connect/xobject.cpp index 202ee4adb12..4ddd4f5b30f 100644 --- a/storage/connect/xobject.cpp +++ b/storage/connect/xobject.cpp @@ -272,7 +272,7 @@ bool STRING::Set(char *s, uint n) if (!s) return false; - uint len = MY_MIN(strlen(s), n) + 1; + uint len = strnlen(s, n) + 1; if (len > Size) { char *p = Realloc(len); |