Repository navigation
Fix enabling and using the extension on MSSQL - #15
Merged
Merged
Conversation
A fresh phpBB 3.3 or 4.0 board on MSSQL could not enable the extension,
and several pages failed there once it was enabled:
- version_1_0_0 inserted the kb_options rows with fixed ids, which MSSQL
only takes with IDENTITY_INSERT on.
- version_1_0_0 and version_1_0_5 put numbers into kb_config's text
column ("Operand type clash: int is incompatible with ntext"); the
values are now strings.
- version_1_0_0 ran one query twice and left the first result open, and
version_2_0_0 never freed its result; MSSQL then refused the next
transaction.
- Adding the first category added 1 to MAX(right_id) of an empty table,
which MSSQL's driver returns as '' (TypeError in PHP 8). Same for
moving a category to the root.
- Search, the edit form and article comments used SELECT DISTINCT over
text columns, which MSSQL cannot compare. The joins are one-to-one, so
DISTINCT is dropped.
Adds regression tests and a read-only browser sweep of the main pages
and every ACP module (tests/browser/kb_page_sweep.js).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the fresh-PostgreSQL fix (#12) and the kinerity import (#13). version_2_0_30 now inserts kb_m_change_author with an explicit id, so it gets the same IDENTITY_INSERT wrapper on MSSQL as version_1_0_0, with a test. Both new docs/testing.md sections are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the index introduction (#14), which also clears the EPV finding in inc/kinerity_import.php. Both new docs/testing.md sections are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Merged With the fresh-PostgreSQL fix (#12) now on Claude checked c9e18bf:
Investigated and written by Claude on behalf of William Jacoby (bonelifer). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The extension could not be enabled on a fresh MSSQL board, on phpBB 3.3 or 4.0, and a few pages failed there once it was.
Enabling
version_1_0_0inserts thekb_optionsrows with fixed ids. MSSQL only takes an explicit value for an identity column withIDENTITY_INSERTon, so the insert now turns it on and off around the rows on MSSQL (phpBB's installer does the same for its ACL options).version_1_0_0andversion_1_0_5put numbers intokb_config.config_value, a text column, which MSSQL refuses ("Operand type clash: int is incompatible with ntext"). The values are now strings.version_1_0_0ran one query twice and never freed the first result, andversion_2_0_0never freed its result. MSSQL then refused the next transaction.Pages
MAX(right_id)of an empty table. phpBB's MSSQL driver returns that NULL as an empty string, which is a TypeError in PHP 8. It is now cast to an integer.SELECT DISTINCTover text columns, which MSSQL cannot compare. Each join matches a single row, soDISTINCTis dropped.Tests
tests/kb_mssql_migration_test.phpandtests/kb_acp_first_category_test.phpcover the fixes above. Both fail onmain.tests/browser/kb_page_sweep.jsis a new read-only browser check: as the seed-forum administrator it opens the main Knowledge Base pages and every Knowledge Base ACP module, and fails on a server error, a PHP error or an SQL error page.docs/testing.mdhas a new section with the details.Tested by Claude:
mainand 574 after, none skipped, all pass. phpcs and EPV are clean on both branches.With the fresh-PostgreSQL fix (#12)
#12 gives
version_2_0_30's new option an explicit id, which MSSQL also only takes withIDENTITY_INSERTon, so this PR adds the same wrapper there. Before #12 reachedmain, the PostgreSQL boards ran this change merged with that branch; after mergingmainin, Claude ran fresh MSSQL boards on 3.3 and 4.0 again (all 43 migrations, including the new ones from #13 and #14) and the full suite (574 tests, none skipped).Building the boards needed seed-forum fixes: phpbbmodders/seed-forum#35.
Investigated and written by Claude on behalf of William Jacoby (bonelifer).
🤖 Generated with Claude Code