Merge branch '2.3' into develop
This commit is contained in:
@ -155,6 +155,7 @@ static thread_local struct
|
||||
bool initialized; // Whether the thread specific data has been initialized.
|
||||
sqlite3* pDb; // Thread specific database handle.
|
||||
qc_sql_mode_t sql_mode; // What sql_mode is used.
|
||||
uint32_t options; // Options affecting classification.
|
||||
QcSqliteInfo* pInfo; // The information for the current statement being classified.
|
||||
uint64_t version; // Encoded version number
|
||||
uint32_t version_major;
|
||||
@ -842,6 +843,14 @@ public:
|
||||
update_field_infos_from_expr(pAliases, context, pExpr, pExclude);
|
||||
break;
|
||||
|
||||
case TK_STRING: // select "a" ..., for @@sql_mode containing 'ANSI_QUOTES'
|
||||
if (this_thread.options & QC_OPTION_STRING_AS_FIELD)
|
||||
{
|
||||
const char* zColumn = pExpr->u.zToken;
|
||||
update_field_infos_from_column(pAliases, context, zColumn, pExclude);
|
||||
}
|
||||
break;
|
||||
|
||||
case TK_VARIABLE:
|
||||
{
|
||||
if (zToken[0] == '@')
|
||||
@ -1152,6 +1161,13 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pExpr->op == TK_STRING)
|
||||
{
|
||||
if (this_thread.options & QC_OPTION_STRING_ARG_AS_FIELD)
|
||||
{
|
||||
zColumn = pExpr->u.zToken;
|
||||
}
|
||||
}
|
||||
|
||||
if (zColumn)
|
||||
{
|
||||
@ -1187,6 +1203,17 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void update_field_infos_from_column(QcAliases* pAliases,
|
||||
uint32_t context,
|
||||
const char* zColumn,
|
||||
const ExprList* pExclude)
|
||||
{
|
||||
if (must_check_sequence_related_functions() || must_collect_fields())
|
||||
{
|
||||
update_field_info(pAliases, context, nullptr, nullptr, zColumn, pExclude);
|
||||
}
|
||||
}
|
||||
|
||||
void update_field_infos_from_exprlist(QcAliases* pAliases,
|
||||
uint32_t context,
|
||||
const ExprList* pEList,
|
||||
@ -4577,6 +4604,8 @@ static int32_t qc_sqlite_get_sql_mode(qc_sql_mode_t* sql_mode);
|
||||
static int32_t qc_sqlite_set_sql_mode(qc_sql_mode_t sql_mode);
|
||||
static QC_STMT_INFO* qc_sqlite_info_dup(QC_STMT_INFO* info);
|
||||
static void qc_sqlite_info_close(QC_STMT_INFO* info);
|
||||
static uint32_t qc_sqlite_get_options();
|
||||
static int32_t qc_sqlite_set_options(uint32_t options);
|
||||
static QC_STMT_RESULT qc_sqlite_get_result_from_info(const QC_STMT_INFO* pInfo);
|
||||
|
||||
|
||||
@ -5261,6 +5290,27 @@ void qc_sqlite_info_close(QC_STMT_INFO* info)
|
||||
static_cast<QcSqliteInfo*>(info)->dec_ref();
|
||||
}
|
||||
|
||||
uint32_t qc_sqlite_get_options()
|
||||
{
|
||||
return this_thread.options;
|
||||
}
|
||||
|
||||
int32_t qc_sqlite_set_options(uint32_t options)
|
||||
{
|
||||
int32_t rv = QC_RESULT_OK;
|
||||
|
||||
if ((options & ~QC_OPTION_MASK) == 0)
|
||||
{
|
||||
this_thread.options = options;
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = QC_RESULT_ERROR;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
QC_STMT_RESULT qc_sqlite_get_result_from_info(const QC_STMT_INFO* pInfo)
|
||||
{
|
||||
return static_cast<const QcSqliteInfo*>(pInfo)->get_result();
|
||||
@ -5301,6 +5351,8 @@ extern "C"
|
||||
qc_sqlite_set_sql_mode,
|
||||
qc_sqlite_info_dup,
|
||||
qc_sqlite_info_close,
|
||||
qc_sqlite_get_options,
|
||||
qc_sqlite_set_options,
|
||||
qc_sqlite_get_result_from_info,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user