GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — fix: include cross-JOIN ON referenced columns in count subquery for MySQL by youdaoSu · Pull Request #878 · APIJSON/APIJSON Conversation
Contributor
SummaryFix for issue #824 (multi-JOIN count pagination). When Example (from the issue): SELECT count(*) AS `count` FROM `Inventory` AS `Inventory` LEFT JOIN ( SELECT `code` FROM `Location_info` ) AS `Location_info` ON `Location_info`.`code` = `Inventory`.`location_code` LEFT JOIN ( SELECT `id` FROM `Warehose_info` ) AS `Warehose_info` ON `Warehose_info`.`id` = `Location_info`.`warehouse_id`
ChangeIn PostgreSQL (and other non-MySQL databases) keep their existing TestsAdded
Full suite: 38 tests, 0 failures. fixes #824
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
…ySQL When HEAD (count pagination) uses multiple JOINs, the subquery for each JOIN table only selected its own ON key (on.getKey()). If another JOIN's ON clause references a column of this table (e.g. Warehose_info.id@ = /Location_info/warehouse_id), that column was missing from the subquery, causing an Unknown column error on MySQL. Now, for MySQL-family databases, also collect the targetKey of any ON clause (from any JOIN in the list) whose target table/alias matches the current JOIN table. PostgreSQL keeps its SELECT * fallback. issue APIJSON#824 fixes APIJSON#824
TommyLemon
approved these changes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. [Bug] join 关键字 在 count 分页的时候,会报关联的子表的字段找不到Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |