./_SRC/version.h
#define STORMBASE_VERSION "v1.17.10_F29"
// v1.5.09 bug fix of core dumps
// v1.5.10 remove call f_check_disk_space (except the one at startup)
// v1.5.11 add if( insert_altered == TRUE )
// v1.5.12 coredump if query during refresh, see do_not_save
// v1.5.13 bug introduced by 1.15.11
// v1.5.14 more debug for orphans
// v1.5.15 bug at citymart, when select and unfrag at the same time
// v1.5.16 INITIAL_LOAD
// v1.5.17 UNIQUE_SOFT
// v1.5.18 remove last call to f_check_disk_space (bug City Mart)
// v1.5.19 remove disk check also
// v1.5.20 just a git test
// v1.5.21 bug fix in uniquesoft
// v1.5.22 bug fix City Mart error 29-00
// v1.5.23 AUDIT mode
// v1.5.24 Forgot to divide by column count, which generated too many threads
// v1.5.25 Fix rare parsing errors
// v1.5.26 Add TOTO function
// v1.5.27 Increase GLOBAL_COL_TYPE_CHECK_LIST_LEN
// v1.5.28 Debug error ERROR 29-131 in function : new_object
// v1.5.29 Allow orphans in tables linked to big tables, if and only if they are empty
// v1.5.30 Fix for ERROR 29-131 in function : new_object
// v1.5.31 Cleaning of unused CELL file at startup
// v1.5.32 Improve where check when I have same where done before without end_user check
// v1.5.33 Small evo
// v1.5.34 Bug fix in where management, exact match where not detected (always considered as partial matches)
// v1.5.35 NEW_COLUMN_NULL_STRING, default "NO_DATA"
// v1.5.36 Group by size not correct if where group by on disk
// v1.5.37 Error in TURBO creation because of null management
// v1.5.38 Bug in license check if max line > 4G
// v1.5.39 Bug cache size was zero after cache maintenance
// v1.5.40 Big bug in where clause, were considered as same : where c1 in ('v3','v1') / where c1 in ('v3')
// v1.5.41 Change cache management, priority to group by
// v1.5.42 Bug in where cache (take partial match before ready)
// v1.5.43 Bug City Mart when 30 sessions hit, core dump in f_create_col_type_check
// v1.5.44 Bug with turbo create ok but refresh ko when nothing was added in the table
// v1.5.45 Bug when several nn views in where clause
// v1.5.46 Evo, nn view, loop on nn_view instead of main view to find col_type in common
// v1.5.47 Bug non reproductible
// v1.5.48 Bug non reproductible
// v1.5.49 Bug Turbo, I get -1.9e-05 in the export, which fails during insert (change in strombase.lua)
// v1.5.50 Bug in refresh if more than 30 active sessions
// v1.5.51 Bad timing, bad error message, ALLOW_ORPHAN
// v1.5.52 CPU_COUNT param
// v1.5.53 Bug in LUA sort after v1.5.49
// v1.5.54 SB_NOT_IN_BETA & pwhere->pwhere_col_pos_to_is_not
// v1.5.55 EYC_OPTIM
// v1.5.56 EYC_OPTIM #2
// v1.5.57 EYC_OPTIM #3
// v1.5.58 MAX_PERFORMANCE
// v1.5.62 MAX_PERFORMANCE
// v1.5.63 SB_NOT_IN_BETA -> SB_NOT_IN (nin)
// v1.5.64 Several things ...
// v1.5.65 Bug fix in f_permission_has_changed
// v1.5.66 Many things
// v1.5.67 Many things & fix core dump REMA
// v1.6.00 First official version with MAX_PERF
// v1.6.02 Bug fix MAX_PERF
// v1.6.17.5 core CM
// v1.6.19 several bugs in where
// v1.6.20 refresh permissions integrated to refresh dirty views
// v1.6.21 less log
// v1.6.22 MAX_PERF->lval_count can't be used when loading max_perf from file (=0)
// v1.6.23 evaluate gby_booster_len better when booster not used
// v1.6.23.1 account for null value
// v1.6.24 bug fix and dev started for where indexes
// v1.6.25 dev end for where index + bug fix
// v1.6.25.1 where index stable
// v1.6.25.2 free missing
// v1.6.25.3 City Mart error 75722
// v1.6.25.4 trace for error 75722 investigate
// v1.6.25.5 trace for error 75722 investigate (origin of sessions)
// v1.6.25.6 move irel2 limit from 20 to 30
// v1.6.26 bug fix (core REMA UAT)
// v1.6.27_ bench inter
// v1.7.00 bench inter first stable version
// v1.7.01.1 memory leaks
// v1.7.02 use temp cell array for file load, to avoid fragmentation
// v1.7.03 core with delete in TEST_BENCH_INTER=y
// v1.7.04 PARETO_LIMIT LOG_VERBOSE
// v1.7.10 manage simple select (w/o group by)
// v1.7.10.1 bug in select sum(col) sqls
// v1.7.10.2 bug REMA, profile sql falls in wait, no more connections accepted
// v1.7.10.3 bugs
// bug #1 when a pareto column is in group by several times, memory pb in valgrind
// bug #2 double free error if group by with index
// bug #3 invalid result for unique & uniqsoft (linked to pareto values)
// v1.7.10.4 bug, NN view where clause : select other view drop twice
// v1.7.10.5 core with this SQL: SELECT MOY,sum() FROM V_SALES WHERE e(Y0,'2016') GROUP BY MOY CALLBACK limit(10000);
// v1.7.11 TEST_BENCH_INTER = 'y' by DEFAULT
// v1.7.12 memory problem
// v1.7.13 incorrect result for select without group by
// v1.7.14 memory check
// v1.7.15 memory check #2
// v1.7.16 core dump with WHERE end_user = 'NO_PROFILE_FOR_THIS_USER_APP'
// v1.7.17 core dump with select returning more than 2 million rows
// v1.7.18 in flat select, treat callback limit(x) during select execution, not after
// v1.7.19 bug with having and callback clause
// v1.7.20 manage nulls (sum=0 are displayed)
// v1.7.21 get rid of "port already in use issue"
// v1.7.22 bug fix after v1.7.20
// v1.8.00 preparation for cluster version, IVAL
// v1.8.01
//1/ core in unlucky cases,
//2/ manage top/bottom query on high sparsity group by w/o indexes
//3/ big bug on countdistinct(col of big table)
// v1.8.02 preparation for cluster version, ivallist/ivalbin
// v1.8.03 core when doing query with many columns (15) many rows (1000000)
// v1.8.04 move step2 limit from 30 to 40
// v1.8.05 bug (core or 0) when expression used several times in select
// v1.8.06 core in drop select
// v1.8.07 core at REMA in f_mem_get_object_id
// v1.8.08 correct v1.8.07
// v1.8.09 OOM with big countdistinct
// v1.8.10 add logs, core REMA when refresh without cache drop
// v1.8.11 col_type_check issue at LGEP
// v1.8.12 allow default value for orphan
// v1.8.13 free where index memory before save
// v1.8.14
// countdistinct should not count the NULL_STRING
// return error 140 for SQL during refresh drity views
// v1.8.15
// memory leak in data model exec
// DEBUG_MEM & CELL_BLOCK_TMP_ID
// v1.8.16 bug and memory leak in where_info
// v1.8.17 manage maxstr and minstr
// v1.8.18 countdistinct memory limit with MAX_COUNT_DISTINCT_THREAD_SIZE
// v1.8.19 Fix tentative for bug "_irel_ok_count != irel_ok_count" at Rema
// v1.8.20 Bug fix in "delete where nin"
// v1.8.21 Bug in count distinct with group by index
// v1.8.22 Bug if where col in ('A','A')
// v1.9.00 REFRESH_ONLINE (main development)
// v1.9.00 also remove TEST_BENCH_INTER
// v1.9.00 also remove "select from empty view error" in max_perf context
// v1.9.00 also fix a mutex related bug (problem at REMA) in f_select (see f_get_where_info_status(where_info))
// v1.9.00 also remove "select from empty view error" in max_perf context
// v1.9.00 also countd_first_ivals, reduce memory consumption for countdistinct on high sparsity columns (problem at LGEP)
// v1.9.00 also new where syntax : c like 'something' (equivalent but faster to regex(c,'.*something.*')
// v1.9.00 also manage sort up to 5 columns : sort( col1 , dir1, col2 , dir2, col3 , dir3, col4 , dir4, col5 , dir5 )
// v1.9.00 also removes small memory leaks
// v1.9.01 few bug fixes
// v1.9.02 control thread every 60 sec (6 sec before)
// v1.9.03 bug fix in refresh view sql creation
// v1.9.04 bug fix select on parent view was cached too early
// v1.9.05 removed automatic refresh dirty at startup (collision with clear_max_perf at Monoprix)
// v1.9.06 rework fix v1.9.04
// v1.9.07 bug fix linked to clear_max_perf.sh and refresh_online
// v1.9.08 bug in NN views
// v1.9.09 small memory leak fix
// v1.9.10 bug at startup when there is a big_online based view and a non big_online based view (with active child view) seen at REMA
// v1.9.11 core at REMA
// v1.9.12 core at REMA
// v1.9.13 bugs
// v1.9.14 change select status after tcp response (to avoid conflict with cache dropping)
// v1.9.15 manage not exists with NN join. Syntax: "where view!.col ..."
// v1.9.16 bug fix maxstr
// v1.9.17 problems NN views
// v1.9.18 problems with where view!.col when using index
// v1.9.19 bug fix "_irel_ok_count != irel_ok_count" error (REMA)
// v1.10.00
// review non big/merge views
// manage "with ... as ( ..."
// v1.10.01 bug fix "insert values" with : in it did not work
// v1.10.02 core with non big/merge views, bug with countdistinct in non big/merge views
// v1.10.03 core at REMA with online_views
// v1.10.04 insert optim for big merge tables
// v1.10.05 push max number of selects from 1E6 to 10E6
// v1.10.06 with pareto first rare line is seen as empty (regression after v1.10.02)
// v1.10.07 SB_DISTINCT_LIST
// v1.10.08 analytic sql rework
// v1.10.09 bug fix countdistinct (memory REMA)
// v1.10.10 manage sort with padding, for instance sort(1,'desc5')
// v1.10.11
//change default parameters values
//desc <|table_name|view_name> <|1|2>
//bug fix core REMA
//display integers w/o digits
//bug fix (invalid syntax in with trapping)
// v1.10.12
// rework on analytic functions
// support select ... and .. syntax (without where)
// v1.10.13
// avoid this kind of display with CLI: 6.000002
// manage select *
// v1.10.14
// allow refresh online with non big/merge table (try)
// function select don't look at child views
// U_INT_LIMIT
// v1.10.15 core at REMA in live refresh
// v1.10.16 core using with + profile
// v1.10.17 fn_lua
// v1.10.18 fn_lua rework
// v1.10.19 analytic rework
// v1.10.20 ALLOW_ORPHAN=y by default
// v1.10.21 new sort: sort(2,'asc5-') = asc, left pad of 5, use char before - for sort
// v1.10.22
// SB_NO_VIEW_OBJ
// cap memory to MAX_GBY_BOOSTER_LEN for select using index (20M) before (ITM)
// when ambiguity on column (art_cinv) change dimension priority
// v1.10.23
// more mutex protection (core REMA)
// v1.10.24
// recycle max_perf (core REMA)
// flag view as dirty now is independant from ALLOW_ORPHAN (otherwise daily_mvt becomes dirty after live refresh)
// v1.10.25
// bug fix on with
// v1.10.26
// bug fix describe
// bug delete where app_origin='GOLD'
// v1.10.27 don't check max session in f_create_col_type_check (created a deadlock at REMA, cf. SQL using "with clause")
// v1.11.00
// analytic big rework
// =null manaaement
// rework on refresh protection
// several other things
// v1.11.01
// optim of big groub by & count distincts
// v1.11.02 stormbase.lua limit case in ratio/fn_stock
// v1.11.03 bug fix in =null management with index
// v1.12.00 transactional initial version
// v1.13.00 PARTITION_LINE_COUNT
// v1.13.01 rework v1.7.10.3 bug #1, with a better fix
// v1.13.02 non big/merge view with sequential read optim
// v1.13.03 protect data_model_exec execution (anticipation of pb in HA mode at REMA)
// v1.13.04 bug fix error 140 returned if refresh dirty view w/o modification
// v1.13.05 fix blocking locking introduced by v1.13.03
// v1.13.06 parse error 146 fix in with clause
// v1.13.07 rework partition (delete, data model modif etc...)
// v1.13.08
// core at REMA (when exec show_table and refresh dirty in parallel)
// v1.14.00 initial version with dynamic C code
// v1.14.01 fn_pivot optim
// v1.14.02 core at REMA
// v1.14.03 core at REMA
// v1.14.04 core at REMA
// v1.14.05 core at REMA
// v1.14.06 core at REMA
// v1.14.07 '' management
// v1.14.08 core at Inter
// v1.14.09 PIN_MEMORY parameter, bug fix fn_store
// v1.14.10 optimization round
// v1.14.10 manage p(view.column) from no_view syntax
// v1.14.10 manage group by with_name.col_name
// v1.14.11 manage * in permissions
// v1.14.12 bug fix in permissions (unknown users were super users)
// v1.14.13 manage insert into table (col1, ..) values (...)
// v1.14.14 manage batch insert: insert into table (col1, ..) values (...) (...)
// v1.14.15 manage count(*)
// v1.14.16 manage driver version, and send column types to client
// v1.14.17 manage count(distinct col)
// v1.14.18 non big online table are not recalculated at startup
// v1.14.18 IREL_TO_ILINES_MAX_LENGTH ILINE_TO_IVALS_MAX_LENGTH, bug fix with big select *
// v1.14.19 bug fix SELECT_ALL
// v1.14.20 new rule on nn join, fact table and non empty dim have priority over empty dim
// v1.14.21 display problem of uniquesoft result
// v1.14.22 bug in f_max_perf_run_sequential_no_pareto_no_group_by_no_where_no_fn_loop_one_count_no_compression
// v1.14.23 add column in empty view generates empty files in MAX_PERF, next boot of SB fails, now this case is managed
// v1.14.24 rework // v1.14.23
// v1.14.25 dropping an altered object is no longer allowed (generates bugs)
// v1.14.26 update (start)
// v1.14.27 core at monop (thread_count in fn_init_fn_res in caped to CPU_COUNT+1)
// v1.14.28 bug fix, "save" without a "refresh dirty view" before will corrupt _DESC_Z file
// v1.14.29 removed dynamic library libnsl.so (not compatible with RedHat 8)
// v1.14.30 optim select using booster, cache col_type checks
// v1.14.31 add signature check to dynamic C function
// v1.14.32 big bug impacting delete with several columns in where clause
// v1.14.33 secure consistency in MAX_PERF
// v1.14.34 batch insert values optim
// v1.14.35 dates are converted to float by fn_merge
// v1.14.36 bug in col_type_check cache
// v1.14.37 bug in parsing of complex with (more than 50 () )
// v1.14.38 secure consistency in MAX_PERF #2
// v1.15.00 MAX_PERF_FILTER v0
// v1.15.01 compute max_perf view per view (in order to save volatile memory)
// v1.15.02 bug fix in parsing
// v1.15.03 bug fix when migration from pre v1.15.00, review IN_MEMORY_BIG_TABLES management
// v1.15.04 rework v1.15.03
// v1.15.05 rework fn_having (add sum and sumpareto)
// v1.15.06 allow using having several column with same col_type in a table
// v1.15.07 add log
// v1.15.08 err 53 if dim is aliased (tableau)
// v1.15.09 auto convert from min/max to minstr/maxstr (tableau)
// v1.15.10 pass line_count to loop function
// v1.15.11 error message after fopen
// v1.15.12 refresh_online + full delete + where clause matching nothing issue
// v1.15.13 bug fix in loop result
// v1.15.14 bug fix in formula on text expressions
// v1.15.15 small change to make test faster
// v1.15.16
// add sb_vals_version for compatibility check between SB and .so code
// manage multi thread of loop
// v1.15.17 SB_VALS_VERSION 2
// v1.15.18 manage empty file insert without sending error 61
// v1.15.19 bug fix in transac (impossible to create a 2nd table)
// v1.15.20 manage kill signals
// v1.15.21 core at REMA (sql with non existing profile)
// v1.15.22 bug in min and max
// v1.15.23 core with list on number column
// v1.15.24 rework v1.15.21 and add CHECK_CORRUPTION_INDEX
////////////// Jan 2020
// v1.15.25
// analytic function improvement
// v1.15.26 strange bug Inter (pré prod)
// v1.15.27 loop multi thread update
// v1.15.28 loop multi thread update #2
// v1.15.29 bug inter, many INDEX:GROUP_BY.INDEX.TMP.MAX_PERF indexes have been saved by error, so I had to increase GLOBAL_INDEX_LIST_LEN (for a bad reason)
// v1.15.30 bug fix in loop multi thread
// v1.15.31 optim in loop multi thread
// v1.15.32 remove printf, context lost issue (session change)
////////////// Feb 2020
// v1.15.33 problem if more than 10000 end users
// v1.15.34 bug fix in multi thread loop
// v1.15.35 bug fix in permission (very rare case, INTER)
// v1.15.36 bug fix in multi thread loop with where clause
// v1.15.37 allow table.col in select
// v1.15.38 optim refresh (multi thread, etc..)
// v1.15.39 change index col_type priority (1->table_count, then 0)
// v1.15.40 optim insert
// v1.15.41 improve lua error management
// v1.15.42 fix regression in partial view introduced in v1.15.38
// v1.15.43 MAX_PERF_FILTER_FN not working if MAX_PERF_COMPUTE_BIG_TABLES_JOIN set to n
// v1.15.44 NOT_IN_MEMORY_COLUMNS
// v1.15.45 MAX_PERF_USE_IVAL_OFTEN_LIMIT (pareto_conv_reverse & pareto_conv_normal not computed for some columns)
// v1.15.46 UNFRAG_BLOCK_PER_BLOCK
// v1.15.47 NOT_INDEXED_DIMENSIONS
// v1.15.48 bug fix
// v1.15.49 exp_iline_gby_counts U_INT -> long
// v1.15.50 loop/pass current values update
// v1.15.51 manage null in f_log_s (happen with lua errors)
// v1.15.52 manage \n\r
// v1.15.53 avoid "lua_pcall error for" error message (unnecessary formula check on group by columns)
// v1.15.54 SB_LAST, fn_key
////////////// March 2020
// v1.15.55 add refresh log in non verbose mode, improve other logs, bug in sb_last
// v1.15.56 null & NAN management in updates
// v1.15.57 fn_pivot improve, fn_custom out_multi_thread_autorized
// v1.15.58 sb_parallel
// v1.15.59 free dyn fn before and after
// v1.15.60 mem leak round
// v1.15.61 initial insert value, example INSERT_FORCE_VALUE.t_art_site_key:-1
// v1.15.62 allow update even if delete and also in refresh online
// v1.15.63 fix potential collision in save
// v1.15.64 bug fix table line count in loop/partition context
// v1.15.65 pre loop to load array data into memory
// v1.15.66 flush cache of "no_view" select after refresh dirty view
// v1.15.67 paritions_scope
// v1.15.68 check return code of pthread_create
// v1.15.69 fix typo in partitions_scope
// v1.15.70 limit INSERT_FORCE_VALUE to big tables and big_online tables
// v1.15.71 ERR_185
// v1.15.72 ERR_186 (select refused, too many active sessions)
// v1.15.73 mem leak round
// v1.15.74 thread/mutex round
// v1.15.75 line_count_after_last_refresh_dirty/rework loops (deleted lines not treated, possible to treat new lines only)
// v1.15.76 fix problem introduced in v1.15.48
// v1.15.77 occasional segfault for bad sql
// v1.15.78
// core at REMA
// v1.15.79 max_perf, drop the objects no longer computed (because of NOT_INDEXED_DIMENSIONS, NOT_IN_MEMORY_COLUMNS etc..),
// otherwise it is still used by selects
// v1.15.80 max_perf, if a big table column is not in memory replace it by joined dim column
// v1.15.81 fix lua exec with error generate segfault
// v1.15.82 ACTIVITY_SECURITY
// v1.15.83 array not in memory (iline) error between insert and refresh dirty
// v1.15.84 avoid memory peak in refresh
// v1.15.85 --#SB_f_get_max_perf tag
// v1.15.86 manage quotes in loop
// v1.15.87 REFRESH_FORCE
// v1.15.88 rework // v1.15.83
////////////// April 2020
// v1.15.89
// same as // v1.15.80 for select *
// v1.15.90
// ival refactor (fn_toto)
// v1.15.91
// rework permission view priority (cap_zone has site)
// v1.15.92
// bug fix SET_NULL_COLUMN
////////////// May 2020
// v1.15.93
// fn_refactor_col_type
// v1.16.00
// computed columns v0
// v1.16.01
// bug fix in table drop/create manipulation, refresh computed_columns, refresh cache
// v1.16.02
// like operator becomes case insensitive
// v1.16.03
// analytic functions results were always strings, never numbers
// v1.16.04
// incorrect caching in with clause based on other with clause
// v1.16.05
// allow fn_store function to be col_type
// v1.16.06
// change col_type_check cache logic
// v1.16.07
// bug fix
// v1.16.08
// SESSION_SECURITY
// v1.16.09
// use index in permission and all type of where clause
// v1.16.10
// --#SB_log_verbose_tag tag
// v1.16.11
// no more cache with SB tags
// v1.16.12
// optim countdistinct
// v1.16.13
// regression introduced by "non efficient index management"
// v1.16.14
// fix regression of v1.16.13
// v1.16.15
// index/where clause collision
// v1.16.16
// --#SB improve
// v1.16.17
// bug fix
// v1.16.18
// _MAX_COUNT_DISTINCT_THREAD_SIZE
// v1.16.19
// SEQUENCE_COLUMNS
// v1.16.20
// table#col syntax not working with partitions
// v1.16.21
// bug in avg
// v1.16.22
// error 43-138 is with (or with_something) is after select
// v1.16.23
// small bugs
// v1.16.24 manage lua compilation issue (avoid seg fault if this happens)
// v1.16.25
// bug fix in parsing
// v1.16.26
// piline_gby_to_op_col_pos_result_list -> RES_FLOAT_ARRAY (moved to double precision in aggregation)
////////////// June 2020
// v1.16.27
// core in SEQUENCE_COLUMNS context
// v1.16.28
// allow `lua formula` in all select, create tags `#DYN_SQL# and `#LOAD#
// v1.16.29
// avoid non fatal error mess display when testing the lua formula
// v1.16.30
// mem leak round
// v1.16.31
// bug fix ACTION store_code/dc_code with same ct in big table -> where clause problem using index
// v1.16.32
// support set param='val'
// v1.16.33
// fn_pivot, improve orphan management
// v1.16.34
// bug fixs analytic function
// v1.16.35
// index not computed (not compatible) for big/merge with sequence col, more verbose
// v1.16.36
// remove useless code for flat select
// v1.16.37
// SB tag explain
// v1.16.38
// params USE_INDEX_LIMIT, USE_INDEX_WITH_SORT_LIMIT, REPLACE_COUNTDISTINCT_BY_COUNTSEQUENCE
// v1.16.39
// remove obsolete code
// v1.16.40
// allow code mistakes for tmp arrays
// v1.16.41
// perf problem in sequence context
// v1.16.42
// seg fault in refresh_online + sequence context
// v1.16.43
// computed col rework, SO_FILE_NAME
////////////// July 2020
// v1.16.44
// bug: view partition include refresh_online view on partition
// v1.16.45
// manage callback in desc
// v1.16.46
// bounce command
// v1.16.47
// partition and refresh_online collision + bug fix core when insert triggers a new partition and next refresh is online in sequence context
// v1.16.48
// bounce command #2
// v1.16.49
// refresh_online view should not be flagged as dirty (needed for doc)
// v1.16.50
// potential bug when adding a column
// v1.16.51
// other bugs
// v1.16.52
// with clause not working after v1.16.47
// v1.16.53
// bugs/improvements allow fn_merge without with
// v1.16.54
// delete "invisible bug" fix
// v1.16.55
// SB_SYSTEM
// v1.16.56
// refresh dirty table
////////////// August 2020
// v1.16.57
// small things
// v1.16.58
// partition #10 does not trigger partition #11
// v1.16.59
// PERPETUAL license -> 1000 years
// v1.16.60
// SLEEP_AFTER_SQL (y/n)
// v1.16.61
// SB cluster, multi process mode (param NB_WORKERS in cluster.conf) & timeout management (param SQL_TIMEOUT in cluster.conf)
////////////// September 2020
// v1.16.62
// SB GENERATE_REPLAY for external sql only
// v1.16.63
// rework desc col_type
// v1.16.64
// mem leak round
// v1.16.65
// small things
// v1.16.66
// memory not cleaned in lua when table too big is allocated -> MAX_FN_DISPLAY_COL 1000
// v1.16.67
// keep lua_State attached to session (mem leak before)
// v1.16.68
// rework no cache mode
// v1.16.69
// manage some problems likes to restart after corruption
// v1.16.70
// backup command and _DESC.bck write
// v1.16.71
// save.lock
// v1.16.72
// investigate seg fault DG
// v1.16.73
// seg fault DG during purge
// v1.16.74
// computed columns rework, SB_VALS_VERSION 7,
// v1.16.75
// no delete if where clause returns zero rows, set_dirty,
// improve save.lock, prompt sure? in clear shells, manage save.lock in start.sh,
// change date format in sql.sh, add contexts to desc
// v1.16.76
// SEQUENCE_COLUMN moved back to pareto
// v1.16.77
// column type lost after v1.16.67 (all sorts were incorrect)
////////////// October 2020
// v1.16.78
// computed_column (without s), real column gets priority over computed col, INIT_FILE_PATH
// v1.16.79
// rework INIT_FILE_PATH, small bug fix for countsequence (keep logic order for partitions and online_refresh)
// v1.16.80
// change USE_INDEX_WITH_SORT_LIMIT default (before: 2, now: 10), new param SEQUENCE_COLUMN_COMPANIONS, mem leak round
// v1.16.81
// sql.sh regression time not in locale timezone,
// sql.sh no more socket close after 100 executions (kept without sql.sh)
// manage continue_on_error/stop_on_error as SQL (in C code, not in nodejs driver)
// fn_free_context_name sb_vals_version = 8
// mem check on computed columns
// rework transac sql
////////////// November 2020
// v1.16.82
// index on computed columns
// v1.16.83
// manage quote inside comments
// v1.16.84
// no log in init.sb (to avoid lines in doc after refresh dirty)
// v1.16.85
// NOT_IN_MEMORY_BIG_TABLES
// v1.16.86
// computed columns with param, big code change to allow this
////////////// December 2020
// v1.16.87
// computed columns not compatible with unique operator, bug in loop with where .. in (..)
// v1.16.88
// optim round + code clean, bug fix min->minstr converstion
// v1.16.89
// the rare lines are no longer inserted (with null values) in the often lines
// v1.16.90
// add fn_get_col_type_ival_count to U
// v1.16.91
// in loop: create thread_count*thread_count fn calls, to make sure I always have thread_count running
// , otherwise some thread (on old line for instance) may finish a lot before others
////////////// Jan 2021
// v1.16.92
// free sql_params in shutdown,
// , background done in start.sh and no longer in server.c (rewrite of start.sh)
// , use longjmp+return from main instead of exit (exit not working with LeakSanitizer)
// , improve housekeeping in transac sql
// , desc parameter <|verbose>
// , manage path/to/file insert with merge tables
// , explain sb_tag can be used even if there is an error in the sql execution
// , bug fix: hot change of log_verbose were not working
// , trap dlopen error
// v1.16.93
// replace | by ! in values returned (problem with table in html doc otherwise)
// , cluster: desc/set, custom.js
// , SPARSE_TEXT rework
// , drop COL_TYPE_INDEX
// , stormbase_common fix double call of error callback
// , fix potential corruption in defrag+save process
////////////// Feb 2021
// v1.16.94
// change big_online behavior, the full deletes are directly applied to table
// (not during refresh), and table are no longer volatile
// new STORAGE_FORMAT_VERSION (5)
// , error 205 (traps a theoretical case that should not happen in real life)
// , bug fix if clear_max_perf in refresh_online context
// v1.16.95
// bad description in stormbase.lua
// , explain sb_tag not working with driver calls
// , bug fix in sb_parallel
// , sql.sh --file:xx returns 0 instead of -1 if xx is not found
// , incorrect warning message when tcp TCP_PORT_TRANSAC is in use
// , error/segfault in fn_merge when col_type is empty
// , avoid lua exception in to_date when null value is passes
// , improve version.h
// , request_temporary_license.sh
// , license.c issue
// , bug fix in select comp_col('paramVal1'), comp_col('paramVal2') .. group by comp_col('paramVal1'), comp_col('paramVal2')
// , merge v1.16.94_HF1 segfault in multi user context (REMA)
////////////// Mar 2021
// v1.16.96
// upgrade nodejs,
// improve analytics documentation,
// change default param values TCP_PORT/PARTITION_LINE_COUNT,
// stop.sh refused during save,
// new param CELL_BLOCK_INCREMENT_SIZE_B for dev,
// improve some eror messages,
// delete old cell files instead of setting size to zero,
// add non regression test on fragmentation,
// cb shortcut for callback,
// allow column_name in all callbacks,
// allow '..`...',
// select_context_type in COMPUTED_COL_PREREQ (SB_LIB_VERSION 9),
// add sb_lib_version check,
// optimize select when same computed column appears several times,
// bug fix: loop freezes if SB is started in foreground mode,
// ALLOW_WHERE_ERROR, ALLOW_GROUP_BY_ERROR
// add fn_get_col_type_ival to UTILITY
// add UNKNOWN_IVAL in common.h
////////////// Apr 2021
// v1.16.97
// tableau compatibility: rework 02_sql/cluster.js 02_sql/lib/tcp_proxy.js 02_sql/lib/pgsql.js
// ESCAPE_SEPARATOR_INSIDE_DOUBLE_QUOTE (y/n)
// char text_update_sb_free; //SB_LIB_VERSION >= 10
// exp_ival3s removed
// new parameter: MAX_PERF_INDEX_ONLY
// rework SPARSE_TEXT type
// new command: set_sparse_text
// new command: defrag
// new parameter: DEBUG
// improve error login in csv insert
// new parameter: SKIP_LINE_KO
////////////// May 2021
// v1.16.98
// TRUNC_NUMBER param to support 4.04e-06 etc
// seg fault when p(computed_column)
// remove pareto conversion from analytic.c (done in max_perf_pre.c), note: big code change in analytic.c
// bug fix in computed columns
////////////// June 2021
// v1.16.99
// allow this: set 'insert_force_value.the_col_type'='something';
// bug fix: in computed col type A when needed column is compress
// bug fix: loop not done in full delete context
// ALLOW_ERROR param compatible with computed_columns (needed columns)
// callback can be replaced by |
// new callback fn grep
// bug fix in desc col_type (ival_count was text)
// secure thread creation during insert
// security (warning) for insertion of values longer that 1000 char -> treated as null
// several bug fix with select_slow
// cell arrays with file for sparse_text (pcarr->f_yn)
// pthread_create issue with 60K+ files in MAX_PERF (REMA)
// use infinite loop instead of recursivity in socket management (fn f_call) to avoid "Bus error"
// java jdbc driver, remove socket close/create every 100 calls (no longer needed because "Bus error" is fixed)
// new command set_text (number to text)
// optimize MAX_PERF init (VIEM_POS_2_IN_MEMORY_PARAMS)
// review comp col sharing (_f_comp_col_share_yn)
// bug fix comp col type A were not working with select_slow
// bug fix delete of empty table/partition was treated as full delete
// bug fix on with clause when col_type is empty
////////////// July 2021
// v1.17.00
// code clean
// core in where clause (dev case only)
// seg fault fix in partition/data model change/select * context
// fix regression introduced v1.16.99 in "with clause"/partition context
// bug fix: select_slow was not working with "with clause"
// seg fault in dev context (ARRAY_BLOCK size 2), because of NULL_IVAL
// optim query on col_type with high sparsity (ival_to_small_ival)
// limit number of threads for small selects
// GBY_ival_idx_to_gby_ivals_10 not used with high sparsity
// v1.17.01
// more logs in load
// parameter SPARSE_TEXT_KEEP + bug fix in SPARSE_TEXT
// TRUNC_NUMBER param is obsolete (1-e3 notation supported in all cases)
// support loop table(*) syntax
// add sb_export in common.c
// bug fix: where clause "=null" on join column match nothing (because index was used), now fact table is checked instead of using the index
// desc .. sql
// fix memory overlap issue (detected by valgrind)
////////////// September 2021
// v1.17.02
// fix regression of v1.17.00 on select_all
// ALLOW_WHERE_ERROR is not working with nn views
// no #lines limit for col_type checks without where clause
// better management of minstr/maxstr (using countd_first_ivals in merge operations when possible)
// bug fix, where clause issue in partition+select_slow context
////////////// October 2021
// v1.17.03
// bug fix in size.sh
// computed column type B
// add computed col parameters to fn_get_needed_columns (SB_LIB_VERSION 11)
// bug fix: sum(comp_col('param1','param2')) not working
// v1.17.04
// seg fault in countdistinct/select_slow context when #ivals > #lines in table
// bug fix in partition/"computed col with param" context
// small mem leaks fix
// disable index use for where clause containing null:
// if there is an orphan in a dimension, where col=null was returning orphan rows without index (or for irels rarely used)
// but nothing with index on irels often used
// seg fault on where clause in partition context
// manage unset with INSERT_FORCE_VALUE parameter
// computed col type B not working on pareto columns
// regression IN_MEMORY_BIG_TABLES params not taken into account
// seg fault with unique+countdistinct on same type A computed column
// pb only happened because pareto conversion was applied twice
////////////// December 2021
// v1.17.05
// lock not released after refresh permission if no permission changes
// debug mode in permission + refresh_force mode
// introduce PERMISSION_SUPER_USER_IVAL to avoid computing array permission in wildcard context
// IN_MEMORY_BIG_TABLES does not apply to child partitions
// add fn_update_idx1
// bug fix, with clause problem in partition context (problem is general but visible only in select_slow context)
// new parameter QUERY_TABLE_ALLOWED (tables can be queried directly)
// new parameter SKIP_REFRESH_FOR_NOT_IN_MEMORY_BIG_TABLES (views on big table are not refresh)
// trap system() error
// load init file before max_perf during startup (otherwise after a clear_max_perf in_memory parameters overload is not taken into account)
// change limit for select_all (20E6 -> MAX_GBY_BOOSTER_LEN/10)
// allows to specify column on which the with clause should be apply (when several columns have the same col_type in the view) (see alias_group_by_col)
// seg fault with #--SB explain, in specific context (very rare)
// for number columns and in some cases only, null values (zero len strings read from file) were inserted as zero
// new parameter ALLOW_EXP_ERROR
// group by clause can by omitted
// bug fix in export callback function, a line with OK was added in the export file
// bug fix in computed columns param fn('aaa,bbb') was treated as fn('aaa','bbb')
// new callback functions: open_join and keep_columns
////////////// March 2022
// v1.17.06
// get_sb_opt management in compile.sh
// add ./_SO_LINUX to LD_LIBRARY_PATH (other needed .so can be put in _SO_LINUX)
// select without group by not working when more than 2 group by columns
// OOM in open_join context
// null number column were displayed as # in open_join context, now it is zero
// improve #DYN_SQL# and #LOAD# management
// union callback function
// change GENERATE_REPLAY behavior, generates 2 files now :
// - stormbase_replay1.sql (before dyn sql)
// - stormbase_replay2.sql (after dyn sql)
// - tag #LOAD_KEEP is also introduced
// remove some logs "warning view in memory with non merge dimension (same line count) ..."
// fix seg fault with many group by columns
// show lua error even when log_verbose is n
// bug fix in union
// string formatting done to early in the callback process
// remove callback compilation check before execution
// line. can be omitted in add_number/text formulas
// new callback function rename
// "nan" strings are now treated as zeros for number columns
// bug fix round(0,2) was returning 0.5 instead of 0
// problems with non in memory tables (indexes were lost)
// rework of monitor.sh
// bug fix when using batch insert values with numbers
// improve UTILITY (SB_LIB_VERSION 12)
// standard update function moved to common.c (in order to provide code samples)
// automatic computed column creation from fn_computed_col (only A type for the moment)
// COMB_COUNT moved from 5 to 6
// work_area added to SB_VALS (SB_LIB_VERSION 13)
// display ms in log if DEBUG=y (see STARTUP_TIME_MS)
// bug fix in unsigned int limit check
// ./sql.sh change retry delay from 1 minute to 10 minutes
// fn_update_idx1_num
// bug fix open_join in partition context not working -> SB crash
// set param_name=default
// max_perf not calculated for empty views
// -> select changed to select_slow on empty views
// -> select not run against empty partition/child view to avoid bug in select_slow context
// change MAX_GBY_BOOSTER_LEN from int to long
// v1.17.06 useless init in fn_store/fn_merge context
// v1.17.06 RESULT_PARAM optim, members moved to MAX_PERF_FN_PARAM
// v1.17.06 rewrite of index/booster algo
// v1.17.06 combined index (replaces select w/o booster)
// v1.17.06 no select against empty partitions
// v1.17.06 optim where clause on ival with high cardinality in index context
// v1.17.06 put back "optimize MAX_PERF init (VIEM_POS_2_IN_MEMORY_PARAMS)", view_pos issue recycle fixed
// v1.17.06 new param ACTIVATE_NEW_DEV, used for combined index activation in this verson
// v1.17.06 select on not in memory views return empty --> now returns a clear non blocking message
// v1.17.06 set_dirty will also flag partitions as dirty
// v1.17.06 add SKIP return code in loops
// v1.17.06 "where_index with null value, index can't be used" check, kept only for "col in or col =" where clauses
// v1.17.06 allow semi column in quoted string (with sql.sh), ex. system 'echo "aaa;"';
// v1.17.06 allow spaces before "with" keyword
// v1.17.06 small mem leaks
////////////// August 2022
// v1.17.07
// v1.17.07 hash group by (POC)
// v1.17.07 bug fix, disable this optim for computed columns where origin and dest col_type are not same:
// v1.17.06 optim where clause on ival with high cardinality in index context
// v1.17.07 bug fix, incorrect result in fn_store+no_booster context
// v1.17.07 skipping index on computed column type A if >106
// v1.17.07 new standard update function fn_copy_col
// v1.17.07 reverse index on computed columns created with fn_computed_col
// v1.17.07 top/bottom with zero (or invalid integer) return error (seg fault before)
// v1.17.07 ALLOW_WHERE_ERROR was not managed for computed col created with fn_computed_col
// F for final
// v1.17.07_F seg fault in ALLOW_WHERE_ERROR context and "double col_type check"
// v1.17.07_F improve fn_build_idx1_num
// v1.17.07_F computed columns created by fn_computed_col -> column name in param becomes case non sensitive
// v1.17.07_F free VIEM_POS_2_IN_MEMORY_PARAMS after view drop (otherwise VIEM_POS_2_IN_MEMORY_PARAMS_LEN limit is reached in refresh_online context)
// v1.17.07_F regression in refresh dirty view context (because view are no longer drop)
// v1.17.07_F bug fix in delete+refresh dirty table+select_slow context -> rel_matrix and big table are out of sync
// v1.17.07_F col_type_check wait for cache
// v1.17.07_F seg fault in export+empty table context
// v1.17.07_F seg fault in 2 SB on same INT/MAX_PERF context, rework of PIN_MEMORY parameter
// v1.17.07_F9 problem for empty table with empty file insert in refresh online context
// v1.17.07_F10 seg fault in select (context not understood)
////////////// November 2022
// v1.17.08
// v1.17.08 allow changing column order in tables, and removing columns
// v1.17.08 no_view potential problem (detected by valgrind)
// v1.17.08_F1 allow changing column order in tables, and removing columns (rework)
// v1.17.08_F1 sb_hgb_context_free
// v1.17.08_F2 seg fault with hash_group_by when table is empty
// v1.17.08_F3 escape "-" in regex lua function
// v1.17.08_F4 add lua function is_not
// v1.17.08_F5 fix regression on with clause using function
// v1.17.08_F6 avoid seg fault when last partition of with/fn_store is select_slow+view dirty (DHZ DFAI)
// v1.17.08_F7 seg fault in flat select with limit clause (CAS DFAI)
// v1.17.08_F8 minor modifications on common.h and common.c
// v1.17.08_F9 manage tables bigger than 2GB lines in hash_group_by
// v1.17.08_F10 bug fix, context (hard to reproduce): view empty/is_mp_dirty=n, partition not empty /is_mp_dirty=y, with/fn_store/fn_merge
// -> sql returns error 151 instead of seg fault
// v1.17.08_F11 bug fix, table signature change was not detected when we change a column name
// v1.17.08_F12 bug fix, problem loading error message in stormbase_common.js (when called from external program)
////////////// March 2023
// v1.17.09 add SB_VALS.line_fetch (SB_LIB_VERSION 14)
// v1.17.09 bug fix SB_VALS.work_area not passed to partition loop
// v1.17.09 multi threading of fn_hash_group_by
// v1.17.09 max_perf index on non in memory big tables are no longer loaded in PIN_MEMORY context (reduce memory for SPN)
// v1.17.09 reduce memory usage in this context: loop on full scope with where clause
// v1.17.09 add is_drop_yn info to context and fn_get_context_is_drop_yn to U
// v1.17.09 U can be access directly from custom code
// v1.17.09_F1 add parameter retry to sql.sh (stormbase_sql.js)
// v1.17.09_F2 improve performance of hash group by (hash generated by fn_hash_modular were too small in many cases)
// v1.17.09_F3 Bug fix: seg fault when view with non merge dimension+delete on table+refresh dirty table+select on view
// v1.17.09_F4 Bug fix: error 157 when same column appeared twice in sub select
// v1.17.09_F5 Bug fix: seg fault in cb_c col_type_check using count
// v1.17.09_F6 Add warning in standard update function (to avoid seg faults when usage is incorrect)
// v1.17.09_F6 Add hwm (high water mark) monitoring in monitor.sh
// v1.17.09_F7 Add MEM_OS_AVAILABLE in monitor_high_water_mark.txt (monitor.sh)
// v1.17.09_F8 Very rare seg fault (DHZ store prod) when select during computed col free
////////////// August 2023
// v1.17.10 Support for SB_CONF_PATH, SB_LICENSE_PATH, /sb_host_etc
// v1.17.10 Bux fix: data not exported with export.sh when two tables have closed names (foo and foo_something for instance)
// v1.17.10_F1 remove compilation warnings
// v1.17.10_F2 minor changes in common.c to avoid compilation warnings
// v1.17.10_F2 Add TABLE_CSV management to UTILITY
// v1.17.10_F2 Buf fix: manage SB_CONF_PATH in shells
////////////// October 2023
// v1.17.10_F3 set priority_over_real_column_yn = 'y' for computed columns type A and B
// v1.17.10_F4 rollback set priority_over_real_column_yn = 'y' for computed columns type A and B
// v1.17.10_F4 Bug fix: export.sh, bad management of table/view partitions
// v1.17.10_F5 Bug fix: allow / and . in computed columns parameters
// v1.17.10_F6 fn_build_idx1 allow setting context name with one parameter
// v1.17.10_F6 add fn_export (same as sb_export) to common.c, sb_export kept for compatibility
// v1.17.10_F6 add fn_cartesian_from_contexts from common.c
// v1.17.10_F7 allow to set SB_LICENSE_PATH as parameter
// v1.17.10_F8 bug fix: seg fault in fn_cartesian_from_contexts when a context is empty
// v1.17.10_F9 introduce CONTINUE_IVAL in computed columns
// v1.17.10_F9 fn_eval initial beta version
// v1.17.10_F10 CONTINUE_IVAL bug fix
// v1.17.10_F11 optimize refresh in high cardinality col_type context
// v1.17.10_F11 force clean_periodic after refresh_online (otherwise the 5 possible online views may be in use in the same minute and next refresh online will fail)
// v1.17.10_F12 fix regression (seg fault) from "optimize refresh in high cardinality col_type context"
// v1.17.10_F13 push limit for error 268 from 1 billion to 1.5 (REMA issue)
// v1.17.10_F14 add mutex on call to clean_periodic from SQL (collision with background thread + seg fault)
// v1.17.10_F15 change clean_periodic so that previous view is not drop (check on active sql is not 100%)
// v1.17.10_F16 seg fault when pre select fn returns NULL and computed col is not type A or B
// v1.17.10_F17 bug fix in monitor.sh regarding partition management
// v1.17.10_F18 allow non string parameters in btwe_s
// v1.17.10_F19 return sql error instead of stopping SB when an in clause contains thousands of values (and does not fit in a single memory cell)
// v1.17.10_F20 seg fault when calling several "number computed columns" in one sql
// v1.17.10_F21 bug fix: possible incorrect results in dimensions in multi partitions context (problems are a bit different in select and select_slow but both may be incorrect)
// v1.17.10_F22 rework v1.17.10_F19 return sql error instead of stopping SB when an in clause contains thousands of values (and does not fit in a single memory cell)
// v1.17.10_F23 housekeeping in shell scripts
// v1.17.10_F24 small bug fix in get_server_info.sh
// v1.17.10_F25 bug fix: seg fault for files with \r (CR) only as end of line
// v1.17.10_F26 fix optimization introduced in v1.17.10_F11 (happens in MAX_PERF_FILTER context only)
// v1.17.10_F27 error code 222 and file stormbase.debug are introduced to manage dynamic sql errors
// v1.17.10_F28 bug fix: cache is now managed using the original sql (with the #LOAD# etc..)
// v1.17.10_F29 evo: add execute_SQL_sync in stormbase_common.js