Skip to content
Permalink
Browse files

Fixes #181, wrong count(*). Affected tests models renewed.

Let count(*) be counted in int64 instead of 32-bits integers.
The change, however, doesn't seem to require any API version increase,
since daemon could correctly hold mixed-width answers and automatically
adopt the widest one.
  • Loading branch information
klirichek committed Feb 6, 2018
1 parent 87821fd commit 83744a977d7837d1d87cd506b88b0e7eb199efe6
@@ -5506,7 +5506,7 @@ ISphMatchSorter * sphCreateQueue ( SphQueueSettings_t & tQueue )
eGroupByResult = SPH_ATTR_BIGINT;

CSphColumnInfo tGroupby ( "@groupby", eGroupByResult );
CSphColumnInfo tCount ( "@count", SPH_ATTR_INTEGER );
CSphColumnInfo tCount ( "@count", SPH_ATTR_BIGINT );
CSphColumnInfo tDistinct ( "@distinct", SPH_ATTR_INTEGER );

tGroupby.m_eStage = SPH_EVAL_SORTER;
@@ -1 +1 @@
a:1:{i:0;a:10:{i:0;a:13:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:2:{s:11:"50000000000";a:2:{s:6:"weight";s:4:"1642";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:11:"50000000001";a:2:{s:6:"weight";s:4:"1642";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"2";s:11:"total_found";s:1:"2";s:4:"time";s:5:"0.000";s:5:"words";a:1:{s:4:"five";a:2:{s:4:"docs";s:1:"2";s:4:"hits";s:1:"2";}}s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:4:"five";}i:1;a:13:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:2:{s:20:"18446744073709551613";a:2:{s:6:"weight";s:4:"1642";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:20:"18446744073709551614";a:2:{s:6:"weight";s:4:"1642";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"2";s:11:"total_found";s:1:"2";s:4:"time";s:5:"0.000";s:5:"words";a:1:{s:4:"last";a:2:{s:4:"docs";s:1:"2";s:4:"hits";s:1:"2";}}s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:4:"last";}i:2;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:5:"total";s:1:"0";s:11:"total_found";s:1:"0";s:4:"time";s:5:"0.000";s:5:"words";a:1:{s:3:"max";a:2:{s:4:"docs";s:1:"0";s:4:"hits";s:1:"0";}}s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:3:"max";}i:3;a:13:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:3:{s:19:"9223372036854775806";a:2:{s:6:"weight";s:4:"1592";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:19:"9223372036854775807";a:2:{s:6:"weight";s:4:"1592";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:19:"9223372036854775808";a:2:{s:6:"weight";s:4:"1592";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"3";s:11:"total_found";s:1:"3";s:4:"time";s:5:"0.000";s:5:"words";a:1:{s:3:"mid";a:2:{s:4:"docs";s:1:"3";s:4:"hits";s:1:"3";}}s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:3:"mid";}i:4;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:3:{s:11:"50000000000";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:11:"50000000001";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:11:"60000000000";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"3";s:11:"total_found";s:1:"3";s:4:"time";s:5:"0.000";s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:0:"";}i:5;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:5:{s:19:"9223372036854775806";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:19:"9223372036854775807";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:19:"9223372036854775808";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:20:"18446744073709551613";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:20:"18446744073709551614";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"5";s:11:"total_found";s:1:"5";s:4:"time";s:5:"0.000";s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:0:"";}i:6;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:1:{s:19:"9223372036854775807";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"1";s:11:"total_found";s:1:"1";s:4:"time";s:5:"0.000";s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:0:"";}i:7;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:4:{s:3:"sel";i:6;s:1:"n";i:1;s:8:"@groupby";i:6;s:6:"@count";i:1;}s:7:"matches";a:9:{s:19:"9223372036854775807";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:19:"9223372036854775807";s:1:"n";i:42;s:8:"@groupby";s:19:"9223372036854775807";s:6:"@count";i:1;}}s:19:"9223372036854775806";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:19:"9223372036854775806";s:1:"n";i:42;s:8:"@groupby";s:19:"9223372036854775806";s:6:"@count";i:1;}}s:11:"60000000001";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:11:"60000000001";s:1:"n";i:42;s:8:"@groupby";s:11:"60000000001";s:6:"@count";i:1;}}s:11:"60000000000";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:11:"60000000000";s:1:"n";i:42;s:8:"@groupby";s:11:"60000000000";s:6:"@count";i:1;}}s:11:"50000000001";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:11:"50000000001";s:1:"n";i:42;s:8:"@groupby";s:11:"50000000001";s:6:"@count";i:1;}}s:11:"50000000000";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:11:"50000000000";s:1:"n";i:42;s:8:"@groupby";s:11:"50000000000";s:6:"@count";i:1;}}s:20:"18446744073709551614";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";i:-2;s:1:"n";i:42;s:8:"@groupby";i:-2;s:6:"@count";i:1;}}s:20:"18446744073709551613";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";i:-3;s:1:"n";i:42;s:8:"@groupby";i:-3;s:6:"@count";i:1;}}s:19:"9223372036854775808";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:20:"-9223372036854775808";s:1:"n";i:42;s:8:"@groupby";s:20:"-9223372036854775808";s:6:"@count";i:1;}}}s:5:"total";s:1:"9";s:11:"total_found";s:1:"9";s:4:"time";s:5:"0.000";s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:0:"";}i:8;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:1:{s:11:"60000000001";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"1";s:11:"total_found";s:1:"1";s:4:"time";s:5:"0.000";s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:0:"";}i:9;a:3:{s:8:"sphinxql";s:41:" select * from test where id<60000000002 ";s:10:"total_rows";i:4;s:4:"rows";a:4:{i:0;a:2:{s:2:"id";s:11:"50000000000";s:1:"n";s:2:"42";}i:1;a:2:{s:2:"id";s:11:"50000000001";s:1:"n";s:2:"42";}i:2;a:2:{s:2:"id";s:11:"60000000000";s:1:"n";s:2:"42";}i:3;a:2:{s:2:"id";s:11:"60000000001";s:1:"n";s:2:"42";}}}}}
a:1:{i:0;a:10:{i:0;a:13:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:2:{s:11:"50000000000";a:2:{s:6:"weight";s:4:"1642";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:11:"50000000001";a:2:{s:6:"weight";s:4:"1642";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"2";s:11:"total_found";s:1:"2";s:4:"time";s:5:"0.000";s:5:"words";a:1:{s:4:"five";a:2:{s:4:"docs";s:1:"2";s:4:"hits";s:1:"2";}}s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:4:"five";}i:1;a:13:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:2:{s:20:"18446744073709551613";a:2:{s:6:"weight";s:4:"1642";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:20:"18446744073709551614";a:2:{s:6:"weight";s:4:"1642";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"2";s:11:"total_found";s:1:"2";s:4:"time";s:5:"0.000";s:5:"words";a:1:{s:4:"last";a:2:{s:4:"docs";s:1:"2";s:4:"hits";s:1:"2";}}s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:4:"last";}i:2;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:5:"total";s:1:"0";s:11:"total_found";s:1:"0";s:4:"time";s:5:"0.000";s:5:"words";a:1:{s:3:"max";a:2:{s:4:"docs";s:1:"0";s:4:"hits";s:1:"0";}}s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:3:"max";}i:3;a:13:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:3:{s:19:"9223372036854775806";a:2:{s:6:"weight";s:4:"1592";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:19:"9223372036854775807";a:2:{s:6:"weight";s:4:"1592";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:19:"9223372036854775808";a:2:{s:6:"weight";s:4:"1592";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"3";s:11:"total_found";s:1:"3";s:4:"time";s:5:"0.000";s:5:"words";a:1:{s:3:"mid";a:2:{s:4:"docs";s:1:"3";s:4:"hits";s:1:"3";}}s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:3:"mid";}i:4;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:3:{s:11:"50000000000";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:11:"50000000001";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:11:"60000000000";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"3";s:11:"total_found";s:1:"3";s:4:"time";s:5:"0.000";s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:0:"";}i:5;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:5:{s:19:"9223372036854775806";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:19:"9223372036854775807";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:19:"9223372036854775808";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:20:"18446744073709551613";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}s:20:"18446744073709551614";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"5";s:11:"total_found";s:1:"5";s:4:"time";s:5:"0.000";s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:0:"";}i:6;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:1:{s:19:"9223372036854775807";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"1";s:11:"total_found";s:1:"1";s:4:"time";s:5:"0.000";s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:0:"";}i:7;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:4:{s:3:"sel";i:6;s:1:"n";i:1;s:8:"@groupby";i:6;s:6:"@count";i:6;}s:7:"matches";a:9:{s:19:"9223372036854775807";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:19:"9223372036854775807";s:1:"n";i:42;s:8:"@groupby";s:19:"9223372036854775807";s:6:"@count";i:1;}}s:19:"9223372036854775806";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:19:"9223372036854775806";s:1:"n";i:42;s:8:"@groupby";s:19:"9223372036854775806";s:6:"@count";i:1;}}s:11:"60000000001";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:11:"60000000001";s:1:"n";i:42;s:8:"@groupby";s:11:"60000000001";s:6:"@count";i:1;}}s:11:"60000000000";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:11:"60000000000";s:1:"n";i:42;s:8:"@groupby";s:11:"60000000000";s:6:"@count";i:1;}}s:11:"50000000001";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:11:"50000000001";s:1:"n";i:42;s:8:"@groupby";s:11:"50000000001";s:6:"@count";i:1;}}s:11:"50000000000";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:11:"50000000000";s:1:"n";i:42;s:8:"@groupby";s:11:"50000000000";s:6:"@count";i:1;}}s:20:"18446744073709551614";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";i:-2;s:1:"n";i:42;s:8:"@groupby";i:-2;s:6:"@count";i:1;}}s:20:"18446744073709551613";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";i:-3;s:1:"n";i:42;s:8:"@groupby";i:-3;s:6:"@count";i:1;}}s:19:"9223372036854775808";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:4:{s:3:"sel";s:20:"-9223372036854775808";s:1:"n";i:42;s:8:"@groupby";s:20:"-9223372036854775808";s:6:"@count";i:1;}}}s:5:"total";s:1:"9";s:11:"total_found";s:1:"9";s:4:"time";s:5:"0.000";s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:0:"";}i:8;a:12:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:4:"text";}s:5:"attrs";a:1:{s:1:"n";i:1;}s:7:"matches";a:1:{s:11:"60000000001";a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:1:{s:1:"n";i:42;}}}s:5:"total";s:1:"1";s:11:"total_found";s:1:"1";s:4:"time";s:5:"0.000";s:8:"resarray";i:0;s:8:"roundoff";i:0;s:5:"query";s:0:"";}i:9;a:3:{s:8:"sphinxql";s:41:" select * from test where id<60000000002 ";s:10:"total_rows";i:4;s:4:"rows";a:4:{i:0;a:2:{s:2:"id";s:11:"50000000000";s:1:"n";s:2:"42";}i:1;a:2:{s:2:"id";s:11:"50000000001";s:1:"n";s:2:"42";}i:2;a:2:{s:2:"id";s:11:"60000000000";s:1:"n";s:2:"42";}i:3;a:2:{s:2:"id";s:11:"60000000001";s:1:"n";s:2:"42";}}}}}

Large diffs are not rendered by default.

0 comments on commit 83744a9

Please sign in to comment.
You can’t perform that action at this time.