Skip to content
Snippets Groups Projects
Commit 0be700b6 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

add warning for big in-statements

parent ea11370b
No related branches found
No related tags found
No related merge requests found
......@@ -2462,6 +2462,10 @@ SqlUtils.getSystemAlias = function()
*/
SqlUtils.getSqlInStatement = function(pFieldname, pData, pQuoteSymbol, pAsPrepared, pPreparedDbType)
{
var MAX_COUNT = 1000;
if (pData.length > 1000)
logging.log(translate.text("SqlUtils.getSqlInStatement: WARNING: You should not create in-statements with more than 1000 values. As this has a very bad performance."))
if (pData.length == 0)
return " 1 = 2 ";
......@@ -2476,7 +2480,6 @@ SqlUtils.getSqlInStatement = function(pFieldname, pData, pQuoteSymbol, pAsPrepar
throw new Error(translate.text("SqlUtils.getSqlInStatement: if pAsPrepared is true, pPreparedDbType has to be filld with the correct db type"));
}
var MAX_COUNT = 1000;
//pData.length -1 um für den Fall, dass MAX_COUNT == pData.length ist trotzdem nur einen Aufruf
//zu machen
var count = ((pData.length -1) / MAX_COUNT) >> 0;//aus kommazahl eine ganzzahl machen
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment