summaryrefslogtreecommitdiff
path: root/storage/connect
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2019-11-24 18:19:33 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2019-11-24 18:19:33 +0100
commitce49812ec5465539c2bf84fcdfddedc9d1cd52a0 (patch)
treedcfdf62ca00c5b2f35ddbd2a0243b1639305f0ee /storage/connect
parentafc21ab6d8e785299e0d9e5339b8c94a90b3355c (diff)
parenta14544260c33dcdb057d2f62c4aab33cb09ebcb1 (diff)
downloadmariadb-git-ce49812ec5465539c2bf84fcdfddedc9d1cd52a0.tar.gz
Commit conflict resolving after pulling from origin 10.3
Diffstat (limited to 'storage/connect')
-rw-r--r--storage/connect/CMakeLists.txt36
-rw-r--r--storage/connect/array.cpp4
-rw-r--r--storage/connect/connect.cc2
-rw-r--r--storage/connect/csort.cpp22
-rw-r--r--storage/connect/filter.h1
-rw-r--r--storage/connect/ha_connect.cc131
-rw-r--r--storage/connect/jdbconn.cpp11
-rw-r--r--storage/connect/mycat.cc4
-rw-r--r--storage/connect/myconn.cpp2
-rw-r--r--storage/connect/mysql-test/connect/disabled.def24
-rw-r--r--storage/connect/mysql-test/connect/r/grant.result174
-rw-r--r--storage/connect/mysql-test/connect/r/grant2.result258
-rw-r--r--storage/connect/mysql-test/connect/r/ini_grant.result26
-rw-r--r--storage/connect/mysql-test/connect/r/mysql_grant.result24
-rw-r--r--storage/connect/mysql-test/connect/r/xml2.result2
-rw-r--r--storage/connect/mysql-test/connect/r/xml2_grant.result30
-rw-r--r--storage/connect/mysql-test/connect/r/xml_grant.result30
-rw-r--r--storage/connect/mysql-test/connect/t/grant.inc30
-rw-r--r--storage/connect/mysql-test/connect/t/grant.test24
-rw-r--r--storage/connect/mysql-test/connect/t/grant2.test260
-rw-r--r--storage/connect/mysql-test/connect/t/ini_grant.test26
-rw-r--r--storage/connect/mysql-test/connect/t/mysql_grant.test24
-rw-r--r--storage/connect/odbconn.cpp2
-rw-r--r--storage/connect/rest.def4
-rw-r--r--storage/connect/tabodbc.cpp6
-rw-r--r--storage/connect/user_connect.cc2
-rw-r--r--storage/connect/user_connect.h2
-rw-r--r--storage/connect/valblk.cpp8
-rw-r--r--storage/connect/value.cpp583
-rw-r--r--storage/connect/xindex.cpp18
30 files changed, 899 insertions, 871 deletions
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
index 5c870be5ef6..0bb1576a0fa 100644
--- a/storage/connect/CMakeLists.txt
+++ b/storage/connect/CMakeLists.txt
@@ -340,6 +340,35 @@ IF(CONNECT_WITH_REST)
ENDIF(CONNECT_WITH_REST)
#
+# REST
+#
+
+OPTION(CONNECT_WITH_REST "Compile CONNECT storage engine with REST support" ON)
+
+IF(CONNECT_WITH_REST)
+ FIND_PACKAGE(cpprestsdk QUIET)
+ IF (cpprestsdk_FOUND)
+ IF(UNIX)
+# INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR})
+# If needed edit next line to set the path to libcpprest.so
+ SET(REST_LIBRARY -lcpprest)
+ MESSAGE (STATUS ${REST_LIBRARY})
+ ELSE(NOT UNIX)
+# Next line sets debug compile mode matching cpprest_2_10d.dll
+# when it was binary installed (can be change later in Visual Studio)
+# Comment it out if not needed depending on your cpprestsdk installation.
+ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
+ ENDIF(UNIX)
+ IF(REST_LIBRARY)
+ SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp restget.cpp tabrest.h)
+ add_definitions(-DREST_SUPPORT)
+ ENDIF()
+ ELSE(NOT cpprestsdk_FOUND)
+# MESSAGE(STATUS "=====> cpprestsdk package not found")
+ ENDIF (cpprestsdk_FOUND)
+ENDIF(CONNECT_WITH_REST)
+
+#
# XMAP
#
@@ -358,7 +387,7 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES}
COMPONENT connect-engine
RECOMPILE_FOR_EMBEDDED
LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY}
- ${ODBC_LIBRARY} ${JDBC_LIBRARY} ${MONGOC_LIBRARY} ${IPHLPAPI_LIBRARY})
+ ${ODBC_LIBRARY} ${JDBC_LIBRARY} ${MONGOC_LIBRARY} ${IPHLPAPI_LIBRARY} ${REST_LIBRARY})
IF(NOT TARGET connect)
RETURN()
@@ -374,8 +403,8 @@ ENDIF()
IF(WIN32)
IF (libmongoc-1.0_FOUND)
- SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
- "/DELAYLOAD:libbson-1.0.dll /DELAYLOAD:libmongoc-1.0.dll")
+ SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
+ "/DELAYLOAD:libbson-1.0.dll /DELAYLOAD:libmongoc-1.0.dll")
ENDIF(libmongoc-1.0_FOUND)
# Install some extra files that belong to connect engine
@@ -403,3 +432,4 @@ IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
${CMAKE_CURRENT_BINARY_DIR}/JdbcInterface.jar
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
ENDIF()
+
diff --git a/storage/connect/array.cpp b/storage/connect/array.cpp
index 3478342a788..84a686cc145 100644
--- a/storage/connect/array.cpp
+++ b/storage/connect/array.cpp
@@ -438,7 +438,7 @@ char *ARRAY::GetStringValue(int n)
/***********************************************************************/
bool ARRAY::Find(PVAL valp)
{
- register int n;
+ int n;
PVAL vp;
if (Type != valp->GetType()) {
@@ -1042,7 +1042,7 @@ MULAR::MULAR(PGLOBAL g, int n) : CSORT(false)
/***********************************************************************/
int MULAR::Qcompare(int *i1, int *i2)
{
- register int i, n = 0;
+ int i, n = 0;
for (i = 0; i < Narray; i++)
if ((n = Pars[i]->Qcompare(i1, i2)))
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index a8d9216983a..461391d2896 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -16,7 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
/***********************************************************************/
-/* Author Olivier BERTRAND bertrandop@gmail.com 2004-2017 */
+/* Author Olivier BERTRAND bertrandop@gmail.com 2004-2019 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
diff --git a/storage/connect/csort.cpp b/storage/connect/csort.cpp
index 670131b8fd2..1e4ba674e23 100644
--- a/storage/connect/csort.cpp
+++ b/storage/connect/csort.cpp
@@ -178,9 +178,9 @@ void CSORT::DebugSort(int ph, int n, int *base, int *mid, int *tmp)
/***********************************************************************/
int CSORT::Qsortx(void)
{
- register int c;
- register int lo, hi, min;
- register int i, j, rc = 0;
+ int c;
+ int lo, hi, min;
+ int i, j, rc = 0;
// To do: rc should be checked for being used uninitialized
int *top;
#ifdef DEBTRACE
@@ -344,7 +344,7 @@ int CSORT::Qsortx(void)
/***********************************************************************/
void CSORT::Qstx(int *base, int *max)
{
- register int *i, *j, *jj, *mid, *him, c;
+ int *i, *j, *jj, *mid, *him, c;
int *tmp;
int lo, hi, rc;
size_t zlo, zhi, cnm;
@@ -543,9 +543,9 @@ void CSORT::Qstx(int *base, int *max)
/***********************************************************************/
int CSORT::Qsortc(void)
{
- register int c;
- register int lo, hi, min;
- register int i, j, k, m, rc = 0;
+ int c;
+ int lo, hi, min;
+ int i, j, k, m, rc = 0;
// To do: rc should be checked for being used uninitialized
int *max;
#ifdef DEBTRACE
@@ -720,7 +720,7 @@ int CSORT::Qsortc(void)
/***********************************************************************/
void CSORT::Qstc(int *base, int *max)
{
- register int *i, *j, *jj, *lt, *eq, *gt, *mid;
+ int *i, *j, *jj, *lt, *eq, *gt, *mid;
int c = 0, lo, hi, rc;
size_t zlo, zhi, cnm;
@@ -907,9 +907,9 @@ void CSORT::Qstc(int *base, int *max)
/***********************************************************************/
void CSORT::Istc(int *base, int *hi, int *max)
{
- register int c = 0;
- register int *lo;
- register int *i, *j;
+ int c = 0;
+ int *lo;
+ int *i, *j;
/*********************************************************************/
/* First put smallest element, which must be in the first THRESH, */
diff --git a/storage/connect/filter.h b/storage/connect/filter.h
index c6ab8fddd35..b0fea3d69e0 100644
--- a/storage/connect/filter.h
+++ b/storage/connect/filter.h
@@ -48,6 +48,7 @@ class DllExport FILTER : public XOBJECT { /* Filter description block */
PVAL &Val(int i) {return Test[i].Value;}
bool &Conv(int i) {return Test[i].Conv;}
void SetNext(PFIL filp) {Next = filp;}
+ bool MakeSelector(PGLOBAL g, PSTRG s);
// Methods
virtual void Reset(void);
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 3398c7cabed..a7bfcd2149b 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -586,9 +586,9 @@ ha_create_table_option connect_table_option_list[]=
HA_TOPTION_STRING("FILTER", filter),
HA_TOPTION_STRING("OPTION_LIST", oplist),
HA_TOPTION_STRING("DATA_CHARSET", data_charset),
- HA_TOPTION_STRING("HTTP", http),
- HA_TOPTION_STRING("URI", uri),
- HA_TOPTION_NUMBER("LRECL", lrecl, 0, 0, INT_MAX32, 1),
+ HA_TOPTION_STRING("HTTP", http),
+ HA_TOPTION_STRING("URI", uri),
+ HA_TOPTION_NUMBER("LRECL", lrecl, 0, 0, INT_MAX32, 1),
HA_TOPTION_NUMBER("BLOCK_SIZE", elements, 0, 0, INT_MAX32, 1),
//HA_TOPTION_NUMBER("ESTIMATE", estimate, 0, 0, INT_MAX32, 1),
HA_TOPTION_NUMBER("MULTIPLE", multiple, 0, 0, 3, 1),
@@ -1035,14 +1035,14 @@ TABTYPE ha_connect::GetRealType(PTOS pos)
#if defined(REST_SUPPORT)
else if (pos->http)
switch (type) {
- case TAB_JSON:
- case TAB_XML:
- case TAB_CSV:
- type= TAB_REST;
- break;
- case TAB_REST:
- type= TAB_NIY;
- break;
+ case TAB_JSON:
+ case TAB_XML:
+ case TAB_CSV:
+ type = TAB_REST;
+ break;
+ case TAB_REST:
+ type = TAB_NIY;
+ break;
} // endswitch type
#endif // REST_SUPPORT
@@ -1166,30 +1166,30 @@ PCSZ GetListOption(PGLOBAL g, PCSZ opname, PCSZ oplist, PCSZ def)
while (n && key[n - 1] == ' ')
n--;
- key[n]= 0;
+ key[n]= 0;
while (*(++pv) == ' ');
- n= MY_MIN((pn ? pn - pv : strlen(pv)), sizeof(val) - 1);
+ n= MY_MIN((pn ? pn - pv : strlen(pv)), sizeof(val) - 1);
memcpy(val, pv, n);
while (n && val[n - 1] == ' ')
n--;
- val[n]= 0;
+ val[n]= 0;
} else {
- n= MY_MIN((pn ? pn - pk : strlen(pk)), sizeof(key) - 1);
+ n= MY_MIN((pn ? pn - pk : strlen(pk)), sizeof(key) - 1);
memcpy(key, pk, n);
while (n && key[n - 1] == ' ')
n--;
- key[n]= 0;
- val[0]= 0;
+ key[n]= 0;
+ val[0]= 0;
} // endif pv
if (!stricmp(opname, key)) {
- opval= PlugDup(g, val);
+ opval= PlugDup(g, val);
break;
} else if (!pn)
break;
@@ -1237,7 +1237,7 @@ PCSZ GetStringTableOption(PGLOBAL g, PTOS options, PCSZ opname, PCSZ sdef)
else if (!stricmp(opname, "Colist"))
opval= options->colist;
else if (!stricmp(opname, "Filter"))
- opval= options->filter;
+ opval= options->filter;
else if (!stricmp(opname, "Data_charset"))
opval= options->data_charset;
else if (!stricmp(opname, "Http") || !stricmp(opname, "URL"))
@@ -1274,7 +1274,7 @@ bool GetBooleanTableOption(PGLOBAL g, PTOS options, PCSZ opname, bool bdef)
else if (!stricmp(opname, "Header"))
opval= (options->header != 0); // Is Boolean for some table types
else if (!stricmp(opname, "Zipped"))
- opval= options->zipped;
+ opval= options->zipped;
else if (options->oplist)
if ((pv= GetListOption(g, opname, options->oplist)))
opval= (!*pv || *pv == 'y' || *pv == 'Y' || atoi(pv) != 0);
@@ -1339,7 +1339,7 @@ char *ha_connect::GetRealString(PCSZ s)
{
char *sv;
- if (IsPartitioned() && s && partname && *partname) {
+ if (IsPartitioned() && s && *partname) {
sv= (char*)PlugSubAlloc(xp->g, NULL, 0);
sprintf(sv, s, partname);
PlugSubAlloc(xp->g, NULL, strlen(sv) + 1);
@@ -1368,8 +1368,8 @@ PCSZ ha_connect::GetStringOption(PCSZ opname, PCSZ sdef)
} else if (!stricmp(opname, "Query_String")) {
// This escapes everything and returns a wrong query
-// opval= thd_query_string(table->in_use)->str;
- opval= (PCSZ)PlugSubAlloc(xp->g, NULL,
+// opval= thd_query_string(table->in_use)->str;
+ opval= (PCSZ)PlugSubAlloc(xp->g, NULL,
thd_query_string(table->in_use)->length + 1);
strcpy((char*)opval, thd_query_string(table->in_use)->str);
// sprintf((char*)opval, "%s", thd_query_string(table->in_use)->str);
@@ -1390,7 +1390,7 @@ PCSZ ha_connect::GetStringOption(PCSZ opname, PCSZ sdef)
|| !stricmp(opname, "filename")
|| !stricmp(opname, "optname")
|| !stricmp(opname, "entry")))
- opval= GetRealString(opval);
+ opval= GetRealString(opval);
if (!opval) {
if (sdef && !strcmp(sdef, "*")) {
@@ -1519,7 +1519,7 @@ PFOS ha_connect::GetFieldOptionStruct(Field *fdp)
void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf)
{
const char *cp;
- char *chset, v= 0;
+ char *chset, v= 0;
ha_field_option_struct *fop;
Field* fp;
Field* *fldp;
@@ -1571,7 +1571,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf)
pcf->Fieldfmt= NULL;
} // endif fop
- chset= (char *)fp->charset()->name;
+ chset= (char *)fp->charset()->name;
switch (fp->type()) {
case MYSQL_TYPE_BLOB:
@@ -2077,10 +2077,10 @@ bool ha_connect::CheckColumnList(PGLOBAL g)
} catch (int n) {
if (trace(1))
htrc("Exception %d: %s\n", n, g->Message);
- brc= true;
+ brc= true;
} catch (const char *msg) {
strcpy(g->Message, msg);
- brc= true;
+ brc= true;
} // end catch
return brc;
@@ -2207,9 +2207,9 @@ int ha_connect::MakeRecord(char *buf)
rc= fp->store(p, strlen(p), charset, CHECK_FIELD_WARN);
break;
case TYPE_BIN:
- p= value->GetCharValue();
- charset= &my_charset_bin;
- rc= fp->store(p, strlen(p), charset, CHECK_FIELD_WARN);
+ p= value->GetCharValue();
+ charset= &my_charset_bin;
+ rc= fp->store(p, strlen(p), charset, CHECK_FIELD_WARN);
break;
case TYPE_DOUBLE:
rc= fp->store(value->GetFloatValue());
@@ -2458,7 +2458,7 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q,
kfp= &table->key_info[active_index];
old_map= dbug_tmp_use_all_columns(table, table->write_set);
- for (i= 0; i <= 1; i++) {
+ for (i= 0; i <= 1; i++) {
if (ranges[i] == NULL)
continue;
@@ -2569,7 +2569,7 @@ const char *ha_connect::GetValStr(OPVAL vop, bool neg)
switch (vop) {
case OP_EQ:
- val= " = ";
+ val= "= ";
break;
case OP_NE:
val= " <> ";
@@ -2839,7 +2839,7 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond)
/***********************************************************************/
PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
{
- AMT tty= filp->Type;
+ AMT tty= filp->Type;
char *body= filp->Body;
char *havg= filp->Having;
unsigned int i;
@@ -2856,7 +2856,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
if (cond->type() == COND::COND_ITEM) {
char *pb0, *pb1, *pb2, *ph0= 0, *ph1= 0, *ph2= 0;
- bool bb= false, bh= false;
+ bool bb= false, bh= false;
Item_cond *cond_item= (Item_cond *)cond;
if (x)
@@ -2915,13 +2915,13 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
bb |= filp->Bd;
bh |= filp->Hv;
- filp->Bd= filp->Hv= false;
+ filp->Bd= filp->Hv= false;
} else
return NULL;
if (bb) {
strcpy(pb1, ")");
- filp->Bd= bb;
+ filp->Bd= bb;
} else
*pb0= 0;
@@ -3093,7 +3093,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
strncat(s, res->ptr(), res->length());
if (res->length() < 19)
- strcat(s, "1970-01-01 00:00:00" + res->length());
+ strcat(s, &"1970-01-01 00:00:00"[res->length()]);
strcat(s, "'}");
break;
@@ -3123,7 +3123,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
strncat(s, res->ptr(), res->length());
if (res->length() < 19)
- strcat(s, "1970-01-01 00:00:00" + res->length());
+ strcat(s, &"1970-01-01 00:00:00"[res->length()]);
strcat(s, "'}");
break;
@@ -4468,7 +4468,7 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, const char *dbn, bool
case TAB_XML:
case TAB_INI:
case TAB_VEC:
- case TAB_REST:
+ case TAB_REST:
case TAB_JSON:
if (options->filename && *options->filename) {
if (!quick) {
@@ -4501,34 +4501,13 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, const char *dbn, bool
case TAB_DIR:
case TAB_ZIP:
case TAB_OEM:
-#ifdef NO_EMBEDDED_ACCESS_CHECKS
- return false;
- #endif
-
- /*
- Check FILE_ACL
- If table or table->mdl_ticket is NULL - it's a DLL, e.g. CREATE TABLE.
- if the table has an MDL_EXCLUSIVE lock - it's a DDL too, e.g. the
- insert step of CREATE ... SELECT.
-
- Otherwise it's a DML, the table was normally opened, locked,
- privilege were already checked, and table->grant.privilege is set.
- With SQL SECURITY DEFINER, table->grant.privilege has definer's privileges.
-
- Unless we're in prelocking mode, in this case table->grant.privilege
- is only checked in start_stmt(), not in external_lock().
- */
- if (!table || !table->mdl_ticket || table->mdl_ticket->get_type() == MDL_EXCLUSIVE)
- return check_access(thd, FILE_ACL, db, NULL, NULL, 0, 0);
-
- if ((!quick && thd->lex->requires_prelocking()) || table->grant.privilege & FILE_ACL)
- return false;
-
- status_var_increment(thd->status_var.access_denied_errors);
- my_error(access_denied_error_code(thd->password), MYF(0),
- thd->security_ctx->priv_user, thd->security_ctx->priv_host,
- (thd->password ? ER(ER_YES) : ER(ER_NO)));
- return true;
+ if (table && table->pos_in_table_list) // if SELECT
+ {
+ Switch_to_definer_security_ctx backup_ctx(thd, table->pos_in_table_list);
+ return check_global_access(thd, FILE_ACL);
+ }
+ else
+ return check_global_access(thd, FILE_ACL);
case TAB_ODBC:
case TAB_JDBC:
case TAB_MONGO:
@@ -4758,7 +4737,7 @@ int ha_connect::start_stmt(THD *thd, thr_lock_type lock_type)
} // endif Close
locked= 0;
- xmod= MODE_ANY; // For info commands
+ xmod= MODE_ANY; // For info commands
DBUG_RETURN(rc);
} // endif MODE_ANY
@@ -5537,7 +5516,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
PCSZ fncn= "?";
PCSZ user, fn, db, host, pwd, sep, tbl, src;
PCSZ col, ocl, rnk, pic, fcl, skc, zfn;
- char *tab, *dsn, *shm, *dpath, *url;
+ char *tab, *dsn, *shm, *dpath, *url;
#if defined(__WIN__)
PCSZ nsp= NULL, cls= NULL;
#endif // __WIN__
@@ -5646,11 +5625,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
#if defined(REST_SUPPORT)
} else if (topt->http) {
switch (ttp) {
- case TAB_JSON:
- case TAB_XML:
- case TAB_CSV:
- ttp= TAB_REST;
- break;
+ case TAB_JSON:
+ case TAB_XML:
+ case TAB_CSV:
+ ttp = TAB_REST;
+ break;
} // endswitch type
#endif // REST_SUPPORT
} // endif ttp
@@ -6730,6 +6709,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
if (trace(1))
htrc("xchk=%p createas=%d\n", g->Xchk, g->Createas);
+#if defined(ZIP_SUPPORT)
if (options->zipped) {
#if defined(ZIP_SUPPORT)
// Check whether the zip entry must be made from a file
@@ -6763,6 +6743,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
#endif // !ZIP_SUPPORT
} // endif zipped
+#endif // ZIP_SUPPORT
// To check whether indexes have to be made or remade
if (!g->Xchk) {
diff --git a/storage/connect/jdbconn.cpp b/storage/connect/jdbconn.cpp
index e0aca3333e6..2cb75e0adc1 100644
--- a/storage/connect/jdbconn.cpp
+++ b/storage/connect/jdbconn.cpp
@@ -1196,9 +1196,14 @@ int JDBConn::GetResultSize(PCSZ sql, PCOL colp)
if ((rc = ExecuteQuery(sql)) != RC_OK)
return -1;
- if ((rc = Fetch()) > 0)
- SetColumnValue(1, NULL, colp->GetValue());
- else
+ if ((rc = Fetch()) > 0) {
+ try {
+ SetColumnValue(1, NULL, colp->GetValue());
+ } catch (...) {
+ return -4;
+ } // end catch
+
+ } else
return -2;
if ((rc = Fetch()) != 0)
diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc
index b1d23b8c5e2..411e96e3dc8 100644
--- a/storage/connect/mycat.cc
+++ b/storage/connect/mycat.cc
@@ -104,9 +104,7 @@
#if defined(__WIN__)
extern "C" HINSTANCE s_hModule; // Saved module handle
#endif // !__WIN__
-#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT)
-bool MongoEnabled(void);
-#endif // JAVA_SUPPORT || CMGO_SUPPORT
+
PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info);
/***********************************************************************/
diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp
index 253c42bb002..6de5a73875c 100644
--- a/storage/connect/myconn.cpp
+++ b/storage/connect/myconn.cpp
@@ -879,7 +879,7 @@ MYSQL_FIELD *MYSQLC::GetNextField(void)
PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)
{
PCSZ fmt;
- char *name, v;
+ char *name, v= 0;
int n;
bool uns;
PCOLRES *pcrp, crp;
diff --git a/storage/connect/mysql-test/connect/disabled.def b/storage/connect/mysql-test/connect/disabled.def
index 827ed58b835..1de4deb0a60 100644
--- a/storage/connect/mysql-test/connect/disabled.def
+++ b/storage/connect/mysql-test/connect/disabled.def
@@ -9,15 +9,15 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-infoschema-9739 : Crashes with MariaDB 10.0
-jdbc : Variable settings depend on machine configuration
-jdbc_new : Variable settings depend on machine configuration
-jdbc_oracle : Variable settings depend on machine configuration
-jdbc_postgresql : Variable settings depend on machine configuration
-json_mongo_c : Need MongoDB running and its C Driver installed
-json_java_2 : Need MongoDB running and its Java Driver installed
-json_java_3 : Need MongoDB running and its Java Driver installed
-mongo_c : Need MongoDB running and its C Driver installed
-mongo_java_2 : Need MongoDB running and its Java Driver installed
-mongo_java_3 : Need MongoDB running and its Java Driver installed
-tbl_thread : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed
+jdbc : Variable settings depend on machine configuration
+jdbc_new : Variable settings depend on machine configuration
+jdbc_oracle : Variable settings depend on machine configuration
+jdbc_postgresql : Variable settings depend on machine configuration
+json_mongo_c : Need MongoDB running and its C Driver installed
+json_java_2 : Need MongoDB running and its Java Driver installed
+json_java_3 : Need MongoDB running and its Java Driver installed
+mongo_c : Need MongoDB running and its C Driver installed
+mongo_java_2 : Need MongoDB running and its Java Driver installed
+mongo_java_3 : Need MongoDB running and its Java Driver installed
+tbl_thread : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed
+#vcol : Different error code on different versions
diff --git a/storage/connect/mysql-test/connect/r/grant.result b/storage/connect/mysql-test/connect/r/grant.result
index c43ad3a5b79..2e7f0e4b2bc 100644
--- a/storage/connect/mysql-test/connect/r/grant.result
+++ b/storage/connect/mysql-test/connect/r/grant.result
@@ -15,7 +15,7 @@ fname VARCHAR(256) NOT NULL,
ftype CHAR(4) NOT NULL,
size DOUBLE(12,0) NOT NULL flag=5
) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*.*';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -34,19 +34,19 @@ SELECT user();
user()
user@localhost
SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO t1 VALUES ();
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1 WHERE path='xxx';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET path='yyy' WHERE path='xxx';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@@ -58,13 +58,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (1,1,1,1);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET path=123;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
disconnect user;
connection default;
SELECT user();
@@ -111,7 +111,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=BIN FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -123,23 +123,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@@ -151,13 +151,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -173,7 +173,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;
@@ -216,7 +216,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -228,23 +228,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@@ -256,13 +256,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -278,7 +278,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;
@@ -321,7 +321,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -333,23 +333,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@@ -361,13 +361,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -383,7 +383,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;
@@ -426,7 +426,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -438,23 +438,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@@ -466,13 +466,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -488,7 +488,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;
@@ -531,7 +531,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=VEC MAX_ROWS=100 FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -543,23 +543,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@@ -571,13 +571,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -593,7 +593,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;
diff --git a/storage/connect/mysql-test/connect/r/grant2.result b/storage/connect/mysql-test/connect/r/grant2.result
index 73e41f49256..2e20dc39596 100644
--- a/storage/connect/mysql-test/connect/r/grant2.result
+++ b/storage/connect/mysql-test/connect/r/grant2.result
@@ -21,12 +21,12 @@ SELECT * FROM v1_definer;
a
10
SELECT * FROM v1_baddefiner;
-ERROR 28000: Access denied for user 'root'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connect user,localhost,user,,;
SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM v1_invoker;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM v1_definer;
a
10
@@ -44,9 +44,9 @@ UPDATE v1_invoker SET a=12;
UPDATE v1_definer SET a=13;
connection user;
UPDATE t1 SET a=21;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker SET a=22;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer SET a=23;
connection default;
DROP VIEW v1_invoker, v1_definer;
@@ -62,9 +62,9 @@ INSERT INTO v1_invoker VALUES (12);
INSERT INTO v1_definer VALUES (13);
connection user;
INSERT INTO t1 VALUES (21);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_invoker VALUES (22);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_definer VALUES (23);
connection default;
DROP VIEW v1_invoker, v1_definer;
@@ -83,9 +83,9 @@ REPLACE INTO v1_definer VALUES (13);
ERROR 42000: CONNECT Unsupported command
connection user;
REPLACE INTO t1 VALUES (21);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_invoker VALUES (22);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_definer VALUES (23);
ERROR 42000: CONNECT Unsupported command
connection default;
@@ -102,9 +102,9 @@ DELETE FROM v1_invoker WHERE a=12;
DELETE FROM v1_definer WHERE a=13;
connection user;
DELETE FROM t1 WHERE a=21;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1_invoker WHERE a=22;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1_definer WHERE a=23;
connection default;
DROP VIEW v1_invoker, v1_definer;
@@ -120,9 +120,9 @@ LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_invoker;
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_definer;
connection user;
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_invoker;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_definer;
connection default;
DROP VIEW v1_invoker, v1_definer;
@@ -135,7 +135,7 @@ TRUNCATE TABLE t1;
INSERT INTO t1 VALUES (11);
connection user;
TRUNCATE TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_DROP_TABLE
@@ -144,7 +144,7 @@ CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
connection user;
DROP TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_DROP_VIEW
@@ -165,7 +165,7 @@ DROP TABLE t1;
# Testing SQLCOM_CREATE_TABLE
connection user;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
# Testing SQLCOM_LOCK_TABLES
connection default;
@@ -187,13 +187,13 @@ LOCK TABLE v1_definer WRITE;
UNLOCK TABLES;
connection user;
LOCK TABLE t1 READ;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOCK TABLE t1 WRITE;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOCK TABLE v1_invoker READ;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOCK TABLE v1_invoker WRITE;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOCK TABLE v1_definer READ;
UNLOCK TABLES;
LOCK TABLE v1_definer WRITE;
@@ -264,93 +264,93 @@ UPDATE v2_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
connection user;
UPDATE t1 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t3 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t3 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t3 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE t3 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t3 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE t3 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t3 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_invoker a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_definer a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_invoker a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_definer a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_definer a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_definer a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_definer a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
connection default;
DROP VIEW v1_invoker, v1_definer, v2_invoker, v2_definer;
@@ -418,93 +418,93 @@ DELETE a1 FROM v2_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v2_definer a2 WHERE a1.a=a2.a;
connection user;
DELETE a1 FROM t1 a1,t1 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,t2 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,t3 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,v1_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,v1_definer a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,v2_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,v2_definer a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,t1 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,t2 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,t3 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,v1_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,v1_definer a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,v2_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,v2_definer a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t3 a1,t1 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t3 a1,t2 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t3 a1,t3 a2 WHERE a1.a=a2.a;
DELETE a1 FROM t3 a1,v1_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t3 a1,v1_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM t3 a1,v2_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t3 a1,v2_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_invoker a1,t1 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,t2 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,t3 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,v1_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,v1_definer a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,v2_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,v2_definer a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_definer a1,t1 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_definer a1,t2 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_definer a1,t3 a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_definer a1,v1_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_definer a1,v1_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_definer a1,v2_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_invoker a1,t1 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,t2 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,t3 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,v1_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,v1_definer a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,v2_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,v2_definer a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_definer a1,t1 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_definer a1,t2 a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_definer a1,t3 a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v1_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_definer a1,v1_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_definer a1,v2_definer a2 WHERE a1.a=a2.a;
connection default;
DROP VIEW v1_invoker, v1_definer, v2_invoker, v2_definer;
@@ -521,9 +521,9 @@ CREATE VIEW v2 AS SELECT * FROM v1_definer;
DROP VIEW v2;
connection user;
CREATE VIEW v2 AS SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v2 AS SELECT * FROM v1_invoker;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v2 AS SELECT * FROM v1_definer;
DROP VIEW v2;
connection default;
@@ -546,21 +546,21 @@ INSERT INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
INSERT INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
connection user;
INSERT INTO t1 SELECT * FROM t1 WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO t1 SELECT * FROM v1_invoker WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO t1 SELECT * FROM v1_definer WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_invoker SELECT * FROM t1 WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_invoker SELECT * FROM v1_invoker WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_invoker SELECT * FROM v1_definer WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_definer SELECT * FROM t1 WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
connection default;
DROP VIEW v1_invoker, v1_definer;
@@ -591,17 +591,17 @@ REPLACE INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
ERROR 42000: CONNECT Unsupported command
connection user;
REPLACE INTO t1 SELECT * FROM t1 WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO t1 SELECT * FROM v1_invoker WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO t1 SELECT * FROM v1_definer WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_invoker SELECT * FROM t1 WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_invoker SELECT * FROM v1_invoker WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_invoker SELECT * FROM v1_definer WHERE a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_definer SELECT * FROM t1 WHERE a=20;
ERROR 42000: CONNECT Unsupported command
REPLACE INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
@@ -624,7 +624,7 @@ t2 CREATE TABLE `t2` (
RENAME TABLE t2 TO t1;
connection user;
RENAME TABLE t1 TO t2;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (for ALTER..RENAME)
@@ -640,7 +640,7 @@ t2 CREATE TABLE `t2` (
ALTER TABLE t2 RENAME TO t1;
connection user;
ALTER TABLE t1 RENAME TO t2;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (changing ENGINE to non-CONNECT)
@@ -653,7 +653,7 @@ CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
connection user;
ALTER TABLE t1 ENGINE=MyISAM;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (changing ENGINE to CONNECT)
@@ -669,7 +669,7 @@ CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (10);
connection user;
ALTER TABLE t1 ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_OPTIMIZE
@@ -682,7 +682,7 @@ test.t1 optimize status OK
connection user;
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
-test.t1 optimize Error Access denied for user 'user'@'localhost' (using password: NO)
+test.t1 optimize Error Access denied; you need (at least one of) the FILE privilege(s) for this operation
test.t1 optimize Error Got error 122 'This operation requires the FILE privilege' from CONNECT
test.t1 optimize error Corrupt
connection default;
@@ -696,7 +696,7 @@ Warnings:
Warning 1105 This is an outward table, table data were not modified.
connection user;
ALTER TABLE t1 ADD c INT;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (removing columns)
@@ -708,7 +708,7 @@ Warnings:
Warning 1105 This is an outward table, table data were not modified.
connection user;
ALTER TABLE t1 DROP c;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (adding keys)
@@ -718,7 +718,7 @@ INSERT INTO t1 VALUES (10,10);
ALTER TABLE t1 ADD KEY(a);
connection user;
ALTER TABLE t1 ADD KEY(b);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (removing keys)
@@ -728,7 +728,7 @@ INSERT INTO t1 VALUES (10,10);
ALTER TABLE t1 DROP KEY a;
connection user;
ALTER TABLE t1 DROP KEY b;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_CREATE_INDEX and SQLCOM_DROP_INDEX
@@ -740,9 +740,9 @@ DROP INDEX a ON t1;
CREATE INDEX a ON t1 (a);
connection user;
CREATE INDEX b ON t1 (b);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP INDEX a ON t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing stored procedures
@@ -757,10 +757,10 @@ DROP TABLE t1;
CALL p_invoker();
DROP TABLE t1;
CALL p_baddefiner();
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection user;
CALL p_invoker();
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CALL p_definer();
connection default;
DROP TABLE t1;
diff --git a/storage/connect/mysql-test/connect/r/ini_grant.result b/storage/connect/mysql-test/connect/r/ini_grant.result
index 8cbf88123fb..96d5e192c7d 100644
--- a/storage/connect/mysql-test/connect/r/ini_grant.result
+++ b/storage/connect/mysql-test/connect/r/ini_grant.result
@@ -34,7 +34,7 @@ sec val
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -46,21 +46,21 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES ('sec2','val2');
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET val='val11';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@@ -72,13 +72,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES ('sec3','val3');
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET val='val11';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
disconnect user;
connection default;
DROP VIEW v1;
diff --git a/storage/connect/mysql-test/connect/r/mysql_grant.result b/storage/connect/mysql-test/connect/r/mysql_grant.result
index 11a3dbba36c..83a906afed5 100644
--- a/storage/connect/mysql-test/connect/r/mysql_grant.result
+++ b/storage/connect/mysql-test/connect/r/mysql_grant.result
@@ -11,7 +11,7 @@ SELECT user();
user()
user@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=PORT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -29,19 +29,19 @@ SELECT user();
user()
user@localhost
SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO t1 VALUES ('xxx');
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1 WHERE a='xxx';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a='yyy' WHERE a='xxx';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@@ -53,13 +53,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
disconnect user;
connection default;
SELECT user();
diff --git a/storage/connect/mysql-test/connect/r/xml2.result b/storage/connect/mysql-test/connect/r/xml2.result
index b8075fa1928..f7bbc17c8a0 100644
--- a/storage/connect/mysql-test/connect/r/xml2.result
+++ b/storage/connect/mysql-test/connect/r/xml2.result
@@ -325,7 +325,7 @@ HEX(c) 3F3F3F3F3F3F3F
Warnings:
Level Warning
Code 1366
-Message Incorrect string value: '\xC3\x81\xC3\x82\xC3\x83...' for column 'c' at row 1
+Message Incorrect string value: '\xC3\x81\xC3\x82\xC3\x83...' for column `test`.`t1`.`c` at row 1
Level Warning
Code 1105
Message Out of range value ÁÂÃÄÅÆÇ for column 'c' at row 1
diff --git a/storage/connect/mysql-test/connect/r/xml2_grant.result b/storage/connect/mysql-test/connect/r/xml2_grant.result
index 817d3f5bf57..a6e6c150b59 100644
--- a/storage/connect/mysql-test/connect/r/xml2_grant.result
+++ b/storage/connect/mysql-test/connect/r/xml2_grant.result
@@ -35,7 +35,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row' FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -47,23 +47,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@@ -75,13 +75,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -97,7 +97,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;
diff --git a/storage/connect/mysql-test/connect/r/xml_grant.result b/storage/connect/mysql-test/connect/r/xml_grant.result
index 950ae4a3b35..f1a6ad101cb 100644
--- a/storage/connect/mysql-test/connect/r/xml_grant.result
+++ b/storage/connect/mysql-test/connect/r/xml_grant.result
@@ -33,7 +33,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=domdoc,rownode=row' FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -45,23 +45,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@@ -73,13 +73,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@@ -95,7 +95,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
-ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;
diff --git a/storage/connect/mysql-test/connect/t/grant.inc b/storage/connect/mysql-test/connect/t/grant.inc
index 6580c845b56..ef6e0cec297 100644
--- a/storage/connect/mysql-test/connect/t/grant.inc
+++ b/storage/connect/mysql-test/connect/t/grant.inc
@@ -25,7 +25,7 @@ DROP TABLE t1;
# Making sure DROP erased the data file
--error 1
--remove_file $MYSQLD_DATADIR/test/t1.$FILE_EXT
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT $TABLE_OPTIONS FILE_NAME='t1.EXT'
--connection default
SELECT user();
@@ -33,23 +33,23 @@ SELECT user();
INSERT INTO t1 VALUES (10);
--connection user
SELECT user();
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES (10);
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 FILE_NAME='t2.EXT';
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DROP TABLE t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE
--connection default
@@ -57,13 +57,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user
SELECT user();
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES (2);
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET a=123;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1;
--connection default
SELECT user();
@@ -74,7 +74,7 @@ DROP TABLE t1;
INSERT INTO t1 VALUES (10);
--connection user
SELECT user();
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 FILE_NAME='t1.EXT';
--connection default
DROP TABLE t1;
diff --git a/storage/connect/mysql-test/connect/t/grant.test b/storage/connect/mysql-test/connect/t/grant.test
index c4a91904e73..afe550267c4 100644
--- a/storage/connect/mysql-test/connect/t/grant.test
+++ b/storage/connect/mysql-test/connect/t/grant.test
@@ -11,7 +11,7 @@ REVOKE FILE ON *.* FROM user@localhost;
--connect(user,localhost,user,,)
--connection user
SELECT user();
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE TABLE t1 (
path VARCHAR(256) NOT NULL flag=1,
fname VARCHAR(256) NOT NULL,
@@ -32,19 +32,19 @@ SELECT fname, ftype, size FROM t1 WHERE size>0 AND ftype!='.opt';
--connection user
SELECT user();
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES ();
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1 WHERE path='xxx';
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET path='yyy' WHERE path='xxx';
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE
@@ -53,13 +53,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user
SELECT user();
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES (1,1,1,1);
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET path=123;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1;
--disconnect user
diff --git a/storage/connect/mysql-test/connect/t/grant2.test b/storage/connect/mysql-test/connect/t/grant2.test
index 8e7d9453e70..351eb97f11a 100644
--- a/storage/connect/mysql-test/connect/t/grant2.test
+++ b/storage/connect/mysql-test/connect/t/grant2.test
@@ -23,13 +23,13 @@ CREATE DEFINER=user@localhost SQL SECURITY DEFINER VIEW v1_baddefiner AS SELECT
SELECT * FROM t1;
SELECT * FROM v1_invoker;
SELECT * FROM v1_definer;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1_baddefiner;
--connect(user,localhost,user,,)
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1_invoker;
SELECT * FROM v1_definer;
--connection default
@@ -47,9 +47,9 @@ UPDATE t1 SET a=11;
UPDATE v1_invoker SET a=12;
UPDATE v1_definer SET a=13;
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET a=21;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker SET a=22;
UPDATE v1_definer SET a=23;
--connection default
@@ -67,9 +67,9 @@ INSERT INTO t1 VALUES (11);
INSERT INTO v1_invoker VALUES (12);
INSERT INTO v1_definer VALUES (13);
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES (21);
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_invoker VALUES (22);
INSERT INTO v1_definer VALUES (23);
--connection default
@@ -79,7 +79,7 @@ DROP TABLE t1;
--echo # Testing SQLCOM_REPLACE
# REPLACE is not supported by ConnectSE, so we're testing the difference
-# between ER_ACCESS_DENIED_ERROR vs ER_NOT_ALLOWED_COMMAND
+# between ER_SPECIFIC_ACCESS_DENIED_ERROR vs ER_NOT_ALLOWED_COMMAND
--connection default
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
@@ -92,9 +92,9 @@ REPLACE INTO v1_invoker VALUES (12);
--error ER_NOT_ALLOWED_COMMAND
REPLACE INTO v1_definer VALUES (13);
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO t1 VALUES (21);
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO v1_invoker VALUES (22);
--error ER_NOT_ALLOWED_COMMAND
REPLACE INTO v1_definer VALUES (23);
@@ -113,9 +113,9 @@ DELETE FROM t1 WHERE a=11;
DELETE FROM v1_invoker WHERE a=12;
DELETE FROM v1_definer WHERE a=13;
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1 WHERE a=21;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1_invoker WHERE a=22;
DELETE FROM v1_definer WHERE a=23;
--connection default
@@ -137,10 +137,10 @@ CREATE SQL SECURITY DEFINER VIEW v1_definer AS SELECT * FROM t1;
--eval LOAD DATA LOCAL INFILE '$MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_definer
--connection user
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
--eval LOAD DATA LOCAL INFILE '$MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE t1
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
--eval LOAD DATA LOCAL INFILE '$MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_invoker
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
--eval LOAD DATA LOCAL INFILE '$MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_definer
@@ -156,7 +156,7 @@ INSERT INTO t1 VALUES (10);
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES (11);
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1;
--connection default
DROP TABLE t1;
@@ -168,7 +168,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DROP TABLE t1;
--connection default
DROP TABLE t1;
@@ -193,7 +193,7 @@ DROP TABLE t1;
--echo # Testing SQLCOM_CREATE_TABLE
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
--connection default
@@ -216,13 +216,13 @@ UNLOCK TABLES;
LOCK TABLE v1_definer WRITE;
UNLOCK TABLES;
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
LOCK TABLE t1 READ;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
LOCK TABLE t1 WRITE;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
LOCK TABLE v1_invoker READ;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
LOCK TABLE v1_invoker WRITE;
LOCK TABLE v1_definer READ;
UNLOCK TABLES;
@@ -299,108 +299,108 @@ UPDATE v2_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
--connection user
# All queries with t1 should fail
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# All queries with t2 should fail
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# t3 does not need FILE_ALC
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t3 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t3 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
# This is OK:
UPDATE t3 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t3 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
# This is OK:
UPDATE t3 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t3 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
# This is OK:
UPDATE t3 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# All queries with v1_invoker should fail
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# v1_definer does not need FILE_ACL from the invoker
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_definer a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_definer a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_definer a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_definer a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_definer a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# All queries with v2_invoker should fail
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# v2_definer does not need FILE_ACL from the invoker
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_definer a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_definer a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_definer a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
@@ -476,108 +476,108 @@ DELETE a1 FROM v2_definer a1,v2_definer a2 WHERE a1.a=a2.a;
--connection user
# All queries with t1 should fail
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,t1 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,t2 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,t3 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,v1_invoker a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,v1_definer a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,v2_invoker a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,v2_definer a2 WHERE a1.a=a2.a;
# All queries with t2 should fail
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,t1 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,t2 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,t3 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,v1_invoker a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,v1_definer a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,v2_invoker a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,v2_definer a2 WHERE a1.a=a2.a;
# t3 does not need FILE_ALC
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t3 a1,t1 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t3 a1,t2 a2 WHERE a1.a=a2.a;
# This is OK:
DELETE a1 FROM t3 a1,t3 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t3 a1,v1_invoker a2 WHERE a1.a=a2.a;
# This is OK:
DELETE a1 FROM t3 a1,v1_definer a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t3 a1,v2_invoker a2 WHERE a1.a=a2.a;
# This is OK:
DELETE a1 FROM t3 a1,v2_definer a2 WHERE a1.a=a2.a;
# All queries with v1_invoker should fail
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,t1 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,t2 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,t3 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,v1_invoker a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,v1_definer a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,v2_invoker a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,v2_definer a2 WHERE a1.a=a2.a;
# v1_definer does not need FILE_ACL from the invoker
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_definer a1,t1 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_definer a1,t2 a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_definer a1,t3 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_definer a1,v1_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_definer a1,v1_definer a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_definer a1,v2_definer a2 WHERE a1.a=a2.a;
# All queries with v2_invoker should fail
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,t1 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,t2 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,t3 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,v1_invoker a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,v1_definer a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,v2_invoker a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,v2_definer a2 WHERE a1.a=a2.a;
# v2_definer does not need FILE_ACL from the invoker
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_definer a1,t1 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_definer a1,t2 a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,t3 a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_definer a1,v1_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v1_definer a2 WHERE a1.a=a2.a;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v2_definer a2 WHERE a1.a=a2.a;
@@ -598,9 +598,9 @@ DROP VIEW v2;
CREATE VIEW v2 AS SELECT * FROM v1_definer;
DROP VIEW v2;
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v2 AS SELECT * FROM t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v2 AS SELECT * FROM v1_invoker;
CREATE VIEW v2 AS SELECT * FROM v1_definer;
DROP VIEW v2;
@@ -625,21 +625,21 @@ INSERT INTO v1_definer SELECT * FROM t1 WHERE a=20;
INSERT INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
INSERT INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 SELECT * FROM t1 WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 SELECT * FROM v1_invoker WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 SELECT * FROM v1_definer WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_invoker SELECT * FROM t1 WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_invoker SELECT * FROM v1_invoker WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_invoker SELECT * FROM v1_definer WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_definer SELECT * FROM t1 WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
# This is OK:
INSERT INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
@@ -650,7 +650,7 @@ DROP TABLE t1;
--echo # Testing SQLCOM_REPLACE_SELECT
# REPLACE is not supported by CONNECT
-# so we're testing ER_NOT_ALLOWED_COMMAND vs ER_ACCESS_DENIED_ERROR here
+# so we're testing ER_NOT_ALLOWED_COMMAND vs ER_SPECIFIC_ACCESS_DENIED_ERROR here
--connection default
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
@@ -676,17 +676,17 @@ REPLACE INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
REPLACE INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO t1 SELECT * FROM t1 WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO t1 SELECT * FROM v1_invoker WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO t1 SELECT * FROM v1_definer WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO v1_invoker SELECT * FROM t1 WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO v1_invoker SELECT * FROM v1_invoker WHERE a=20;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO v1_invoker SELECT * FROM v1_definer WHERE a=20;
--error ER_NOT_ALLOWED_COMMAND
REPLACE INTO v1_definer SELECT * FROM t1 WHERE a=20;
@@ -708,7 +708,7 @@ SHOW CREATE TABLE t2;
RENAME TABLE t2 TO t1;
--connection user
# TODO: Perhaps FILE_ACL is needed for RENAME. Discuss with Oliver.
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
RENAME TABLE t1 TO t2;
--connection default
DROP TABLE t1;
@@ -723,7 +723,7 @@ SHOW CREATE TABLE t2;
ALTER TABLE t2 RENAME TO t1;
--connection user
# TODO: Perhaps FILE_ACL is not needed for ALTER..RENAME. Discuss with Olivier.
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 RENAME TO t2;
--connection default
DROP TABLE t1;
@@ -739,7 +739,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 ENGINE=MyISAM;
--connection default
DROP TABLE t1;
@@ -756,7 +756,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (10);
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
--connection default
DROP TABLE t1;
@@ -779,7 +779,7 @@ CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
ALTER TABLE t1 ADD b INT;
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 ADD c INT;
--connection default
DROP TABLE t1;
@@ -791,7 +791,7 @@ CREATE TABLE t1 (a INT,b INT,c INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.
INSERT INTO t1 VALUES (10,10,10);
ALTER TABLE t1 DROP b;
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 DROP c;
--connection default
DROP TABLE t1;
@@ -803,7 +803,7 @@ CREATE TABLE t1 (a INT NOT NULL,b INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=fix FI
INSERT INTO t1 VALUES (10,10);
ALTER TABLE t1 ADD KEY(a);
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 ADD KEY(b);
--connection default
DROP TABLE t1;
@@ -816,7 +816,7 @@ CREATE TABLE t1 (a INT NOT NULL,b INT NOT NULL, KEY a(a), KEY b(b)) ENGINE=CONNE
INSERT INTO t1 VALUES (10,10);
ALTER TABLE t1 DROP KEY a;
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 DROP KEY b;
--connection default
DROP TABLE t1;
@@ -831,9 +831,9 @@ CREATE INDEX a ON t1 (a);
DROP INDEX a ON t1;
CREATE INDEX a ON t1 (a);
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE INDEX b ON t1 (b);
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DROP INDEX a ON t1;
--connection default
DROP TABLE t1;
@@ -852,11 +852,11 @@ CALL p_definer();
DROP TABLE t1;
CALL p_invoker();
DROP TABLE t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CALL p_baddefiner();
--connection user
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CALL p_invoker();
CALL p_definer();
diff --git a/storage/connect/mysql-test/connect/t/ini_grant.test b/storage/connect/mysql-test/connect/t/ini_grant.test
index b0ddcb57979..bbf85e5f794 100644
--- a/storage/connect/mysql-test/connect/t/ini_grant.test
+++ b/storage/connect/mysql-test/connect/t/ini_grant.test
@@ -29,7 +29,7 @@ DROP TABLE t1;
# Making sure DROP erased the data file
--error 1
--remove_file $MYSQLD_DATADIR/test/t1.ini
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
--connection default
SELECT user();
@@ -37,21 +37,21 @@ CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CON
INSERT INTO t1 VALUES ('sec1','val1');
--connection user
SELECT user();
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES ('sec2','val2');
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET val='val11';
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DROP TABLE t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE
--connection default
@@ -59,13 +59,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user
SELECT user();
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES ('sec3','val3');
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET val='val11';
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1;
--disconnect user
--connection default
diff --git a/storage/connect/mysql-test/connect/t/mysql_grant.test b/storage/connect/mysql-test/connect/t/mysql_grant.test
index 7d3d05cb8fd..30737258a1f 100644
--- a/storage/connect/mysql-test/connect/t/mysql_grant.test
+++ b/storage/connect/mysql-test/connect/t/mysql_grant.test
@@ -27,7 +27,7 @@ set sql_mode=default;
--connection user
SELECT user();
--replace_result $PORT PORT
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=$PORT'
--connection default
SELECT user();
@@ -38,19 +38,19 @@ INSERT INTO t1remote VALUES (10),(20),(30);
SELECT * FROM t1;
--connection user
SELECT user();
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES ('xxx');
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1 WHERE a='xxx';
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET a='yyy' WHERE a='xxx';
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE
@@ -59,13 +59,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user
SELECT user();
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES (2);
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET a=123;
---error ER_ACCESS_DENIED_ERROR
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1;
--disconnect user
diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp
index 6687513fa6c..d08c6d1b7a5 100644
--- a/storage/connect/odbconn.cpp
+++ b/storage/connect/odbconn.cpp
@@ -2279,7 +2279,7 @@ int ODBConn::GetCatInfo(CATPARM *cap)
int i, irc;
bool b;
PCSZ fnc = "Unknown";
- UWORD n;
+ UWORD n = 0;
SWORD ncol, len, tp;
SQLULEN crow = 0;
PQRYRES qrp = cap->Qrp;
diff --git a/storage/connect/rest.def b/storage/connect/rest.def
new file mode 100644
index 00000000000..71c76740af9
--- /dev/null
+++ b/storage/connect/rest.def
@@ -0,0 +1,4 @@
+LIBRARY REST2
+EXPORTS
+ GetREST @1
+ ColREST @2
diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp
index 0fa117c3d2f..ba5c65e2c94 100644
--- a/storage/connect/tabodbc.cpp
+++ b/storage/connect/tabodbc.cpp
@@ -605,8 +605,10 @@ bool TDBODBC::OpenDB(PGLOBAL g)
Cnp->InitValue(g);
if ((n = Ocp->GetResultSize(Query->GetStr(), Cnp)) < 0) {
- strcpy(g->Message, "Cannot get result size");
- return true;
+ char* msg = PlugDup(g, g->Message);
+
+ sprintf(g->Message, "Get result size: %s (rc=%d)", msg, n);
+ return true;
} else if (n) {
Ocp->m_Rows = n;
diff --git a/storage/connect/user_connect.cc b/storage/connect/user_connect.cc
index 3bde2fa58eb..c25443ef7ef 100644
--- a/storage/connect/user_connect.cc
+++ b/storage/connect/user_connect.cc
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
/**
@file user_connect.cc
diff --git a/storage/connect/user_connect.h b/storage/connect/user_connect.h
index 22783d7fc12..2670c5bcebc 100644
--- a/storage/connect/user_connect.h
+++ b/storage/connect/user_connect.h
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
/** @file user_connect.h
diff --git a/storage/connect/valblk.cpp b/storage/connect/valblk.cpp
index 73ca135691c..b7c8c704e65 100644
--- a/storage/connect/valblk.cpp
+++ b/storage/connect/valblk.cpp
@@ -206,6 +206,7 @@ void VALBLK::ChkIndx(int n)
{
if (n < 0 || n >= Nval) {
PGLOBAL& g = Global;
+ xtrc(1, "ChkIndx: n=%d Nval=%d\n", n, Nval);
strcpy(g->Message, MSG(BAD_VALBLK_INDX));
throw Type;
} // endif n
@@ -216,7 +217,8 @@ void VALBLK::ChkTyp(PVAL v)
{
if (Check && (Type != v->GetType() || Unsigned != v->IsUnsigned())) {
PGLOBAL& g = Global;
- strcpy(g->Message, MSG(VALTYPE_NOMATCH));
+ xtrc(1, "ChkTyp: Type=%d valType=%d\n", Type, v->GetType());
+ strcpy(g->Message, MSG(VALTYPE_NOMATCH));
throw Type;
} // endif Type
@@ -511,7 +513,7 @@ void TYPBLK<TYPE>::SetValues(PVBLK pv, int k, int n)
CheckType(pv)
TYPE *lp = ((TYPBLK*)pv)->Typp;
- for (register int i = k; i < n; i++) // TODO
+ for (int i = k; i < n; i++) // TODO
Typp[i] = lp[i];
} // end of SetValues
@@ -805,7 +807,7 @@ void CHRBLK::SetValue(const char *sp, uint len, int n)
if (Blanks) {
// Suppress eventual ending zero and right fill with blanks
- for (register int i = len; i < Long; i++)
+ for (int i = len; i < Long; i++)
p[i] = ' ';
} else if ((signed)len < Long)
diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp
index d9330a68a15..df75722d0e8 100644
--- a/storage/connect/value.cpp
+++ b/storage/connect/value.cpp
@@ -123,7 +123,7 @@ ulonglong CharToNumber(const char *p, int n, ulonglong maxval,
case '+':
p++;
break;
- } // endswitch *p
+ } // endswitch *p
for (val = 0; p < p2 && (c = (uchar)(*p - '0')) < 10; p++)
if (val > (maxval - c) / 10) {
@@ -140,7 +140,7 @@ ulonglong CharToNumber(const char *p, int n, ulonglong maxval,
/* GetTypeName: returns the PlugDB internal type name. */
/***********************************************************************/
PCSZ GetTypeName(int type)
- {
+{
PCSZ name;
switch (type) {
@@ -155,17 +155,17 @@ PCSZ GetTypeName(int type)
case TYPE_BIN: name = "BINARY"; break;
case TYPE_PCHAR: name = "PCHAR"; break;
default: name = "UNKNOWN"; break;
- } // endswitch type
+ } // endswitch type
return name;
- } // end of GetTypeName
+} // end of GetTypeName
/***********************************************************************/
/* GetTypeSize: returns the PlugDB internal type size. */
/***********************************************************************/
int GetTypeSize(int type, int len)
{
- switch (type) {
+ switch (type) {
case TYPE_DECIM:
case TYPE_BIN:
case TYPE_STRING: len = len * sizeof(char); break;
@@ -177,16 +177,16 @@ int GetTypeSize(int type, int len)
case TYPE_TINY: len = sizeof(char); break;
case TYPE_PCHAR: len = sizeof(char*); break;
default: len = -1;
- } // endswitch type
+ } // endswitch type
return len;
- } // end of GetTypeSize
+} // end of GetTypeSize
/***********************************************************************/
/* GetFormatType: returns the FORMAT character(s) according to type. */
/***********************************************************************/
const char *GetFormatType(int type)
- {
+{
const char *c = "X";
switch (type) {
@@ -200,16 +200,16 @@ const char *GetFormatType(int type)
case TYPE_DECIM: c = "M"; break;
case TYPE_BIN: c = "B"; break;
case TYPE_PCHAR: c = "P"; break;
- } // endswitch type
+ } // endswitch type
return c;
- } // end of GetFormatType
+} // end of GetFormatType
/***********************************************************************/
/* GetFormatType: returns the FORMAT type according to character. */
/***********************************************************************/
int GetFormatType(char c)
- {
+{
int type = TYPE_ERROR;
switch (c) {
@@ -223,31 +223,31 @@ int GetFormatType(char c)
case 'M': type = TYPE_DECIM; break;
case 'B': type = TYPE_BIN; break;
case 'P': type = TYPE_PCHAR; break;
- } // endswitch type
+ } // endswitch type
return type;
- } // end of GetFormatType
+} // end of GetFormatType
/***********************************************************************/
/* IsTypeChar: returns true for character type(s). */
/***********************************************************************/
bool IsTypeChar(int type)
- {
+{
switch (type) {
case TYPE_STRING:
case TYPE_DECIM:
case TYPE_BIN:
return true;
- } // endswitch type
+ } // endswitch type
return false;
- } // end of IsTypeChar
+} // end of IsTypeChar
/***********************************************************************/
/* IsTypeNum: returns true for numeric types. */
/***********************************************************************/
bool IsTypeNum(int type)
- {
+{
switch (type) {
case TYPE_INT:
case TYPE_BIGINT:
@@ -258,16 +258,16 @@ bool IsTypeNum(int type)
case TYPE_TINY:
case TYPE_DECIM:
return true;
- } // endswitch type
+ } // endswitch type
return false;
- } // end of IsTypeNum
+} // end of IsTypeNum
/***********************************************************************/
/* GetFmt: returns the format to use with a typed value. */
/***********************************************************************/
const char *GetFmt(int type, bool un)
- {
+{
const char *fmt;
switch (type) {
@@ -278,10 +278,10 @@ const char *GetFmt(int type, bool un)
case TYPE_DOUBLE: fmt = "%.*lf"; break;
case TYPE_BIN: fmt = "%*x"; break;
default: fmt = (un) ? "%u" : "%d"; break;
- } // endswitch Type
+ } // endswitch Type
return fmt;
- } // end of GetFmt
+} // end of GetFmt
/***********************************************************************/
/* ConvertType: what this function does is to determine the type to */
@@ -293,7 +293,7 @@ const char *GetFmt(int type, bool un)
/* IsType... functions so match does not prevent correct setting. */
/***********************************************************************/
int ConvertType(int target, int type, CONV kind, bool match)
- {
+{
switch (kind) {
case CNV_CHAR:
if (match && (!IsTypeChar(target) || !IsTypeChar(type)))
@@ -326,15 +326,15 @@ int ConvertType(int target, int type, CONV kind, bool match)
: (target == TYPE_STRING || type == TYPE_STRING) ? TYPE_STRING
: (target == TYPE_TINY || type == TYPE_TINY) ? TYPE_TINY
: TYPE_ERROR;
- } // endswitch kind
+ } // endswitch kind
- } // end of ConvertType
+} // end of ConvertType
/***********************************************************************/
/* AllocateConstant: allocates a constant Value. */
/***********************************************************************/
PVAL AllocateValue(PGLOBAL g, void *value, short type, short prec)
- {
+{
PVAL valp;
if (trace(1))
@@ -362,18 +362,18 @@ PVAL AllocateValue(PGLOBAL g, void *value, short type, short prec)
default:
sprintf(g->Message, MSG(BAD_VALUE_TYPE), type);
return NULL;
- } // endswitch Type
+ } // endswitch Type
valp->SetGlobal(g);
return valp;
- } // end of AllocateValue
+} // end of AllocateValue
/***********************************************************************/
/* Allocate a variable Value according to type, length and precision. */
/***********************************************************************/
PVAL AllocateValue(PGLOBAL g, int type, int len, int prec,
bool uns, PCSZ fmt)
- {
+{
PVAL valp;
switch (type) {
@@ -423,18 +423,18 @@ PVAL AllocateValue(PGLOBAL g, int type, int len, int prec,
default:
sprintf(g->Message, MSG(BAD_VALUE_TYPE), type);
return NULL;
- } // endswitch type
+ } // endswitch type
valp->SetGlobal(g);
return valp;
- } // end of AllocateValue
+} // end of AllocateValue
/***********************************************************************/
/* Allocate a constant Value converted to newtype. */
/* Can also be used to copy a Value eventually converted. */
/***********************************************************************/
PVAL AllocateValue(PGLOBAL g, PVAL valp, int newtype, int uns)
- {
+{
PSZ p, sp;
bool un = (uns < 0) ? false : (uns > 0) ? true : valp->IsUnsigned();
PVAL vp;
@@ -495,13 +495,13 @@ PVAL AllocateValue(PGLOBAL g, PVAL valp, int newtype, int uns)
default:
sprintf(g->Message, MSG(BAD_VALUE_TYPE), newtype);
return NULL;
- } // endswitch type
+ } // endswitch type
vp->SetNullable(valp->GetNullable());
vp->SetNull(valp->IsNull());
vp->SetGlobal(g);
return vp;
- } // end of AllocateValue
+} // end of AllocateValue
/* -------------------------- Class VALUE ---------------------------- */
@@ -509,7 +509,7 @@ PVAL AllocateValue(PGLOBAL g, PVAL valp, int newtype, int uns)
/* Class VALUE protected constructor. */
/***********************************************************************/
VALUE::VALUE(int type, bool un) : Type(type)
- {
+{
Null = false;
Nullable = false;
Unsigned = un;
@@ -517,13 +517,13 @@ VALUE::VALUE(int type, bool un) : Type(type)
Prec = 0;
Fmt = GetFmt(Type, Unsigned);
Xfmt = GetXfmt();
- } // end of VALUE constructor
+} // end of VALUE constructor
/***********************************************************************/
/* VALUE GetXfmt: returns the extended format to use with typed value. */
/***********************************************************************/
const char *VALUE::GetXfmt(void)
- {
+{
const char *fmt;
switch (Type) {
@@ -537,7 +537,7 @@ const char *VALUE::GetXfmt(void)
} // endswitch Type
return fmt;
- } // end of GetFmt
+} // end of GetXFmt
/***********************************************************************/
/* Returns a BYTE indicating the comparison between two values. */
@@ -545,20 +545,20 @@ const char *VALUE::GetXfmt(void)
/* More than 1 bit can be set only in the case of TYPE_LIST. */
/***********************************************************************/
BYTE VALUE::TestValue(PVAL vp)
- {
+{
int n = CompareValue(vp);
return (n > 0) ? 0x04 : (n < 0) ? 0x02 : 0x01;
- } // end of TestValue
+} // end of TestValue
/***********************************************************************/
/* Compute a function on a string. */
/***********************************************************************/
bool VALUE::Compute(PGLOBAL g, PVAL *, int, OPVAL)
- {
+{
strcpy(g->Message, "Compute not implemented for this value type");
return true;
- } // end of Compute
+} // end of Compute
/***********************************************************************/
/* Make file output of an object value. */
@@ -600,11 +600,11 @@ void VALUE::Prints(PGLOBAL g, char *ps, uint z)
template <class TYPE>
TYPVAL<TYPE>::TYPVAL(TYPE n, int type, int prec, bool un)
: VALUE(type, un)
- {
+{
Tval = n;
Clen = sizeof(TYPE);
Prec = prec;
- } // end of TYPVAL constructor
+} // end of TYPVAL constructor
/***********************************************************************/
/* Return unsigned max value for the type. */
@@ -641,19 +641,19 @@ ulonglong TYPVAL<ulonglong>::MaxVal(void) {return ULONGLONG_MAX;}
/***********************************************************************/
template <class TYPE>
int TYPVAL<TYPE>::GetValLen(void)
- {
+{
char c[32];
- return sprintf(c, Fmt, Tval);
- } // end of GetValLen
+ return snprintf(c, 32, Fmt, Tval);
+} // end of GetValLen
template <>
int TYPVAL<double>::GetValLen(void)
- {
+{
char c[32];
- return sprintf(c, Fmt, Prec, Tval);
- } // end of GetValLen
+ return snprintf(c, 32, Fmt, Prec, Tval);
+} // end of GetValLen
/***********************************************************************/
/* TYPVAL SetValue: copy the value of another Value object. */
@@ -661,7 +661,7 @@ int TYPVAL<double>::GetValLen(void)
/***********************************************************************/
template <class TYPE>
bool TYPVAL<TYPE>::SetValue_pval(PVAL valp, bool chktype)
- {
+{
if (valp != this) {
if (chktype && Type != valp->GetType())
return true;
@@ -671,10 +671,10 @@ bool TYPVAL<TYPE>::SetValue_pval(PVAL valp, bool chktype)
else
Reset();
- } // endif valp
+ } // endif valp
return false;
- } // end of SetValue
+} // end of SetValue
template <>
short TYPVAL<short>::GetTypedValue(PVAL valp)
@@ -717,7 +717,7 @@ uchar TYPVAL<uchar>::GetTypedValue(PVAL valp)
/***********************************************************************/
template <class TYPE>
bool TYPVAL<TYPE>::SetValue_char(const char *p, int n)
- {
+{
bool rc, minus;
ulonglong maxval = MaxVal();
ulonglong val = CharToNumber(p, n, maxval, Unsigned, &minus, &rc);
@@ -731,15 +731,15 @@ bool TYPVAL<TYPE>::SetValue_char(const char *p, int n)
char buf[64];
htrc(strcat(strcat(strcpy(buf, " setting %s to: "), Fmt), "\n"),
GetTypeName(Type), Tval);
- } // endif trace
+ } // endif trace
Null = false;
return rc;
- } // end of SetValue
+} // end of SetValue
template <>
bool TYPVAL<double>::SetValue_char(const char *p, int n)
- {
+{
if (p && n > 0) {
char buf[64];
@@ -760,14 +760,14 @@ bool TYPVAL<double>::SetValue_char(const char *p, int n)
} // endif p
return false;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* TYPVAL SetValue: fill a typed value from a string. */
/***********************************************************************/
template <class TYPE>
void TYPVAL<TYPE>::SetValue_psz(PCSZ s)
- {
+{
if (s) {
SetValue_char(s, (int)strlen(s));
Null = false;
@@ -776,17 +776,17 @@ void TYPVAL<TYPE>::SetValue_psz(PCSZ s)
Null = Nullable;
} // endif p
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* TYPVAL SetValue: set value with a TYPE extracted from a block. */
/***********************************************************************/
template <class TYPE>
void TYPVAL<TYPE>::SetValue_pvblk(PVBLK blk, int n)
- {
+{
Tval = GetTypedValue(blk, n);
Null = false;
- } // end of SetValue
+} // end of SetValue
template <>
int TYPVAL<int>::GetTypedValue(PVBLK blk, int n)
@@ -852,7 +852,7 @@ void TYPVAL<TYPE>::SetBinValue(void *p)
/***********************************************************************/
template <class TYPE>
bool TYPVAL<TYPE>::GetBinValue(void *buf, int buflen, bool go)
- {
+{
// Test on length was removed here until a variable in column give the
// real field length. For BIN files the field length logically cannot
// be different from the variable length because no conversion is done.
@@ -876,40 +876,41 @@ bool TYPVAL<TYPE>::GetBinValue(void *buf, int buflen, bool go)
Null = false;
return false;
- } // end of GetBinValue
+} // end of GetBinValue
/***********************************************************************/
/* TYPVAL ShowValue: get string representation of a typed value. */
/***********************************************************************/
template <class TYPE>
int TYPVAL<TYPE>::ShowValue(char *buf, int len)
- {
+{
return snprintf(buf, len + 1, Xfmt, len, Tval);
- } // end of ShowValue
+} // end of ShowValue
template <>
int TYPVAL<double>::ShowValue(char *buf, int len)
- {
+{
// TODO: use a more appropriate format to avoid possible truncation
return snprintf(buf, len + 1, Xfmt, len, Prec, Tval);
- } // end of ShowValue
+} // end of ShowValue
/***********************************************************************/
/* TYPVAL GetCharString: get string representation of a typed value. */
/***********************************************************************/
template <class TYPE>
char *TYPVAL<TYPE>::GetCharString(char *p)
- {
+{
sprintf(p, Fmt, Tval);
return p;
- } // end of GetCharString
+} // end of GetCharString
template <>
char *TYPVAL<double>::GetCharString(char *p)
- {
- sprintf(p, Fmt, Prec, Tval);
+{
+ // Most callers use a 32 long buffer
+ snprintf(p, 32, Fmt, Prec, Tval);
return p;
- } // end of GetCharString
+} // end of GetCharString
#if 0
/***********************************************************************/
@@ -917,50 +918,50 @@ char *TYPVAL<double>::GetCharString(char *p)
/***********************************************************************/
template <class TYPE>
char *TYPVAL<TYPE>::GetShortString(char *p, int n)
- {
+{
sprintf(p, "%*hd", n, (short)Tval);
return p;
- } // end of GetShortString
+} // end of GetShortString
/***********************************************************************/
/* TYPVAL GetIntString: get int representation of a typed value. */
/***********************************************************************/
template <class TYPE>
char *TYPVAL<TYPE>::GetIntString(char *p, int n)
- {
+{
sprintf(p, "%*d", n, (int)Tval);
return p;
- } // end of GetIntString
+} // end of GetIntString
/***********************************************************************/
/* TYPVAL GetBigintString: get big int representation of a TYPE value.*/
/***********************************************************************/
template <class TYPE>
char *TYPVAL<TYPE>::GetBigintString(char *p, int n)
- {
+{
sprintf(p, "%*lld", n, (longlong)Tval);
return p;
- } // end of GetBigintString
+} // end of GetBigintString
/***********************************************************************/
/* TYPVAL GetFloatString: get double representation of a typed value. */
/***********************************************************************/
template <class TYPE>
char *TYPVAL<TYPE>::GetFloatString(char *p, int n, int prec)
- {
+{
sprintf(p, "%*.*lf", n, (prec < 0) ? 2 : prec, (double)Tval);
return p;
- } // end of GetFloatString
+} // end of GetFloatString
/***********************************************************************/
/* TYPVAL GetTinyString: get char representation of a typed value. */
/***********************************************************************/
template <class TYPE>
char *TYPVAL<TYPE>::GetTinyString(char *p, int n)
- {
+{
sprintf(p, "%*d", n, (int)(char)Tval);
return p;
- } // end of GetIntString
+} // end of GetIntString
#endif // 0
/***********************************************************************/
@@ -968,7 +969,7 @@ char *TYPVAL<TYPE>::GetTinyString(char *p, int n)
/***********************************************************************/
template <class TYPE>
bool TYPVAL<TYPE>::IsEqual(PVAL vp, bool chktype)
- {
+{
if (this == vp)
return true;
else if (chktype && Type != vp->GetType())
@@ -980,7 +981,7 @@ bool TYPVAL<TYPE>::IsEqual(PVAL vp, bool chktype)
else
return (Tval == GetTypedValue(vp));
- } // end of IsEqual
+} // end of IsEqual
/***********************************************************************/
/* Compare values and returns 1, 0 or -1 according to comparison. */
@@ -988,7 +989,7 @@ bool TYPVAL<TYPE>::IsEqual(PVAL vp, bool chktype)
/***********************************************************************/
template <class TYPE>
int TYPVAL<TYPE>::CompareValue(PVAL vp)
- {
+{
//assert(vp->GetType() == Type);
// Process filtering on numeric values.
@@ -998,7 +999,7 @@ int TYPVAL<TYPE>::CompareValue(PVAL vp)
// htrc(" Comparing: val=%d,%d\n", Tval, n);
return (Tval > n) ? 1 : (Tval < n) ? (-1) : 0;
- } // end of CompareValue
+} // end of CompareValue
/***********************************************************************/
/* Return max type value if b is true, else min type value. */
@@ -1044,7 +1045,7 @@ uchar TYPVAL<uchar>::MinMaxVal(bool b)
/***********************************************************************/
template <class TYPE>
TYPE TYPVAL<TYPE>::SafeAdd(TYPE n1, TYPE n2)
- {
+{
PGLOBAL& g = Global;
TYPE n = n1 + n2;
@@ -1059,20 +1060,20 @@ TYPE TYPVAL<TYPE>::SafeAdd(TYPE n1, TYPE n2)
} // endif's n2
return n;
- } // end of SafeAdd
+} // end of SafeAdd
template <>
inline double TYPVAL<double>::SafeAdd(double n1, double n2)
- {
+{
return n1 + n2;
- } // end of SafeAdd
+} // end of SafeAdd
/***********************************************************************/
/* SafeMult: multiply values and test whether overflow occurred. */
/***********************************************************************/
template <class TYPE>
TYPE TYPVAL<TYPE>::SafeMult(TYPE n1, TYPE n2)
- {
+{
PGLOBAL& g = Global;
double n = (double)n1 * (double)n2;
@@ -1087,20 +1088,20 @@ TYPE TYPVAL<TYPE>::SafeMult(TYPE n1, TYPE n2)
} // endif's n2
return (TYPE)n;
- } // end of SafeMult
+} // end of SafeMult
template <>
inline double TYPVAL<double>::SafeMult(double n1, double n2)
- {
+{
return n1 * n2;
- } // end of SafeMult
+} // end of SafeMult
/***********************************************************************/
/* Compute defined functions for the type. */
/***********************************************************************/
template <class TYPE>
bool TYPVAL<TYPE>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
- {
+{
bool rc = false;
TYPE val[2];
@@ -1127,14 +1128,14 @@ bool TYPVAL<TYPE>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
default:
rc = Compall(g, vp, np, op);
break;
- } // endswitch op
+ } // endswitch op
return rc;
- } // end of Compute
+} // end of Compute
template <>
bool TYPVAL<double>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
- {
+{
bool rc = false;
double val[2];
@@ -1152,17 +1153,17 @@ bool TYPVAL<double>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
break;
default:
rc = Compall(g, vp, np, op);
- } // endswitch op
+ } // endswitch op
return rc;
- } // end of Compute
+} // end of Compute
/***********************************************************************/
/* Compute a function for all types. */
/***********************************************************************/
template <class TYPE>
bool TYPVAL<TYPE>::Compall(PGLOBAL g, PVAL *vp, int np, OPVAL op)
- {
+{
TYPE val[2];
for (int i = 0; i < np; i++)
@@ -1191,10 +1192,10 @@ bool TYPVAL<TYPE>::Compall(PGLOBAL g, PVAL *vp, int np, OPVAL op)
// sprintf(g->Message, MSG(BAD_EXP_OPER), op);
strcpy(g->Message, "Function not supported");
return true;
- } // endswitch op
+ } // endswitch op
return false;
- } // end of Compall
+} // end of Compall
/***********************************************************************/
/* FormatValue: This function set vp (a STRING value) to the string */
@@ -1203,26 +1204,28 @@ bool TYPVAL<TYPE>::Compall(PGLOBAL g, PVAL *vp, int np, OPVAL op)
/***********************************************************************/
template <class TYPE>
bool TYPVAL<TYPE>::FormatValue(PVAL vp, PCSZ fmt)
- {
- char *buf = (char*)vp->GetTo_Val(); // Should be big enough
+{
+ // This function is wrong and should never be called
+ assert(false);
+ char *buf = (char*)vp->GetTo_Val(); // Not big enough
int n = sprintf(buf, fmt, Tval);
return (n > vp->GetValLen());
- } // end of FormatValue
+} // end of FormatValue
/***********************************************************************/
/* TYPVAL SetFormat function (used to set SELECT output format). */
/***********************************************************************/
template <class TYPE>
bool TYPVAL<TYPE>::SetConstFormat(PGLOBAL g, FORMAT& fmt)
- {
+{
char c[32];
fmt.Type[0] = *GetFormatType(Type);
fmt.Length = sprintf(c, Fmt, Tval);
fmt.Prec = Prec;
return false;
- } // end of SetConstFormat
+} // end of SetConstFormat
/* -------------------------- Class STRING --------------------------- */
@@ -1230,19 +1233,19 @@ bool TYPVAL<TYPE>::SetConstFormat(PGLOBAL g, FORMAT& fmt)
/* STRING public constructor from a constant string. */
/***********************************************************************/
TYPVAL<PSZ>::TYPVAL(PSZ s, short c) : VALUE(TYPE_STRING)
- {
+{
Strp = s;
Len = strlen(s);
Clen = Len;
Ci = (c == 1);
- } // end of STRING constructor
+} // end of STRING constructor
/***********************************************************************/
/* STRING public constructor from char. */
/***********************************************************************/
TYPVAL<PSZ>::TYPVAL(PGLOBAL g, PSZ s, int n, int c)
: VALUE(TYPE_STRING)
- {
+{
Len = (g) ? n : (s) ? strlen(s) : 0;
if (!s) {
@@ -1260,89 +1263,89 @@ TYPVAL<PSZ>::TYPVAL(PGLOBAL g, PSZ s, int n, int c)
Clen = Len;
Ci = (c != 0);
- } // end of STRING constructor
+} // end of STRING constructor
/***********************************************************************/
/* Get the tiny value represented by the Strp string. */
/***********************************************************************/
char TYPVAL<PSZ>::GetTinyValue(void)
- {
+{
bool m;
ulonglong val = CharToNumber(Strp, strlen(Strp), INT_MAX8, false, &m);
return (m && val < INT_MAX8) ? (char)(-(signed)val) : (char)val;
- } // end of GetTinyValue
+} // end of GetTinyValue
/***********************************************************************/
/* Get the unsigned tiny value represented by the Strp string. */
/***********************************************************************/
uchar TYPVAL<PSZ>::GetUTinyValue(void)
- {
+{
return (uchar)CharToNumber(Strp, strlen(Strp), UINT_MAX8, true);
- } // end of GetUTinyValue
+} // end of GetUTinyValue
/***********************************************************************/
/* Get the short value represented by the Strp string. */
/***********************************************************************/
short TYPVAL<PSZ>::GetShortValue(void)
- {
+{
bool m;
ulonglong val = CharToNumber(Strp, strlen(Strp), INT_MAX16, false, &m);
return (m && val < INT_MAX16) ? (short)(-(signed)val) : (short)val;
- } // end of GetShortValue
+} // end of GetShortValue
/***********************************************************************/
/* Get the unsigned short value represented by the Strp string. */
/***********************************************************************/
ushort TYPVAL<PSZ>::GetUShortValue(void)
- {
+{
return (ushort)CharToNumber(Strp, strlen(Strp), UINT_MAX16, true);
- } // end of GetUshortValue
+} // end of GetUshortValue
/***********************************************************************/
/* Get the integer value represented by the Strp string. */
/***********************************************************************/
int TYPVAL<PSZ>::GetIntValue(void)
- {
+{
bool m;
ulonglong val = CharToNumber(Strp, strlen(Strp), INT_MAX32, false, &m);
return (m && val < INT_MAX32) ? (int)(-(signed)val) : (int)val;
- } // end of GetIntValue
+} // end of GetIntValue
/***********************************************************************/
/* Get the unsigned integer value represented by the Strp string. */
/***********************************************************************/
uint TYPVAL<PSZ>::GetUIntValue(void)
- {
+{
return (uint)CharToNumber(Strp, strlen(Strp), UINT_MAX32, true);
- } // end of GetUintValue
+} // end of GetUintValue
/***********************************************************************/
/* Get the big integer value represented by the Strp string. */
/***********************************************************************/
longlong TYPVAL<PSZ>::GetBigintValue(void)
- {
+{
bool m;
ulonglong val = CharToNumber(Strp, strlen(Strp), INT_MAX64, false, &m);
return (m && val < INT_MAX64) ? (-(signed)val) : (longlong)val;
- } // end of GetBigintValue
+} // end of GetBigintValue
/***********************************************************************/
/* Get the unsigned big integer value represented by the Strp string. */
/***********************************************************************/
ulonglong TYPVAL<PSZ>::GetUBigintValue(void)
- {
+{
return CharToNumber(Strp, strlen(Strp), ULONGLONG_MAX, true);
- } // end of GetUBigintValue
+} // end of GetUBigintValue
/***********************************************************************/
/* STRING SetValue: copy the value of another Value object. */
/***********************************************************************/
bool TYPVAL<PSZ>::SetValue_pval(PVAL valp, bool chktype)
- {
+{
if (valp != this) {
if (chktype && (valp->GetType() != Type || valp->GetSize() > Len))
return true;
@@ -1354,16 +1357,16 @@ bool TYPVAL<PSZ>::SetValue_pval(PVAL valp, bool chktype)
else
Reset();
- } // endif valp
+ } // endif valp
return false;
- } // end of SetValue_pval
+} // end of SetValue_pval
/***********************************************************************/
/* STRING SetValue: fill string with chars extracted from a line. */
/***********************************************************************/
bool TYPVAL<PSZ>::SetValue_char(const char *cp, int n)
- {
+{
bool rc = false;
if (!cp || n == 0) {
@@ -1389,16 +1392,16 @@ bool TYPVAL<PSZ>::SetValue_char(const char *cp, int n)
Reset();
Null = false;
- } // endif p
+ } // endif cp
return rc;
- } // end of SetValue_char
+} // end of SetValue_char
/***********************************************************************/
/* STRING SetValue: fill string with another string. */
/***********************************************************************/
void TYPVAL<PSZ>::SetValue_psz(PCSZ s)
- {
+{
if (!s) {
Reset();
Null = Nullable;
@@ -1407,26 +1410,26 @@ void TYPVAL<PSZ>::SetValue_psz(PCSZ s)
Null = false;
} // endif s
- } // end of SetValue_psz
+} // end of SetValue_psz
/***********************************************************************/
/* STRING SetValue: fill string with a string extracted from a block. */
/***********************************************************************/
void TYPVAL<PSZ>::SetValue_pvblk(PVBLK blk, int n)
- {
+{
// STRBLK's can return a NULL pointer
PSZ vp = blk->GetCharString(Strp, n);
if (vp != Strp)
SetValue_psz(vp);
- } // end of SetValue_pvblk
+} // end of SetValue_pvblk
/***********************************************************************/
/* STRING SetValue: get the character representation of an integer. */
/***********************************************************************/
void TYPVAL<PSZ>::SetValue(int n)
- {
+{
char buf[16];
PGLOBAL& g = Global;
int k = sprintf(buf, "%d", n);
@@ -1438,13 +1441,13 @@ void TYPVAL<PSZ>::SetValue(int n)
SetValue_psz(buf);
Null = false;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* STRING SetValue: get the character representation of an uint. */
/***********************************************************************/
void TYPVAL<PSZ>::SetValue(uint n)
- {
+{
char buf[16];
PGLOBAL& g = Global;
int k = sprintf(buf, "%u", n);
@@ -1456,31 +1459,31 @@ void TYPVAL<PSZ>::SetValue(uint n)
SetValue_psz(buf);
Null = false;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* STRING SetValue: get the character representation of a short int. */
/***********************************************************************/
void TYPVAL<PSZ>::SetValue(short i)
- {
+{
SetValue((int)i);
Null = false;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* STRING SetValue: get the character representation of a ushort int. */
/***********************************************************************/
void TYPVAL<PSZ>::SetValue(ushort i)
- {
+{
SetValue((uint)i);
Null = false;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* STRING SetValue: get the character representation of a big integer.*/
/***********************************************************************/
void TYPVAL<PSZ>::SetValue(longlong n)
- {
+{
char buf[24];
PGLOBAL& g = Global;
int k = sprintf(buf, "%lld", n);
@@ -1492,13 +1495,13 @@ void TYPVAL<PSZ>::SetValue(longlong n)
SetValue_psz(buf);
Null = false;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* STRING SetValue: get the character representation of a big integer.*/
/***********************************************************************/
void TYPVAL<PSZ>::SetValue(ulonglong n)
- {
+{
char buf[24];
PGLOBAL& g = Global;
int k = sprintf(buf, "%llu", n);
@@ -1510,13 +1513,13 @@ void TYPVAL<PSZ>::SetValue(ulonglong n)
SetValue_psz(buf);
Null = false;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* STRING SetValue: get the character representation of a double. */
/***********************************************************************/
void TYPVAL<PSZ>::SetValue(double f)
- {
+{
char *p, buf[64];
PGLOBAL& g = Global;
int k = sprintf(buf, "%lf", f);
@@ -1535,33 +1538,33 @@ void TYPVAL<PSZ>::SetValue(double f)
SetValue_psz(buf);
Null = false;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* STRING SetValue: get the character representation of a tiny int. */
/***********************************************************************/
void TYPVAL<PSZ>::SetValue(char c)
- {
+{
SetValue((int)c);
Null = false;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* STRING SetValue: get the character representation of a tiny int. */
/***********************************************************************/
void TYPVAL<PSZ>::SetValue(uchar c)
- {
+{
SetValue((uint)c);
Null = false;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* STRING SetBinValue: fill string with chars extracted from a line. */
/***********************************************************************/
void TYPVAL<PSZ>::SetBinValue(void *p)
- {
+{
SetValue_char((const char *)p, Len);
- } // end of SetBinValue
+} // end of SetBinValue
/***********************************************************************/
/* GetBinValue: fill a buffer with the internal binary value. */
@@ -1570,7 +1573,7 @@ void TYPVAL<PSZ>::SetBinValue(void *p)
/* Currently used by WriteColumn of binary files. */
/***********************************************************************/
bool TYPVAL<PSZ>::GetBinValue(void *buf, int buflen, bool go)
- {
+{
int len = (Null) ? 0 : strlen(Strp);
if (len > buflen)
@@ -1581,7 +1584,7 @@ bool TYPVAL<PSZ>::GetBinValue(void *buf, int buflen, bool go)
} // endif go
return false;
- } // end of GetBinValue
+} // end of GetBinValue
/***********************************************************************/
/* STRING ShowValue: get string representation of a char value. */
@@ -1591,7 +1594,7 @@ int TYPVAL<PSZ>::ShowValue(char *buf, int buflen)
int len = (Null) ? 0 : strlen(Strp);
if (buf && buf != Strp) {
- memset(buf, ' ', buflen + 1);
+ memset(buf, ' ', (size_t)buflen + 1);
memcpy(buf, Strp, MY_MIN(len, buflen));
} // endif buf
@@ -1602,15 +1605,15 @@ int TYPVAL<PSZ>::ShowValue(char *buf, int buflen)
/* STRING GetCharString: get string representation of a char value. */
/***********************************************************************/
char *TYPVAL<PSZ>::GetCharString(char *)
- {
+{
return Strp;
- } // end of GetCharString
+} // end of GetCharString
/***********************************************************************/
/* STRING compare value with another Value. */
/***********************************************************************/
bool TYPVAL<PSZ>::IsEqual(PVAL vp, bool chktype)
- {
+{
if (this == vp)
return true;
else if (chktype && Type != vp->GetType())
@@ -1625,14 +1628,14 @@ bool TYPVAL<PSZ>::IsEqual(PVAL vp, bool chktype)
else // (!Ci)
return !strcmp(Strp, vp->GetCharString(buf));
- } // end of IsEqual
+} // end of IsEqual
/***********************************************************************/
/* Compare values and returns 1, 0 or -1 according to comparison. */
/* This function is used for evaluation of numeric filters. */
/***********************************************************************/
int TYPVAL<PSZ>::CompareValue(PVAL vp)
- {
+{
int n;
//assert(vp->GetType() == Type);
@@ -1651,13 +1654,13 @@ int TYPVAL<PSZ>::CompareValue(PVAL vp)
#endif // __WIN__
return (n > 0) ? 1 : (n < 0) ? -1 : 0;
- } // end of CompareValue
+} // end of CompareValue
/***********************************************************************/
/* Compute a function on a string. */
/***********************************************************************/
bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
- {
+{
char *p[2], val[2][32];
int i;
@@ -1704,7 +1707,7 @@ bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
Null = false;
return false;
- } // end of Compute
+} // end of Compute
/***********************************************************************/
/* FormatValue: This function set vp (a STRING value) to the string */
@@ -1712,23 +1715,23 @@ bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
/* This function assumes that the format matches the value type. */
/***********************************************************************/
bool TYPVAL<PSZ>::FormatValue(PVAL vp, PCSZ fmt)
- {
+{
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
int n = sprintf(buf, fmt, Strp);
return (n > vp->GetValLen());
- } // end of FormatValue
+} // end of FormatValue
/***********************************************************************/
/* STRING SetFormat function (used to set SELECT output format). */
/***********************************************************************/
bool TYPVAL<PSZ>::SetConstFormat(PGLOBAL, FORMAT& fmt)
- {
+{
fmt.Type[0] = 'C';
fmt.Length = Len;
fmt.Prec = 0;
return false;
- } // end of SetConstFormat
+} // end of SetConstFormat
/***********************************************************************/
/* Make string output of an object value. */
@@ -1748,38 +1751,38 @@ void TYPVAL<PSZ>::Prints(PGLOBAL g, char *ps, uint z)
/* DECIMAL public constructor from a constant string. */
/***********************************************************************/
DECVAL::DECVAL(PSZ s) : TYPVAL<PSZ>(s)
- {
+{
if (s) {
char *p = strchr(Strp, '.');
Prec = (p) ? (int)(Len - (p - Strp)) : 0;
- } // endif s
+ } // endif s
Type = TYPE_DECIM;
- } // end of DECVAL constructor
+} // end of DECVAL constructor
/***********************************************************************/
/* DECIMAL public constructor from char. */
/***********************************************************************/
DECVAL::DECVAL(PGLOBAL g, PSZ s, int n, int prec, bool uns)
: TYPVAL<PSZ>(g, s, n + (prec ? 1 : 0) + (uns ? 0 : 1), 0)
- {
+{
Prec = prec;
Unsigned = uns;
Type = TYPE_DECIM;
- } // end of DECVAL constructor
+} // end of DECVAL constructor
/***********************************************************************/
/* DECIMAL: Check whether the numerica value is equal to 0. */
/***********************************************************************/
bool DECVAL::IsZero(void)
- {
+{
for (int i = 0; Strp[i]; i++)
if (!strchr("0 +-.", Strp[i]))
return false;
return true;
- } // end of IsZero
+} // end of IsZero
/***********************************************************************/
/* DECIMAL: Reset value to zero. */
@@ -1797,7 +1800,7 @@ void DECVAL::Reset(void)
Strp[i++] = '0';
} while (i < Prec + 2);
- } // endif Prec
+ } // endif Prec
Strp[i] = 0;
} // end of Reset
@@ -1806,9 +1809,9 @@ void DECVAL::Reset(void)
/* DECIMAL ShowValue: get string representation right justified. */
/***********************************************************************/
int DECVAL::ShowValue(char *buf, int len)
- {
+{
return snprintf(buf, len + 1, Xfmt, len, Strp);
- } // end of ShowValue
+} // end of ShowValue
/***********************************************************************/
/* GetBinValue: fill a buffer with the internal binary value. */
@@ -1817,7 +1820,7 @@ int DECVAL::ShowValue(char *buf, int len)
/* Currently used by WriteColumn of binary files. */
/***********************************************************************/
bool DECVAL::GetBinValue(void *buf, int buflen, bool go)
- {
+{
int len = (Null) ? 0 : strlen(Strp);
if (len > buflen)
@@ -1825,16 +1828,16 @@ bool DECVAL::GetBinValue(void *buf, int buflen, bool go)
else if (go) {
memset(buf, ' ', buflen - len);
memcpy((char*)buf + buflen - len, Strp, len);
- } // endif go
+ } // endif go
return false;
- } // end of GetBinValue
+} // end of GetBinValue
/***********************************************************************/
/* DECIMAL compare value with another Value. */
/***********************************************************************/
bool DECVAL::IsEqual(PVAL vp, bool chktype)
- {
+{
if (this == vp)
return true;
else if (chktype && Type != vp->GetType())
@@ -1845,14 +1848,14 @@ bool DECVAL::IsEqual(PVAL vp, bool chktype)
char buf[64];
return !strcmp(Strp, vp->GetCharString(buf));
- } // end of IsEqual
+} // end of IsEqual
/***********************************************************************/
/* Compare values and returns 1, 0 or -1 according to comparison. */
/* This function is used for evaluation of numeric filters. */
/***********************************************************************/
int DECVAL::CompareValue(PVAL vp)
- {
+{
//assert(vp->GetType() == Type);
// Process filtering on numeric values.
@@ -1862,7 +1865,7 @@ int DECVAL::CompareValue(PVAL vp)
// htrc(" Comparing: val=%d,%d\n", f, n);
return (f > n) ? 1 : (f < n) ? (-1) : 0;
- } // end of CompareValue
+} // end of CompareValue
/* -------------------------- Class BINVAL --------------------------- */
@@ -1870,7 +1873,7 @@ int DECVAL::CompareValue(PVAL vp)
/* BINVAL public constructor from bytes. */
/***********************************************************************/
BINVAL::BINVAL(PGLOBAL g, void *p, int cl, int n) : VALUE(TYPE_BIN)
- {
+{
assert(g);
Len = n;
Clen = cl;
@@ -1881,19 +1884,19 @@ BINVAL::BINVAL(PGLOBAL g, void *p, int cl, int n) : VALUE(TYPE_BIN)
memcpy(Binp, p, MY_MIN(Len,Clen));
Chrp = NULL;
- } // end of BINVAL constructor
+} // end of BINVAL constructor
/***********************************************************************/
/* BINVAL: Check whether the hexadecimal value is equal to 0. */
/***********************************************************************/
bool BINVAL::IsZero(void)
- {
+{
for (int i = 0; i < Len; i++)
if (((char*)Binp)[i] != 0)
return false;
return true;
- } // end of IsZero
+} // end of IsZero
/***********************************************************************/
/* BINVAL: Reset value to zero. */
@@ -1908,77 +1911,77 @@ void BINVAL::Reset(void)
/* Get the tiny value pointed by Binp. */
/***********************************************************************/
char BINVAL::GetTinyValue(void)
- {
+{
return *(char*)Binp;
- } // end of GetTinyValue
+} // end of GetTinyValue
/***********************************************************************/
/* Get the unsigned tiny value pointed by Binp. */
/***********************************************************************/
uchar BINVAL::GetUTinyValue(void)
- {
+{
return *(uchar*)Binp;
- } // end of GetUTinyValue
+} // end of GetUTinyValue
/***********************************************************************/
/* Get the short value pointed by Binp. */
/***********************************************************************/
short BINVAL::GetShortValue(void)
- {
+{
if (Len >= 2)
return *(short*)Binp;
else
return (short)GetTinyValue();
- } // end of GetShortValue
+} // end of GetShortValue
/***********************************************************************/
/* Get the unsigned short value pointed by Binp. */
/***********************************************************************/
ushort BINVAL::GetUShortValue(void)
- {
+{
return (ushort)GetShortValue();
- } // end of GetUshortValue
+} // end of GetUshortValue
/***********************************************************************/
/* Get the integer value pointed by Binp. */
/***********************************************************************/
int BINVAL::GetIntValue(void)
- {
+{
if (Len >= 4)
return *(int*)Binp;
else
return (int)GetShortValue();
- } // end of GetIntValue
+} // end of GetIntValue
/***********************************************************************/
/* Get the unsigned integer value pointed by Binp. */
/***********************************************************************/
uint BINVAL::GetUIntValue(void)
- {
+{
return (uint)GetIntValue();
- } // end of GetUintValue
+} // end of GetUintValue
/***********************************************************************/
/* Get the big integer value pointed by Binp. */
/***********************************************************************/
longlong BINVAL::GetBigintValue(void)
- {
+{
if (Len >= 8)
return *(longlong*)Binp;
else
return (longlong)GetIntValue();
- } // end of GetBigintValue
+} // end of GetBigintValue
/***********************************************************************/
/* Get the unsigned big integer value pointed by Binp. */
/***********************************************************************/
ulonglong BINVAL::GetUBigintValue(void)
- {
+{
return (ulonglong)GetBigintValue();
- } // end of GetUBigintValue
+} // end of GetUBigintValue
/***********************************************************************/
/* Get the double value pointed by Binp. */
@@ -1998,7 +2001,7 @@ double BINVAL::GetFloatValue(void)
/* BINVAL SetValue: copy the value of another Value object. */
/***********************************************************************/
bool BINVAL::SetValue_pval(PVAL valp, bool chktype)
- {
+{
bool rc = false;
if (valp != this) {
@@ -2018,16 +2021,16 @@ bool BINVAL::SetValue_pval(PVAL valp, bool chktype)
} else
Reset();
- } // endif valp
+ } // endif valp
return rc;
- } // end of SetValue_pval
+} // end of SetValue_pval
/***********************************************************************/
/* BINVAL SetValue: fill value with chars extracted from a line. */
/***********************************************************************/
bool BINVAL::SetValue_char(const char *p, int n)
- {
+{
bool rc;
if (p && n > 0) {
@@ -2047,13 +2050,13 @@ bool BINVAL::SetValue_char(const char *p, int n)
} // endif p
return rc;
- } // end of SetValue_char
+} // end of SetValue_char
/***********************************************************************/
/* BINVAL SetValue: fill value with another string. */
/***********************************************************************/
void BINVAL::SetValue_psz(PCSZ s)
- {
+{
if (s) {
int len = Len;
@@ -2068,13 +2071,13 @@ void BINVAL::SetValue_psz(PCSZ s)
Null = Nullable;
} // endif s
- } // end of SetValue_psz
+} // end of SetValue_psz
/***********************************************************************/
/* BINVAL SetValue: fill value with bytes extracted from a block. */
/***********************************************************************/
void BINVAL::SetValue_pvblk(PVBLK blk, int n)
- {
+{
// STRBLK's can return a NULL pointer
void *vp = blk->GetValPtrEx(n);
@@ -2097,13 +2100,13 @@ void BINVAL::SetValue_pvblk(PVBLK blk, int n)
Null = false;
} // endif vp
- } // end of SetValue_pvblk
+} // end of SetValue_pvblk
/***********************************************************************/
/* BINVAL SetValue: get the binary representation of an integer. */
/***********************************************************************/
void BINVAL::SetValue(int n)
- {
+{
if (Clen >= 4) {
if (Len > 4)
memset(Binp, 0, Len);
@@ -2113,13 +2116,13 @@ void BINVAL::SetValue(int n)
} else
SetValue((short)n);
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* BINVAL SetValue: get the binary representation of an uint. */
/***********************************************************************/
void BINVAL::SetValue(uint n)
- {
+{
if (Clen >= 4) {
if (Len > 4)
memset(Binp, 0, Len);
@@ -2129,13 +2132,13 @@ void BINVAL::SetValue(uint n)
} else
SetValue((ushort)n);
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* BINVAL SetValue: get the binary representation of a short int. */
/***********************************************************************/
void BINVAL::SetValue(short i)
- {
+{
if (Clen >= 2) {
if (Len > 2)
memset(Binp, 0, Len);
@@ -2145,13 +2148,13 @@ void BINVAL::SetValue(short i)
} else
SetValue((char)i);
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* BINVAL SetValue: get the binary representation of a ushort int. */
/***********************************************************************/
void BINVAL::SetValue(ushort i)
- {
+{
if (Clen >= 2) {
if (Len > 2)
memset(Binp, 0, Len);
@@ -2161,13 +2164,13 @@ void BINVAL::SetValue(ushort i)
} else
SetValue((uchar)i);
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* BINVAL SetValue: get the binary representation of a big integer. */
/***********************************************************************/
void BINVAL::SetValue(longlong n)
- {
+{
if (Clen >= 8) {
if (Len > 8)
memset(Binp, 0, Len);
@@ -2177,13 +2180,13 @@ void BINVAL::SetValue(longlong n)
} else
SetValue((int)n);
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* BINVAL SetValue: get the binary representation of a big integer. */
/***********************************************************************/
void BINVAL::SetValue(ulonglong n)
- {
+{
if (Clen >= 8) {
if (Len > 8)
memset(Binp, 0, Len);
@@ -2192,13 +2195,14 @@ void BINVAL::SetValue(ulonglong n)
Len = 8;
} else
SetValue((uint)n);
- } // end of SetValue
+
+} // end of SetValue
/***********************************************************************/
/* BINVAL SetValue: get the binary representation of a double. */
/***********************************************************************/
void BINVAL::SetValue(double n)
- {
+{
if (Len > 8)
memset(Binp, 0, Len);
@@ -2211,40 +2215,40 @@ void BINVAL::SetValue(double n)
} else
Len = 0;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* BINVAL SetValue: get the character binary of a tiny int. */
/***********************************************************************/
void BINVAL::SetValue(char c)
- {
+{
if (Len > 1)
memset(Binp, 0, Len);
*((char*)Binp) = c;
Len = 1;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* BINVAL SetValue: get the binary representation of a tiny int. */
/***********************************************************************/
void BINVAL::SetValue(uchar c)
- {
+{
if (Len > 1)
memset(Binp, 0, Len);
*((uchar*)Binp) = c;
Len = 1;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* BINVAL SetBinValue: fill string with bytes extracted from a line. */
/***********************************************************************/
void BINVAL::SetBinValue(void *p)
- {
+{
memcpy(Binp, p, Clen);
Len = Clen;
- } // end of SetBinValue
+} // end of SetBinValue
/***********************************************************************/
/* GetBinValue: fill a buffer with the internal binary value. */
@@ -2253,7 +2257,7 @@ void BINVAL::SetBinValue(void *p)
/* Currently used by WriteColumn of binary files. */
/***********************************************************************/
bool BINVAL::GetBinValue(void *buf, int buflen, bool go)
- {
+{
if (Len > buflen)
return true;
else if (go) {
@@ -2262,7 +2266,7 @@ bool BINVAL::GetBinValue(void *buf, int buflen, bool go)
} // endif go
return false;
- } // end of GetBinValue
+} // end of GetBinValue
/***********************************************************************/
/* BINVAL ShowValue: get string representation of a binary value. */
@@ -2278,19 +2282,19 @@ int BINVAL::ShowValue(char *buf, int len)
/* BINVAL GetCharString: get string representation of a binary value. */
/***********************************************************************/
char *BINVAL::GetCharString(char *)
- {
+{
if (!Chrp)
Chrp = (char*)PlugSubAlloc(Global, NULL, Clen * 2 + 1);
sprintf(Chrp, GetXfmt(), Len, Binp);
return Chrp;
- } // end of GetCharString
+} // end of GetCharString
/***********************************************************************/
/* BINVAL compare value with another Value. */
/***********************************************************************/
bool BINVAL::IsEqual(PVAL vp, bool chktype)
- {
+{
if (this == vp)
return true;
else if (chktype && Type != vp->GetType())
@@ -2308,7 +2312,7 @@ bool BINVAL::IsEqual(PVAL vp, bool chktype)
return false;
return true;
- } // end of IsEqual
+} // end of IsEqual
/***********************************************************************/
/* FormatValue: This function set vp (a STRING value) to the string */
@@ -2316,23 +2320,23 @@ bool BINVAL::IsEqual(PVAL vp, bool chktype)
/* This function assumes that the format matches the value type. */
/***********************************************************************/
bool BINVAL::FormatValue(PVAL vp, PCSZ fmt)
- {
+{
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
int n = sprintf(buf, fmt, Len, Binp);
return (n > vp->GetValLen());
- } // end of FormatValue
+} // end of FormatValue
/***********************************************************************/
/* BINVAL SetFormat function (used to set SELECT output format). */
/***********************************************************************/
bool BINVAL::SetConstFormat(PGLOBAL, FORMAT& fmt)
- {
+{
fmt.Type[0] = 'B';
fmt.Length = Clen;
fmt.Prec = 0;
return false;
- } // end of SetConstFormat
+} // end of SetConstFormat
/* -------------------------- Class DTVAL ---------------------------- */
@@ -2341,7 +2345,7 @@ bool BINVAL::SetConstFormat(PGLOBAL, FORMAT& fmt)
/***********************************************************************/
DTVAL::DTVAL(PGLOBAL g, int n, int prec, PCSZ fmt)
: TYPVAL<int>((int)0, TYPE_DATE)
- {
+{
if (!fmt) {
Pdtp = NULL;
Sdate = NULL;
@@ -2351,37 +2355,37 @@ DTVAL::DTVAL(PGLOBAL g, int n, int prec, PCSZ fmt)
SetFormat(g, fmt, n, prec);
//Type = TYPE_DATE;
- } // end of DTVAL constructor
+} // end of DTVAL constructor
/***********************************************************************/
/* DTVAL public constructor from int. */
/***********************************************************************/
DTVAL::DTVAL(int n) : TYPVAL<int>(n, TYPE_DATE)
- {
+{
Pdtp = NULL;
Len = 19;
//Type = TYPE_DATE;
Sdate = NULL;
DefYear = 0;
- } // end of DTVAL constructor
+} // end of DTVAL constructor
/***********************************************************************/
/* Set format so formatted dates can be converted on input/output. */
/***********************************************************************/
bool DTVAL::SetFormat(PGLOBAL g, PCSZ fmt, int len, int year)
- {
+{
Pdtp = MakeDateFormat(g, fmt, true, true, (year > 9999) ? 1 : 0);
Sdate = (char*)PlugSubAlloc(g, NULL, len + 1);
DefYear = (int)((year > 9999) ? (year - 10000) : year);
Len = len;
return false;
- } // end of SetFormat
+} // end of SetFormat
/***********************************************************************/
/* Set format from the format of another date value. */
/***********************************************************************/
bool DTVAL::SetFormat(PGLOBAL g, PVAL valp)
- {
+{
DTVAL *vp;
if (valp->GetType() != TYPE_DATE) {
@@ -2395,14 +2399,14 @@ bool DTVAL::SetFormat(PGLOBAL g, PVAL valp)
Sdate = (char*)PlugSubAlloc(g, NULL, Len + 1);
DefYear = vp->DefYear;
return false;
- } // end of SetFormat
+} // end of SetFormat
/***********************************************************************/
/* We need TimeShift because the mktime C function does a correction */
/* for local time zone that we want to override for DB operations. */
/***********************************************************************/
void DTVAL::SetTimeShift(void)
- {
+{
struct tm dtm;
memset(&dtm, 0, sizeof(dtm));
dtm.tm_mday=2;
@@ -2414,7 +2418,7 @@ void DTVAL::SetTimeShift(void)
if (trace(1))
htrc("DTVAL Shift=%d\n", Shift);
- } // end of SetTimeShift
+} // end of SetTimeShift
// Added by Alexander Barkov
static void TIME_to_localtime(struct tm *tm, const MYSQL_TIME *ltime)
@@ -2444,7 +2448,7 @@ static struct tm *gmtime_mysql(const time_t *timep, struct tm *tm)
/* extend the range of valid dates by accepting negative time values. */
/***********************************************************************/
struct tm *DTVAL::GetGmTime(struct tm *tm_buffer)
- {
+{
struct tm *datm;
time_t t = (time_t)Tval;
@@ -2463,7 +2467,7 @@ struct tm *DTVAL::GetGmTime(struct tm *tm_buffer)
datm = gmtime_mysql(&t, tm_buffer);
return datm;
- } // end of GetGmTime
+} // end of GetGmTime
// Added by Alexander Barkov
static time_t mktime_mysql(struct tm *ptm)
@@ -2482,7 +2486,7 @@ static time_t mktime_mysql(struct tm *ptm)
/* range of valid dates by accepting to set negative time values. */
/***********************************************************************/
bool DTVAL::MakeTime(struct tm *ptm)
- {
+{
int n, y = ptm->tm_year;
time_t t = mktime_mysql(ptm);
@@ -2498,7 +2502,7 @@ bool DTVAL::MakeTime(struct tm *ptm)
for (n = 0; t == -1 && n < 20; n++) {
ptm->tm_year += 4;
t = mktime_mysql(ptm);
- } // endfor t
+ } // endfor t
if (t == -1)
return true;
@@ -2506,20 +2510,21 @@ bool DTVAL::MakeTime(struct tm *ptm)
if ((t -= (n * FOURYEARS)) > 2000000000)
return true;
- }
+ } // endif t
+
Tval= (int) t;
if (trace(2))
htrc("MakeTime Ival=%d\n", Tval);
return false;
- } // end of MakeTime
+} // end of MakeTime
/***********************************************************************/
/* Make a time_t datetime from its components (YY, MM, DD, hh, mm, ss) */
/***********************************************************************/
bool DTVAL::MakeDate(PGLOBAL g, int *val, int nval)
- {
+{
int i, m;
int n;
bool rc = false;
@@ -2589,9 +2594,9 @@ bool DTVAL::MakeDate(PGLOBAL g, int *val, int nval)
case 3: datm.tm_hour = n; break;
case 4: datm.tm_min = n; break;
case 5: datm.tm_sec = n; break;
- } // endswitch i
+ } // endswitch i
- } // endfor i
+ } // endfor i
if (trace(2))
htrc("MakeDate datm=(%d,%d,%d,%d,%d,%d)\n",
@@ -2607,14 +2612,14 @@ bool DTVAL::MakeDate(PGLOBAL g, int *val, int nval)
Tval = 0;
return rc;
- } // end of MakeDate
+} // end of MakeDate
/***********************************************************************/
/* DTVAL SetValue: copy the value of another Value object. */
/* This function allows conversion if chktype is false. */
/***********************************************************************/
bool DTVAL::SetValue_pval(PVAL valp, bool chktype)
- {
+{
if (valp != this) {
if (chktype && Type != valp->GetType())
return true;
@@ -2636,16 +2641,16 @@ bool DTVAL::SetValue_pval(PVAL valp, bool chktype)
} else
Reset();
- } // endif valp
+ } // endif valp
return false;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* SetValue: convert chars extracted from a line to date value. */
/***********************************************************************/
bool DTVAL::SetValue_char(const char *p, int n)
- {
+{
bool rc= 0;
if (Pdtp) {
@@ -2661,7 +2666,7 @@ bool DTVAL::SetValue_char(const char *p, int n)
n = Len;
memcpy(Sdate, p, n);
- } // endif n
+ } // endif n
Sdate[n] = '\0';
@@ -2678,13 +2683,13 @@ bool DTVAL::SetValue_char(const char *p, int n)
} // endif Pdtp
return rc;
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* SetValue: convert a char string to date value. */
/***********************************************************************/
void DTVAL::SetValue_psz(PCSZ p)
- {
+{
if (Pdtp) {
int ndv;
int dval[6];
@@ -2704,13 +2709,13 @@ void DTVAL::SetValue_psz(PCSZ p)
Null = (Nullable && Tval == 0);
} // endif Pdtp
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* DTVAL SetValue: set value with a value extracted from a block. */
/***********************************************************************/
void DTVAL::SetValue_pvblk(PVBLK blk, int n)
- {
+{
if (Pdtp && !::IsTypeNum(blk->GetType())) {
int ndv;
int dval[6];
@@ -2720,13 +2725,13 @@ void DTVAL::SetValue_pvblk(PVBLK blk, int n)
} else
Tval = blk->GetIntValue(n);
- } // end of SetValue
+} // end of SetValue
/***********************************************************************/
/* DTVAL GetCharString: get string representation of a date value. */
/***********************************************************************/
char *DTVAL::GetCharString(char *p)
- {
+{
if (Pdtp) {
size_t n = 0;
struct tm tm, *ptm= GetGmTime(&tm);
@@ -2745,7 +2750,7 @@ char *DTVAL::GetCharString(char *p)
//Null = false; ??????????????
return p;
- } // end of GetCharString
+} // end of GetCharString
/***********************************************************************/
/* DTVAL ShowValue: get string representation of a date value. */
@@ -2783,7 +2788,7 @@ int DTVAL::ShowValue(char *buf, int len)
/* Returns a member of the struct tm representation of the date. */
/***********************************************************************/
bool DTVAL::GetTmMember(OPVAL op, int& mval)
- {
+{
bool rc = false;
struct tm tm, *ptm = GetGmTime(&tm);
@@ -2796,10 +2801,10 @@ bool DTVAL::GetTmMember(OPVAL op, int& mval)
case OP_QUART: mval = ptm->tm_mon / 3 + 1; break;
default:
rc = true;
- } // endswitch op
+ } // endswitch op
return rc;
- } // end of GetTmMember
+} // end of GetTmMember
/***********************************************************************/
/* Calculates the week number of the year for the internal date value.*/
@@ -2810,7 +2815,7 @@ bool DTVAL::GetTmMember(OPVAL op, int& mval)
/* the week that contains the January 4th. */
/***********************************************************************/
bool DTVAL::WeekNum(PGLOBAL g, int& nval)
- {
+{
// w is the start of the week SUN=0, MON=1, etc.
int m, n, w = nval % 7;
struct tm tm, *ptm = GetGmTime(&tm);
@@ -2827,7 +2832,7 @@ bool DTVAL::WeekNum(PGLOBAL g, int& nval)
// Everything should be Ok
return false;
- } // end of WeekNum
+} // end of WeekNum
#endif // 0
/***********************************************************************/
@@ -2836,7 +2841,7 @@ bool DTVAL::WeekNum(PGLOBAL g, int& nval)
/* This function assumes that the format matches the value type. */
/***********************************************************************/
bool DTVAL::FormatValue(PVAL vp, PCSZ fmt)
- {
+{
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
struct tm tm, *ptm = GetGmTime(&tm);
@@ -2853,6 +2858,6 @@ bool DTVAL::FormatValue(PVAL vp, PCSZ fmt)
} else
return true;
- } // end of FormatValue
+} // end of FormatValue
/* -------------------------- End of Value --------------------------- */
diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp
index efefc17b5f5..db4d6cbb00d 100644
--- a/storage/connect/xindex.cpp
+++ b/storage/connect/xindex.cpp
@@ -272,8 +272,8 @@ void XINDEX::Close(void)
/***********************************************************************/
int XINDEX::Qcompare(int *i1, int *i2)
{
- register int k;
- register PXCOL kcp;
+ int k;
+ PXCOL kcp;
for (kcp = To_KeyCol, k = 0; kcp; kcp = kcp->Next)
if ((k = kcp->Compare(*i1, *i2)))
@@ -745,7 +745,7 @@ int XINDEX::ColMaxSame(PXCOL kp)
/***********************************************************************/
bool XINDEX::Reorder(PGLOBAL g __attribute__((unused)))
{
- register int i, j, k, n;
+ int i, j, k, n;
bool sorted = true;
PXCOL kcp;
#if 0
@@ -1870,8 +1870,8 @@ int XINDEX::Fetch(PGLOBAL g)
/***********************************************************************/
int XINDEX::FastFind(void)
{
- register int curk, sup, inf, i= 0, k, n = 2;
- register PXCOL kp, kcp;
+ int curk, sup, inf, i= 0, k, n = 2;
+ PXCOL kp, kcp;
//assert((int)nv == Nval);
@@ -2209,8 +2209,8 @@ int XINDXS::Fetch(PGLOBAL g)
/***********************************************************************/
int XINDXS::FastFind(void)
{
- register int sup, inf, i= 0, n = 2;
- register PXCOL kcp = To_KeyCol;
+ int sup, inf, i= 0, n = 2;
+ PXCOL kcp = To_KeyCol;
if (Nblk && Op == OP_EQ) {
// Look in block values to find in which block to search
@@ -3235,7 +3235,7 @@ void KXYCOL::FillValue(PVAL valp)
int KXYCOL::Compare(int i1, int i2)
{
// Do the actual comparison between values.
- register int k = Kblp->CompVal(i1, i2);
+ int k = Kblp->CompVal(i1, i2);
if (trace(4))
htrc("Compare done result=%d\n", k);
@@ -3250,7 +3250,7 @@ int KXYCOL::CompVal(int i)
{
// Do the actual comparison between numerical values.
if (trace(4)) {
- register int k = (int)Kblp->CompVal(Valp, (int)i);
+ int k = (int)Kblp->CompVal(Valp, (int)i);
htrc("Compare done result=%d\n", k);
return k;