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

The new version is not code compatible with v11.10. #329

Closed
hmingv opened this issue Feb 7, 2023 · 1 comment
Closed

The new version is not code compatible with v11.10. #329

hmingv opened this issue Feb 7, 2023 · 1 comment

Comments

@hmingv
Copy link

hmingv commented Feb 7, 2023

Describe the bug
Hi, maintainers.

I noticed a new version of this package was released: v11.11

Great, I updated to this version today.

But I ran into a problem, my code that used to work fine in v11.10 is now reporting an error.

I now need to add a table prefix for belong_id, otherwise it is ambiguous.

To Reproduce
reproduce? Maybe the problem happens when you use with and don't set table name prefix for it.

Expected behavior
I expect it to be compatible with version V11.10 to make my code run.

Screenshots
image

Versions (please complete the following information)

  • PHP: 8.0.27
  • Database: 5.7 / 8.0
  • Laravel: 9.50.2
@hmingv hmingv added the bug label Feb 7, 2023
@hmingv
Copy link
Author

hmingv commented Feb 7, 2023

Generated SQL statement:

SELECT
  `id`,
  `belong_id`,
  `locale`,
  `name`
FROM
  `es_category_translations`
  INNER JOIN (
    SELECT
      MAX(`es_category_translations`.`id`) AS `id_aggregate`,
      `es_category_translations`.`belong_id`
    FROM
      `es_category_translations`
      INNER JOIN (
        SELECT
          max(`es_category_translations`.`belong_id`) AS `belong_id_aggregate`,
          `es_category_translations`.`belong_id`
        FROM
          `es_category_translations`
        WHERE
          `locale` = 'en-US'
          AND `es_category_translations`.`belong_id` IN (
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20
          )
        GROUP BY
          `es_category_translations`.`belong_id`
      ) AS `es_translation` ON `es_translation`.`belong_id_aggregate` = `es_category_translations`.`belong_id`
      AND `es_translation`.`belong_id` = `es_category_translations`.`belong_id`
    WHERE
      `locale` = 'en-US'
    GROUP BY
      `es_category_translations`.`belong_id`
  ) AS `es_translation` ON `es_translation`.`id_aggregate` = `es_category_translations`.`id`
  AND `es_translation`.`belong_id` = `es_category_translations`.`belong_id`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants