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

SQL Error - Search - "does not sound like" #3775

Open
fufroma opened this issue Jan 18, 2024 · 10 comments
Open

SQL Error - Search - "does not sound like" #3775

fufroma opened this issue Jan 18, 2024 · 10 comments
Assignees
Labels
bug database issues specific to databases search Problems in the search class

Comments

@fufroma
Copy link
Contributor

fufroma commented Jan 18, 2024

  • Ampache 6.2.1
  • Debian bookworm up-to-date
  • MariaDB 10.11.4

In the search form, if I search for something with "sounds like", everything's fine.

If I search the same thing with "does not sounds like", no result and we have a SQL error:

(Ampache\Module\System\Dba) -> Error_query SQL: SELECT DISTINCT(`song`.`id`), `song`.`file` FROM `song`  WHERE `song`.`title` NOT SOUNDS LIKE ? ORDER BY `song`.`file` ["ani"]
(Ampache\Module\System\Dba) -> Error_query MSG: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SOUNDS LIKE 'ani' ORDER BY `song`.`file`' at line 1

The two SQL query:

SELECT DISTINCT(`song`.`id`), `song`.`file` FROM `song`  WHERE `song`.`composer`  SOUNDS  LIKE 'ani' ORDER BY `song`.`file` ;
SELECT DISTINCT(`song`.`id`), `song`.`file` FROM `song`  WHERE `song`.`composer`  NOT SOUNDS  LIKE 'ani' ORDER BY `song`.`file` ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SOUNDS  LIKE 'ani' ORDER BY `song`.`file`' at line 1

Look like "NOT SOUNDS LIKE" is not a valid query with MariaDB, or if it need some plugins we miss to check them.

Look like the demo website got the same issue.

@lachlan-00
Copy link
Member

i'll convert them to not in i can't see a not sounds like

@lachlan-00
Copy link
Member

lachlan-00 commented Jan 19, 2024

actually has that ever worked? i looked at 3.9.0 and it's just being used as an operator.

probably needs a larger change to fake create the option. there are 30 search terms where i'll need to make it

basically just convert them all to

WHERE NOT (`song`.`composer`  SOUNDS  LIKE 'ani') ORDER BY `song`.`file`

@lachlan-00 lachlan-00 added bug database issues specific to databases search Problems in the search class labels Jan 19, 2024
@lachlan-00 lachlan-00 self-assigned this Jan 19, 2024
@fufroma
Copy link
Contributor Author

fufroma commented Jan 19, 2024

I'm sure you like my new year present ;)

@fufroma
Copy link
Contributor Author

fufroma commented Mar 15, 2024

Maybe we could "just" remove it until we make it work?

@lachlan-00
Copy link
Member

i'm about to do some work in #3880 so i'll be able to do it there.

@fufroma
Copy link
Contributor Author

fufroma commented Mar 18, 2024

I think #3880 didn't address the issue

@lachlan-00
Copy link
Member

i've added the no into a wrapped NOT here b682542

@lachlan-00
Copy link
Member

lachlan-00 commented Mar 18, 2024

those should all be done now after 2d38c07 (actually efd60dd as there were some leftover copy/paste)

@fufroma
Copy link
Contributor Author

fufroma commented Mar 19, 2024

\o/
are you planning a to release a 6.3.1? just to know if I need to backport all those patch to my production or if there will be a release in a quite soon

@lachlan-00
Copy link
Member

i usually try and do one within the first two weeks. after a major like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug database issues specific to databases search Problems in the search class
Projects
None yet
Development

No branches or pull requests

2 participants