Title: fix: include cross-JOIN ON referenced columns in count subquery for MySQL by youdaoSu · Pull Request #878 · APIJSON/APIJSON · GitHub
Open Graph Title: fix: include cross-JOIN ON referenced columns in count subquery for MySQL by youdaoSu · Pull Request #878 · APIJSON/APIJSON
X Title: fix: include cross-JOIN ON referenced columns in count subquery for MySQL by youdaoSu · Pull Request #878 · APIJSON/APIJSON
Description: Summary Fix for issue #824 (multi-JOIN count pagination). When HEAD/count pagination is used with 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, that column was missing from the subquery, causing an Unknown column error. 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` Location_info's subquery only selects code, but the second ON clause references Location_info.warehouse_id. Change In AbstractSQLConfig.parseJoin (MySQL-family databases only), when building the subquery column list for a JOIN table, also collect the targetKey of any ON clause (from any JOIN in the list) whose target table/alias matches the current JOIN table. Uses a LinkedHashSet to keep insertion order and deduplicate. PostgreSQL (and other non-MySQL databases) keep their existing SELECT * fallback, which already covers this case. Tests Added AbstractSQLConfigJoinCountTest with 2 cases: PostgreSQL: subqueries fall back to SELECT * (regression guard). MySQL: Location_info subquery must include both code (its own ON key) and warehouse_id (referenced by the second JOIN's ON). Full suite: 38 tests, 0 failures. fixes #824
Open Graph Description: Summary Fix for issue #824 (multi-JOIN count pagination). When HEAD/count pagination is used with multiple JOINs, the subquery for each JOIN table only selected its own ON key (on.getKey()). If ano...
X Description: Summary Fix for issue #824 (multi-JOIN count pagination). When HEAD/count pagination is used with multiple JOINs, the subquery for each JOIN table only selected its own ON key (on.getKey()). If ano...
Opengraph URL: https://github.com/APIJSON/APIJSON/pull/878
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:18bad128-d5c8-5c14-5ad3-eae434e4ee4a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E08A:E9A8B:A60698:ED1B37:6AFCB85B |
| html-safe-nonce | 47d2b7e49c32fdefbd487f9a15da6c346c310e8633a3d16dc4f7e7dcd8fea839 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDhBOkU5QThCOkE2MDY5ODpFRDFCMzc6NkFGQ0I4NUIiLCJ2aXNpdG9yX2lkIjoiNTQwMjA5MzAwOTIzMzU1NzU5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f14bc6f407d06df77d859988821073f0ab1faf2d795f7faafa556aa14e86a935 |
| hovercard-subject-tag | pull_request:4598353973 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/APIJSON/APIJSON/pull/878/files |
| twitter:image | https://avatars.githubusercontent.com/u/244297977?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/244297977?s=400&v=4 |
| og:image:alt | Summary Fix for issue #824 (multi-JOIN count pagination). When HEAD/count pagination is used with multiple JOINs, the subquery for each JOIN table only selected its own ON key (on.getKey()). If ano... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e3084aead77cbcb4f4904fba53851fa1a0546b0dec3619bd250815e72588dc6d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/APIJSON/APIJSON git https://github.com/APIJSON/APIJSON.git |
| octolytics-dimension-user_id | 41146037 |
| octolytics-dimension-user_login | APIJSON |
| octolytics-dimension-repository_id | 74359442 |
| octolytics-dimension-repository_nwo | APIJSON/APIJSON |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 74359442 |
| octolytics-dimension-repository_network_root_nwo | APIJSON/APIJSON |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5410e4bebd3e45b138c853ecef3992279d86d5af |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width