Patch SetGroupBy-params-bugfix for sphinx Bug #67216
Patch version 2014-05-06 12:56 UTC
Return to Bug #67216 |
Download this patch
Patch Revisions:
Developer: saprykin.dmitry@gmail.com
--- sphinx.c 2014-05-06 16:49:11.351156773 +0400
+++ sphinx.c.patched 2014-05-06 16:49:32.255157414 +0400
@@ -685,11 +685,19 @@
php_sphinx_client *c;
char *attribute, *groupsort = NULL;
int attribute_len, groupsort_len, func, res;
+ long func_param;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|s", &attribute, &attribute_len, &func, &groupsort, &groupsort_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|s", &attribute, &attribute_len, &func_param, &groupsort, &groupsort_len) == FAILURE) {
return;
}
+ if( func_param >= SPH_GROUPBY_DAY && func_param <= SPH_GROUPBY_ATTRPAIR ) {
+ func = func_param;
+ }
+ else {
+ func = SPH_GROUPBY_DAY;
+ }
+
if (groupsort == NULL) {
groupsort = "@group desc";
}
|