mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 21:23:03 +01:00
Fixed CORE-1528 - Functions DATEDIFF, ABS(integer const) does not work in dialect 1
This commit is contained in:
parent
b71d62c51d
commit
c7440554de
@ -672,7 +672,7 @@ static ISC_STATUS dsql8_execute_immediate_common(ISC_STATUS* user_status,
|
||||
* be a way to send the parser version to DSQL so that the parser can compare the keyword
|
||||
* version to the parser version. To accomplish this, the parser version is combined with
|
||||
* the client dialect and sent across that way. In dsql8_execute_immediate, the parser version
|
||||
* and client dialect are separated and passed on to their final desintations. The information
|
||||
* and client dialect are separated and passed on to their final destinations. The information
|
||||
* is combined as follows:
|
||||
* Dialect * 10 + parser_version
|
||||
*
|
||||
|
@ -1056,4 +1056,9 @@ UCHAR DSqlDataTypeUtil::maxBytesPerChar(UCHAR charSet)
|
||||
return METD_get_charset_bpc(request, charSet);
|
||||
}
|
||||
|
||||
USHORT DSqlDataTypeUtil::getDialect()
|
||||
{
|
||||
return request->req_client_dialect;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
|
||||
public:
|
||||
virtual UCHAR maxBytesPerChar(UCHAR charSet);
|
||||
virtual USHORT getDialect();
|
||||
|
||||
private:
|
||||
dsql_req* request;
|
||||
|
@ -535,11 +535,14 @@ void DataTypeUtilBase::makeSysFunction(dsc* result, const char* name, int argsCo
|
||||
|
||||
namespace Jrd {
|
||||
|
||||
|
||||
UCHAR DataTypeUtil::maxBytesPerChar(UCHAR charSet)
|
||||
{
|
||||
return INTL_charset_lookup(tdbb, charSet)->maxBytesPerChar();
|
||||
}
|
||||
|
||||
USHORT DataTypeUtil::getDialect()
|
||||
{
|
||||
return (tdbb->tdbb_database->dbb_flags & DBB_DB_SQL_dialect_3) ? 3 : 1;
|
||||
}
|
||||
|
||||
} // namespace Jrd
|
||||
|
@ -50,6 +50,7 @@ public:
|
||||
|
||||
public:
|
||||
virtual UCHAR maxBytesPerChar(UCHAR charSet) = 0;
|
||||
virtual USHORT getDialect() = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -67,6 +68,7 @@ public:
|
||||
|
||||
public:
|
||||
virtual UCHAR maxBytesPerChar(UCHAR charSet);
|
||||
virtual USHORT getDialect(); // returns client dialect in DSQL and database dialect in JRD
|
||||
|
||||
private:
|
||||
thread_db* tdbb;
|
||||
|
@ -351,7 +351,10 @@ static void makeFromListResult(DataTypeUtilBase* dataTypeUtil, const SysFunction
|
||||
|
||||
static void makeInt64Result(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc* result, int argsCount, const dsc** args)
|
||||
{
|
||||
result->makeInt64(0);
|
||||
if (dataTypeUtil->getDialect() == 1)
|
||||
result->makeDouble();
|
||||
else
|
||||
result->makeInt64(0);
|
||||
|
||||
bool isNullable;
|
||||
if (initResult(result, argsCount, args, &isNullable))
|
||||
|
Loading…
Reference in New Issue
Block a user