Patch level : 12.0 no-patch

Files correlati     : xvtdb
Commento            : Ottimizzato exec, adesso prima di eseguire operazioni sulla query controlla che auto_f sia true
This commit is contained in:
Mattia Tollari 2019-04-02 14:53:32 +02:00
parent 61aacce9ba
commit de9db58ec7

View File

@ -378,9 +378,14 @@ bool TXvt_recordset::exec(const bool auto_f)
_RCS(_recset)->Execute();
_loaded = true;
_recno = -1;
// Se trovo almeno un "select" faccio l'autofetch
SAString s = _RCS(_recset)->CommandText(); s.MakeUpper();
ok = s.Find("SELECT") != SIZE_MAX && auto_f ? next() : true;
// Se trovo almeno un "select" faccio l'autofetch, ovviamente non mi sbatto se auto_f è disattivato
if (auto_f)
{
SAString s = _RCS(_recset)->CommandText(); s.MakeUpper();
ok = s.Find("SELECT") != SIZE_MAX ? next() : true;
}
else
ok = true;
}
catch (SAException &x)
{