1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.8 into 10.9

This commit is contained in:
Marko Mäkelä
2022-07-28 10:47:33 +03:00
421 changed files with 20471 additions and 8799 deletions

View File

@@ -716,7 +716,7 @@ int TDBDIR::GetMaxSize(PGLOBAL g)
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError(), 0, (LPTSTR)&buf, sizeof(buf), NULL);
sprintf(g->Message, MSG(BAD_FILE_HANDLE), buf);
snprintf(g->Message, sizeof(g->Message), MSG(BAD_FILE_HANDLE), buf);
return -1;
} // endif rc
@@ -731,7 +731,7 @@ int TDBDIR::GetMaxSize(PGLOBAL g)
rc = GetLastError();
if (rc != ERROR_NO_MORE_FILES) {
sprintf(g->Message, MSG(NEXT_FILE_ERROR), rc);
snprintf(g->Message, sizeof(g->Message), MSG(NEXT_FILE_ERROR), rc);
FindClose(hSearch);
return -1;
} // endif rc
@@ -748,7 +748,7 @@ int TDBDIR::GetMaxSize(PGLOBAL g)
// Start searching files in the target directory.
if (!(Dir = opendir(Direc))) {
sprintf(g->Message, MSG(BAD_DIRECTORY), Direc, strerror(errno));
snprintf(g->Message, sizeof(g->Message), MSG(BAD_DIRECTORY), Direc, strerror(errno));
return -1;
} // endif dir
@@ -756,7 +756,7 @@ int TDBDIR::GetMaxSize(PGLOBAL g)
strcat(strcpy(Fpath, Direc), Entry->d_name);
if (lstat(Fpath, &Fileinfo) < 0) {
sprintf(g->Message, "%s: %s", Fpath, strerror(errno));
snprintf(g->Message, sizeof(g->Message), "%s: %s", Fpath, strerror(errno));
return -1;
} else if (S_ISREG(Fileinfo.st_mode))
// Test whether the file name matches the table name filter
@@ -844,7 +844,7 @@ int TDBDIR::ReadDB(PGLOBAL g)
if (!Dir)
// Start searching files in the target directory.
if (!(Dir = opendir(Direc))) {
sprintf(g->Message, MSG(BAD_DIRECTORY), Direc, strerror(errno));
snprintf(g->Message, sizeof(g->Message), MSG(BAD_DIRECTORY), Direc, strerror(errno));
rc = RC_FX;
} // endif dir
@@ -854,7 +854,7 @@ int TDBDIR::ReadDB(PGLOBAL g)
strcat(strcpy(Fpath, Direc), Entry->d_name);
if (lstat(Fpath, &Fileinfo) < 0) {
sprintf(g->Message, "%s: %s", Fpath, strerror(errno));
snprintf(g->Message, sizeof(g->Message), "%s: %s", Fpath, strerror(errno));
rc = RC_FX;
} else if (S_ISREG(Fileinfo.st_mode))
// Test whether the file name matches the table name filter
@@ -1008,7 +1008,7 @@ void DIRCOL::ReadColumn(PGLOBAL g)
case 10: Value->SetValue((int)Tdbp->Fileinfo.st_gid); break;
#endif // !_WIN32
default:
sprintf(g->Message, MSG(INV_DIRCOL_OFST), N);
snprintf(g->Message, sizeof(g->Message), MSG(INV_DIRCOL_OFST), N);
throw GetAmType();
} // endswitch N
@@ -1059,7 +1059,7 @@ int TDBSDR::FindInDir(PGLOBAL g)
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError(), 0, (LPTSTR)&buf, sizeof(buf), NULL);
sprintf(g->Message, MSG(BAD_FILE_HANDLE), buf);
snprintf(g->Message, sizeof(g->Message), MSG(BAD_FILE_HANDLE), buf);
return -1;
} // endif rc
@@ -1080,7 +1080,7 @@ int TDBSDR::FindInDir(PGLOBAL g)
rc = GetLastError();
if (rc != ERROR_NO_MORE_FILES) {
sprintf(g->Message, MSG(NEXT_FILE_ERROR), rc);
snprintf(g->Message, sizeof(g->Message), MSG(NEXT_FILE_ERROR), rc);
FindClose(h);
return -1;
} // endif rc
@@ -1101,7 +1101,7 @@ int TDBSDR::FindInDir(PGLOBAL g)
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError(), 0, (LPTSTR)&buf, sizeof(buf), NULL);
sprintf(g->Message, MSG(BAD_FILE_HANDLE), buf);
snprintf(g->Message, sizeof(g->Message), MSG(BAD_FILE_HANDLE), buf);
return -1;
} // endif rc
@@ -1115,7 +1115,7 @@ int TDBSDR::FindInDir(PGLOBAL g)
rc = GetLastError();
if (rc != ERROR_NO_MORE_FILES) {
sprintf(g->Message, MSG(NEXT_FILE_ERROR), rc);
snprintf(g->Message, sizeof(g->Message), MSG(NEXT_FILE_ERROR), rc);
FindClose(h);
return -1;
} // endif rc
@@ -1154,7 +1154,7 @@ int TDBSDR::FindInDir(PGLOBAL g)
DIR *dir = opendir(Direc);
if (!dir) {
sprintf(g->Message, MSG(BAD_DIRECTORY), Direc, strerror(errno));
snprintf(g->Message, sizeof(g->Message), MSG(BAD_DIRECTORY), Direc, strerror(errno));
return -1;
} // endif dir
@@ -1162,7 +1162,7 @@ int TDBSDR::FindInDir(PGLOBAL g)
strcat(strcpy(Fpath, Direc), Entry->d_name);
if (lstat(Fpath, &Fileinfo) < 0) {
sprintf(g->Message, "%s: %s", Fpath, strerror(errno));
snprintf(g->Message, sizeof(g->Message), "%s: %s", Fpath, strerror(errno));
return -1;
} else if (S_ISDIR(Fileinfo.st_mode) && *Entry->d_name != '.') {
// Look in the name sub-directory
@@ -1281,7 +1281,7 @@ int TDBSDR::ReadDB(PGLOBAL g)
if (!Sub->D)
// Start searching files in the target directory.
if (!(Sub->D = opendir(Direc))) {
sprintf(g->Message, MSG(BAD_DIRECTORY), Direc, strerror(errno));
snprintf(g->Message, sizeof(g->Message), MSG(BAD_DIRECTORY), Direc, strerror(errno));
rc = RC_FX;
} // endif dir
@@ -1291,7 +1291,7 @@ int TDBSDR::ReadDB(PGLOBAL g)
strcat(strcpy(Fpath, Direc), Entry->d_name);
if (lstat(Fpath, &Fileinfo) < 0) {
sprintf(g->Message, "%s: %s", Fpath, strerror(errno));
snprintf(g->Message, sizeof(g->Message), "%s: %s", Fpath, strerror(errno));
rc = RC_FX;
} else if (S_ISDIR(Fileinfo.st_mode) && strcmp(Entry->d_name, ".")
&& strcmp(Entry->d_name, "..")) {
@@ -1412,7 +1412,7 @@ int TDBDHR::GetMaxSize(PGLOBAL g)
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, rc, 0,
(LPTSTR)&filename, sizeof(filename), NULL);
sprintf(g->Message, MSG(BAD_FILE_HANDLE), filename);
snprintf(g->Message, sizeof(g->Message), MSG(BAD_FILE_HANDLE), filename);
} // endswitch rc
} else {
@@ -1421,7 +1421,7 @@ int TDBDHR::GetMaxSize(PGLOBAL g)
rc = GetLastError();
if (rc != ERROR_NO_MORE_FILES) {
sprintf(g->Message, MSG(NEXT_FILE_ERROR), rc);
snprintf(g->Message, sizeof(g->Message), MSG(NEXT_FILE_ERROR), rc);
n = -1;
} // endif rc
@@ -1463,7 +1463,7 @@ bool TDBDHR::OpenDB(PGLOBAL g)
/*********************************************************************/
if (NeedIndexing(g)) {
// Direct access of DHR tables is not implemented yet
sprintf(g->Message, MSG(NO_DIR_INDX_RD), "DHR");
snprintf(g->Message, sizeof(g->Message), MSG(NO_DIR_INDX_RD), "DHR");
return true;
} // endif NeedIndexing
@@ -1504,7 +1504,7 @@ int TDBDHR::ReadDB(PGLOBAL g)
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, erc, 0,
(LPTSTR)&filename, sizeof(filename), NULL);
sprintf(g->Message, MSG(BAD_FILE_HANDLE), filename);
snprintf(g->Message, sizeof(g->Message), MSG(BAD_FILE_HANDLE), filename);
rc = RC_FX;
} // endswitch erc
@@ -1513,7 +1513,7 @@ int TDBDHR::ReadDB(PGLOBAL g)
DWORD erc = GetLastError();
if (erc != ERROR_NO_MORE_FILES) {
sprintf(g->Message, MSG(NEXT_FILE_ERROR), erc);
snprintf(g->Message, sizeof(g->Message), MSG(NEXT_FILE_ERROR), erc);
FindClose(Hsearch);
rc = RC_FX;
} else