1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-28 07:41:55 +03:00
Commit Graph

228 Commits

Author SHA1 Message Date
Kamil Tekiela
cb7a87d115 Introduce TableType enum for table list type filtering
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-16 15:28:54 +01:00
Kamil Tekiela
9b9ed5485b Fix table list position handling in Database StructureController
Clamp negative pos parameters to 0 in getTableListPosition(); a
negative value used to be stored in the session and end up as a
negative array_slice() offset or an invalid negative SQL OFFSET.

Redirect to the last page when the position is exactly equal to the
total number of tables: such a page is empty, but the previous check
only redirected when the position was strictly greater, rendering an
empty table list for a non-empty database.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-16 15:28:54 +01:00
Kamil Tekiela
fbf5158b2b Remove the position field from Database StructureController
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-16 15:28:54 +01:00
Kamil Tekiela
c7f37ee42f Refactor StructureController::getDbInfo() and expand its test coverage
Add unit tests for the previously untested paths of getDbInfo(): sort
name mapping (including descending order and unknown sort columns),
the tbl_group and tbl_type filters, and MaxTableList paging.

Refactor getDbInfo() into three flat branches, replacing the
string|false $groupWithSeparator juggling and the duplicated string
checks. The sort name is now mapped with a match expression. The paging
position is passed as an explicit parameter instead of being read from
a private field, and the total table count is always returned as an int
instead of int|null, so the caller no longer needs a fallback count.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-16 15:28:53 +01:00
William Desportes
1178149419 Merge branch 'QA_5_2'
QA_5_2 still lives in libraries/classes/ and test/classes/; master moved to
src/ and tests/unit/. Seven files therefore arrived as "deleted by us" and had
to be ported by hand rather than merged.

Upstream commit roll-call (060391b9a7..3d2594b2d3, 15 non-merge commits). The
5 merge commits in that range were checked with `git show --cc` and are all
empty, so they contribute no content of their own:

  366d165982  ported      Strip port from host in processes privileges link
  544839869d  ported      Test coverage for the port-stripping
  80638e8371  ported      Add LIMIT 0 when fetching metadata (4 of 7 hunks;
                          see below for the 3 that do not apply)
  3b46e5b869  ported      Fix Uncaught ReferenceError: CodeMirror is not defined
  8525d24e09  already in  Fix search of INET4 with = operator
  1730b7c0bf  no-op       Remove useless parentheses
  6c1568b15b  skipped     Move getColumnMapFromSql into the method
  afaeacecc9, cae0175274, 64c6890d6c, 669f8d17bc, eee3cd458a, 9c8246a127,
  5f1ae11fc4, 111993769e   not taken   Translated using Weblate (lv, vi)

Conflict resolutions, file by file:

