Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #445, organizations: use ANY_VALUE() around name column #237

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

t4k
Copy link
Contributor

@t4k t4k commented Jun 13, 2017

PHP message: PHP Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in /var/www/coral/organizations/admin/classes/domain/Organization.php on line 645

Issue #77

PHP message: PHP Warning:  mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in /var/www/coral/organizations/admin/classes/domain/Organization.php on line 645
@t4k
Copy link
Contributor Author

t4k commented Jun 13, 2017

This needs work. While it fixes the warning, the query is not actually working. Investigating.

@t4k
Copy link
Contributor Author

t4k commented Jun 13, 2017

This has become intertwined with #236.

The “Starts with” letter list was not working and `$this->db->getDatabase()` had the following error:
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'coral_organizations.O.name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
@PaulPoulain PaulPoulain added the bug This is a bug (not an enhancement) label Dec 12, 2017
@jeffnm
Copy link
Member

jeffnm commented Oct 24, 2018

@t4k Can you comment on this PR again? I'm unclear if it could be included in 3.0.1 or not.

The underlying error from `PHP Warning:  mysqli_fetch_assoc() expects parameter
1 to be mysqli_result, boolean given in
…/organizations/admin/classes/domain/Organization.php on line 690`

is

`Expression #1 of SELECT list is not in GROUP BY clause and contains
nonaggregated column 'coral_organizations.O.name' which is not functionally
dependent on columns in GROUP BY clause; this is incompatible with
sql_mode=only_full_group_by`

Running the query directly in MySQL 5.7 will produce the error. Using the
ANY_VALUE() function suppresses the test for nondeterminism.

https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_any-value
@t4k
Copy link
Contributor Author

t4k commented Feb 13, 2019

The underlying error from PHP Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in …/organizations/admin/classes/domain/Organization.php on line 690

is

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'coral_organizations.O.name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Running the query directly in MySQL 5.7 will produce the error. Using the
ANY_VALUE() function suppresses the test for nondeterminism.

https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_any-value

@t4k t4k changed the title Add check for empty query result; fix PHP Warning. issue #445, organizations: use ANY_VALUE() around name column Feb 13, 2019
@t4k t4k self-assigned this Mar 22, 2019
@t4k
Copy link
Contributor Author

t4k commented Mar 22, 2019

As noted in #536 the use of ANY_VALUE() is incompatible with MariaDB. This needs work.

MariaDB does not have ANY_VALUE() function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug (not an enhancement)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants