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

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2022-07-27 17:17:24 +03:00
278 changed files with 17690 additions and 7421 deletions

View File

@@ -723,7 +723,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
@@ -738,7 +738,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
@@ -755,7 +755,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
@@ -763,7 +763,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
@@ -851,7 +851,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
@@ -861,7 +861,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
@@ -1015,7 +1015,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
@@ -1066,7 +1066,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
@@ -1087,7 +1087,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
@@ -1108,7 +1108,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
@@ -1122,7 +1122,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
@@ -1161,7 +1161,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
@@ -1169,7 +1169,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
@@ -1288,7 +1288,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
@@ -1298,7 +1298,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, "..")) {
@@ -1419,7 +1419,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 {
@@ -1428,7 +1428,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
@@ -1470,7 +1470,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
@@ -1511,7 +1511,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
@@ -1520,7 +1520,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