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:
@@ -256,7 +256,7 @@ int TDBFIX::RowNumber(PGLOBAL g, bool b)
|
||||
/* Don't know how to retrieve Rows from DBF file address */
|
||||
/* because of eventual deleted lines still in the file. */
|
||||
/*****************************************************************/
|
||||
sprintf(g->Message, MSG(NO_ROWID_FOR_AM),
|
||||
snprintf(g->Message, sizeof(g->Message), MSG(NO_ROWID_FOR_AM),
|
||||
GetAmName(g, Txfp->GetAmType()));
|
||||
return 0;
|
||||
} // endif To_Kindex
|
||||
@@ -408,7 +408,7 @@ BINCOL::BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PCSZ am)
|
||||
case 'F': M = sizeof(float); break;
|
||||
case 'D': M = sizeof(double); break;
|
||||
default:
|
||||
sprintf(g->Message, MSG(BAD_BIN_FMT), Fmt, Name);
|
||||
snprintf(g->Message, sizeof(g->Message), MSG(BAD_BIN_FMT), Fmt, Name);
|
||||
throw 11;
|
||||
} // endswitch Fmt
|
||||
|
||||
@@ -482,7 +482,7 @@ void BINCOL::ReadColumn(PGLOBAL g)
|
||||
if (!tdbp->IsRead())
|
||||
if ((rc = tdbp->ReadBuffer(g)) != RC_OK) {
|
||||
if (rc == RC_EF)
|
||||
sprintf(g->Message, MSG(INV_DEF_READ), rc);
|
||||
snprintf(g->Message, sizeof(g->Message), MSG(INV_DEF_READ), rc);
|
||||
|
||||
throw 11;
|
||||
} // endif
|
||||
@@ -535,14 +535,14 @@ void BINCOL::ReadColumn(PGLOBAL g)
|
||||
break;
|
||||
case 'C': // Text
|
||||
if (Value->SetValue_char(p, Long)) {
|
||||
sprintf(g->Message, "Out of range value for column %s at row %d",
|
||||
snprintf(g->Message, sizeof(g->Message), "Out of range value for column %s at row %d",
|
||||
Name, tdbp->RowNumber(g));
|
||||
PushWarning(g, tdbp);
|
||||
} // endif SetValue_char
|
||||
|
||||
break;
|
||||
default:
|
||||
sprintf(g->Message, MSG(BAD_BIN_FMT), Fmt, Name);
|
||||
snprintf(g->Message, sizeof(g->Message), MSG(BAD_BIN_FMT), Fmt, Name);
|
||||
throw 11;
|
||||
} // endswitch Fmt
|
||||
|
||||
@@ -591,7 +591,7 @@ void BINCOL::WriteColumn(PGLOBAL g)
|
||||
if (Status)
|
||||
Value->GetValueNonAligned<longlong>(p, Value->GetBigintValue());
|
||||
} else if (Value->GetBinValue(p, Long, Status)) {
|
||||
sprintf(g->Message, MSG(BIN_F_TOO_LONG),
|
||||
snprintf(g->Message, sizeof(g->Message), MSG(BIN_F_TOO_LONG),
|
||||
Name, Value->GetSize(), Long);
|
||||
throw 31;
|
||||
} // endif p
|
||||
@@ -601,7 +601,7 @@ void BINCOL::WriteColumn(PGLOBAL g)
|
||||
n = Value->GetBigintValue();
|
||||
|
||||
if (n > 32767LL || n < -32768LL) {
|
||||
sprintf(g->Message, MSG(VALUE_TOO_BIG), n, Name);
|
||||
snprintf(g->Message, sizeof(g->Message), MSG(VALUE_TOO_BIG), n, Name);
|
||||
throw 31;
|
||||
} else if (Status)
|
||||
Value->GetValueNonAligned<short>(p, (short)n);
|
||||
@@ -611,7 +611,7 @@ void BINCOL::WriteColumn(PGLOBAL g)
|
||||
n = Value->GetBigintValue();
|
||||
|
||||
if (n > 255LL || n < -256LL) {
|
||||
sprintf(g->Message, MSG(VALUE_TOO_BIG), n, Name);
|
||||
snprintf(g->Message, sizeof(g->Message), MSG(VALUE_TOO_BIG), n, Name);
|
||||
throw 31;
|
||||
} else if (Status)
|
||||
*p = (char)n;
|
||||
@@ -621,7 +621,7 @@ void BINCOL::WriteColumn(PGLOBAL g)
|
||||
n = Value->GetBigintValue();
|
||||
|
||||
if (n > INT_MAX || n < INT_MIN) {
|
||||
sprintf(g->Message, MSG(VALUE_TOO_BIG), n, Name);
|
||||
snprintf(g->Message, sizeof(g->Message), MSG(VALUE_TOO_BIG), n, Name);
|
||||
throw 31;
|
||||
} else if (Status)
|
||||
Value->GetValueNonAligned<int>(p, (int)n);
|
||||
@@ -645,7 +645,7 @@ void BINCOL::WriteColumn(PGLOBAL g)
|
||||
break;
|
||||
case 'C': // Characters
|
||||
if ((n = (signed)strlen(Value->GetCharString(Buf))) > Long) {
|
||||
sprintf(g->Message, MSG(BIN_F_TOO_LONG), Name, (int) n, Long);
|
||||
snprintf(g->Message, sizeof(g->Message), MSG(BIN_F_TOO_LONG), Name, (int) n, Long);
|
||||
throw 31;
|
||||
} // endif n
|
||||
|
||||
@@ -657,7 +657,7 @@ void BINCOL::WriteColumn(PGLOBAL g)
|
||||
|
||||
break;
|
||||
default:
|
||||
sprintf(g->Message, MSG(BAD_BIN_FMT), Fmt, Name);
|
||||
snprintf(g->Message, sizeof(g->Message), MSG(BAD_BIN_FMT), Fmt, Name);
|
||||
throw 31;
|
||||
} // endswitch Fmt
|
||||
|
||||
|
Reference in New Issue
Block a user