* src/Server/Status/Processes.php
  Ported 366d165982 (#20315 / #19841): expose a 'user_host' row key holding
  the host with any `:port` suffix stripped. Adapted to master's lower-cased
  array keys from array_change_key_case().

* resources/templates/server/status/processes/list.twig
  The privileges link now uses row.user_host instead of row.host, so the
  hostname matches mysql.user.Host, which never contains a port.

* src/Plugins/Transformations/{Input/Text_Plain_{Json,Sql,Xml}Editor,
  Output/Text_Plain_{Json,Sql,Xml}}.php
  Ported 3b46e5b869. Kept master's
  Config::getInstance()->config->CodemirrorEnable accessor and expressed the
  HTTP_USER_AGENT check with Core::getEnv() rather than $_SERVER, to match
  the same #20159 guard already present in src/Header.php:225.

* src/SystemDatabase.php
  Ported the memory part of #20426 only: getColumnMapFromSql() now wraps the
  query as `SELECT * FROM (...) AS tmp LIMIT 0` (80638e8371) so a large VIEW
  cannot exhaust memory while only its column metadata is wanted. This is
  where libraries/classes/DatabaseInterface.php's hunk landed: the method
  moved from the DBAL to SystemDatabase on master.
  Deliberately did NOT port 6c1568b15b "Move getColumnMapFromSql into the
  method": that commit exists to stop 5.2's CreateController from running the
  view query when there is no transformation data, but master already only
  calls it inside `if ($pmaTransformationData !== false)`
  (src/Controllers/View/CreateController.php:205), and
  getExistingTransformationData() returns false precisely when
  browserTransformationFeature is null. Porting the signature churn would
  have degraded master's SystemColumn[] API for no behaviour gain, so
  src/Controllers/View/CreateController.php is left untouched and that
  commit's phpstan/psalm baseline hunks are moot.

* src/Table/Table.php
  Ported 80638e8371: getColumnsMeta() uses `LIMIT 0` instead of `LIMIT 1`.

* src/Table/Search.php
  Resolved as ours. QA_5_2's 8525d24e09 is the same fix master already
  carries via 725a767cc5 (#20398 / #20395), only expressed against the
  refactored $needsQuoting code. No change needed.

* tests/unit/Controllers/Server/Status/Processes/RefreshControllerTest.php
  Ported 544839869d: covers both that the Host column still shows the port
  and that the privileges link does not. Added the trailing comma PHPCS
  (SlevomatCodingStandard.Functions.RequireTrailingCommaInCall) requires.

* tests/unit/Stubs/DbiDummy.php
  Two fixtures updated, both kept in master's compact single-line style: the
  PROCESSLIST row now returns 'Host1:12345' to exercise port stripping
  (544839869d), and the `testdb`.`mytable` select moved from LIMIT 1 to
  LIMIT 0 (80638e8371).

* tests/unit/Table/TableTest.php and tests/unit/SystemDatabaseTest.php
  Expected queries updated for the two changes above (`LIMIT 0`, and
  `SELECT * FROM (PMA_sql_query) AS tmp LIMIT 0`). The latter is where
  test/classes/DatabaseInterfaceTest.php's hunk landed, following the method
  from the DBAL to SystemDatabase.

* tests/unit/Table/ColumnsDefinitionTest.php
  Not a conflicted file, but a master-only fixture that had to follow
  Table::getColumnsMeta(): the query is now `LIMIT 0` and returns no rows.

Incoming changes with no master counterpart:

* libraries/classes/Dbal/DbalInterface.php
  Dropped. The interface does not exist on master, so 80638e8371's rename of
  its getColumnMapFromSql() parameter has nothing to apply to.

* test/classes/Http/Factory/ServerRequestFactoryTest.php
  1730b7c0bf is a no-op here: master's
  tests/unit/Http/Factory/ServerRequestFactoryTest.php contains no
  `(new ReflectionMethod(ServerRequestFactory...))` construct at all, the
  test having been rewritten. Note that rename detection wrongly paired this
  file with tests/unit/Http/Factory/UriFactoryTest.php, which was therefore
  resolved as ours and is unchanged.

* phpstan-baseline.neon, psalm-baseline.xml
  Resolved as ours; the baselines are branch-specific.

* resources/po/lv.po, resources/po/vi.po
  Resolved as ours, dropping the 8 Weblate commits listed above. This matches
  how all eight previous "Merge branch 'QA_5_2'" commits were resolved
  (6f427d8785, ccf4064698, fe4be26eeb, 055f071473, 28cd3776d2, 3b4defeb35,
  ff06deaca2 all have a zero-file po diff against their first parent);
  master runs its own Weblate component.

Also removed the empty libraries/ and test/ directories the merge left behind.

Verification: `phpunit --testsuite unit` 5668 tests / 18476 assertions OK,
`phpcs` clean, `phpstan analyse` reports no errors. `psalm` reports one
UnusedBaselineEntry for src/Utils/HttpRequest.php, which is pre-existing on
master (neither that file nor psalm-baseline.xml is touched by this merge).

Signed-off-by: William Desportes <williamdes@wdes.fr>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 11:19:45 +02:00
Kamil Tekiela
2c7c5e57b3 Fix CS issues
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-08-23 02:39:24 +01:00
Kamil Tekiela
0970bb1575 Pass only Message to getMessage
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-08-22 23:34:37 +01:00
Maurício Meneghini Fauth
84be8f61eb Merge pull request #20417 from kamil-tekiela/Rector-fixes
Rector fixes
2026-08-13 10:17:13 -03:00
Maurício Meneghini Fauth
3b4defeb35 Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.com.br>
2026-08-13 09:57:18 -03:00
Kamil Tekiela
d149194048 Add self::assertIsString
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-08-12 14:22:45 +01:00
Kamil Tekiela
63bba57910 NarrowUnusedSetUpDefinedPropertyRector
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-08-12 14:18:48 +01:00
Maurício Meneghini Fauth
28cd3776d2 Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.com.br>
2026-07-31 18:15:28 -03:00
Maurício Meneghini Fauth
6f427d8785 Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.com.br>
2026-07-18 15:26:39 -03:00
Kamil Tekiela
5788456fc7 Rector: phpunitMockToStub
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-07-13 23:11:37 +01:00
Maurício Meneghini Fauth
f6d656b6a3 Fix bookmarks not being properly saved
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.com.br>
2026-05-22 19:32:03 -03:00
Maurício Meneghini Fauth
171a972ce6 Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-04-22 20:41:40 -03:00
Kamil Tekiela
f708e074c9 Clean up config again (#20264)
* MaxTableList/MaxDbList/QueryHistoryMax
* UserprefsDisallow
* NaturalOrder
* Update TableTest.php
* MaxExactCountViews
* Update ReplicationGuiTest.php
* Update RoutinesTest.php
* Update StructureControllerTest.php
* Update ExportControllerTest.php
* Update StructureControllerTest.php
* Update BookmarkTest.php
* MaxCharactersInDisplayedSQL
* ActionLinksMode/ShowSQL/MysqlSslWarningSafeHosts
* Update TwoFactorTest.php
* ForeignKeyMaxLimit/ForeignKeyDropdownOrder
* QueryHistoryDB
* ZeroConf
* UseDbSearch
* MaxRoutineList
* NumFavoriteTables
* EnableAutocompleteForTablesAndColumns
* MaxExactCount/ShowStats
* InitialSlidersState
* Remove isset in Results
* Remove isset and fix tests
* PmaNoRelation_DisableWarning
* ShowCreateDb
* Update phpstan-baseline.neon
* Navigation
* Upgrading vimeo/psalm (6.15.0 => 6.16.1)

---------

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-04-10 16:33:08 -03:00
William Desportes
2c03905eea Merge #19802 - Fix #19381 - Implement csv empty to null
Pull-request: #19802
Fixes: #19381

Co-Authored-By: William Desportes <williamdes@wdes.fr>
Signed-off-by: William Desportes <williamdes@wdes.fr>
2026-04-09 16:59:10 +02:00
Nicolai Ehrhardt
bcaf89c19f Fix #20041 - Fix export for raw queries without table reference
Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com>
2026-04-05 14:45:16 +02:00
Maurício Meneghini Fauth
119694fda5 Merge pull request #20192 from MoonE/ol-wkt
Transmit OpenLayers data as WKT
2026-03-19 14:32:05 -03:00
Maurício Meneghini Fauth
8f0fa8247d Merge pull request #20147 from kamil-tekiela/Clean-up-setUserValue
Clean up setUserValue
2026-03-17 14:35:06 -03:00
William Desportes
a46e3f55ca Fix tests after #20227 - for the default storage engine
Pull-request: #20227
Ref: #20171

Signed-off-by: William Desportes <williamdes@wdes.fr>
2026-03-17 13:49:10 +01:00
Maurício Meneghini Fauth
056dce74a9 Merge pull request #20208 from MoonE/gis-file-download
Rework GIS file export
2026-03-11 19:40:41 -03:00
Maurício Meneghini Fauth
3924c58ed1 Fix failing tests
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-03-07 14:13:24 -03:00
Maximilian Krög
7778e3afb0 Rework file export to avoid output buffer when possible
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2026-03-05 19:36:54 +01:00
William Desportes
a34bb65806 Update the gis test & coding standard
Signed-off-by: William Desportes <williamdes@wdes.fr>
2026-03-05 13:29:28 +01:00
Maurício Meneghini Fauth
649c84d251 Add unit test for Database\Structure\AddPrefixTableController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-03-02 20:46:16 -03:00
Maurício Meneghini Fauth
ba958ae1f7 Add unit test for Database\TrackingController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-03-02 18:38:07 -03:00
Maurício Meneghini Fauth
c7e93b3934 Add unit test for Database\SqlFormatController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-03-02 17:58:08 -03:00
Maurício Meneghini Fauth
45ac0da83c Add unit test for Database\SqlController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-03-02 17:14:27 -03:00
Maurício Meneghini Fauth
e8a7a39c3e Add unit tests for Database\DesignerController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-03-02 13:52:55 -03:00
Maurício Meneghini Fauth
43feb0e106 Add unit test for Database\SqlAutoCompleteController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-03-02 12:15:45 -03:00
Maurício Meneghini Fauth
5590a14863 Add unit test for Database\SearchController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-03-02 11:15:19 -03:00
Maximilian Krög
ecf75a991d Transmit the wkt data, without processing for ol
OpenLayers comes with its very own WKT parser.
This reduces the size of transmitted data.

Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2026-02-27 22:58:33 +01:00
Maurício Meneghini Fauth
985455a967 Add unit test for Database\MultiTableQueryController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-02-27 17:34:37 -03:00
Maurício Meneghini Fauth
e1ffe48b50 Add unit test for MultiTableQuery\QueryController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-02-27 17:34:37 -03:00
Maurício Meneghini Fauth
29ff018baa Add unit test for Database\ImportController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-02-27 17:34:36 -03:00
Maurício Meneghini Fauth
009939f05a Add unit test for Database\ExportController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-02-27 14:14:36 -03:00
Maurício Meneghini Fauth
809acdfae6 Add unit test for Database\DataDictionaryController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-02-27 11:14:16 -03:00
Maurício Meneghini Fauth
a19dba215f Add unit test for CentralColumns\PopulateColumnsController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-02-27 10:51:28 -03:00
Maurício Meneghini Fauth
cfd767235c Add unit test for Database\CentralColumnsController
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-02-27 10:18:34 -03:00
Maurício Meneghini Fauth
71ac9f7143 Merge pull request #20103 from kamil-tekiela/Properties-2
Refactoring of Properties 2
2026-02-25 21:17:33 -03:00
Maurício Meneghini Fauth
b93e747994 Remove method AbstractTestCase::callFunction()
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-02-21 18:01:03 -03:00
Maurício Meneghini Fauth
87f9fd523d Remove method AbstractTestCase::getProperty()
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2026-02-21 17:47:19 -03:00
Kamil Tekiela
e578b8729d Create updateConfigValue()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-02-20 19:05:07 +00:00
Kamil Tekiela
51d89d5d51 Make $cookieName optional
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-02-20 19:05:07 +00:00
Maurício Meneghini Fauth
1eff7e56af Merge pull request #20136 from kamil-tekiela/Fix-Config-tests
Fix config in tests
2026-02-20 15:14:21 -03:00
Kamil Tekiela
90caa57986 Remove all unnecessary tearDown
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-02-19 22:24:48 +00:00
Kamil Tekiela
0341f9dc23 Fix MaxDbList
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-02-19 21:29:30 +00:00
Kamil Tekiela
2702f2814e PluginType enum
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-02-14 22:01:11 +00:00