Skip to content

MATCH AGAINST not working in MYSQL #1192

Closed

Description

@raymondgitonga

Version

1.9.0

What happened?

Playground

Code generated doesn't include function parameters for against field.

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

No response

What operating system are you using?

macOS

What database engines are you using?

MySQL

What type of code are you generating?

Go

Activity

  1. added
    bugSomething isn't working
    triageNew issues that hasn't been reviewed
    on Sep 17, 2021
  2. kyleconroy commented on Sep 17, 2021

    @kyleconroy
    Collaborator

    The playground link you posted isn't working. Can you include the SQL and JSON here in the issue?

  3. added
    questionFurther information is requested
    and removed
    triageNew issues that hasn't been reviewed
    on Sep 20, 2021
  4. diasjuniorr commented on May 23, 2022

    @diasjuniorr
    select produto_sku, produto_nome, 'P' as tipo, familia_id, ifnull(produto_tipo,'') as produto_tipo, categoria_title, 
                                    categoria_id, sub_categoria_nome, indicado_descricao, indicado_id, categoria_nome, 
                                    match(produto_termo_chave) against("dipirona") as vl_match , 
                                    if(match(produto_termo_chave) against("dipirona" IN BOOLEAN MODE) > 0, 1,
                                     if(match(produto_principio_ativo) against("dipirona" IN BOOLEAN MODE) > 0, 3, 
                                      if(match(indicado_descricao) against("dipirona" IN BOOLEAN MODE) > 0, 4, 
                                       if(match(sub_categoria_nome) against("dipirona" IN BOOLEAN MODE) > 0, 5, 6)))) as tipo_resultado, 
                                     produto_qtde_ofertas, if(ifnull(produto_qtde_ofertas,0) = 0, 'N', 'S') as disponibilidade
                                from tbl_produto_autocomplete
                                where (match(produto_termo_chave) against("dipirona" IN BOOLEAN MODE))
                                 or (match(sub_categoria_nome) against("dipirona" IN BOOLEAN MODE)) 
                                 or (match(produto_principio_ativo) against("dipirona" IN BOOLEAN MODE)) 
                                 or (match(indicado_descricao) against("dipirona" IN BOOLEAN MODE)) 
                                order by categoria_id, disponibilidade desc, tipo_resultado, produto_qtde_ofertas desc,  produto_nome;

    @kyleconroy this query is a good example. sqlc cannot generate it and throws an exception near > 0,1.

  5. morgangallant commented on Sep 7, 2022

    @morgangallant

    Just for some additional context / example here, here's a simple playground link. Been trying sqlc.arg w/ no success. Any ideas here for a workaround?

  6. hackthehackerman commented on Nov 5, 2022

    @hackthehackerman

    Encountered the same issue. sqlc seems to ignore parameter inside a match against(?) clause

  7. added and removed
    questionFurther information is requested
    on Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions