1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-23 18:29:15 +03:00

42 Commits

Author SHA1 Message Date
Kamil Tekiela
9b0cc2548e Refactoring of getTablesFull
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-09-16 15:28:54 +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
Maurício Meneghini Fauth
6db91ea515 Fix failing test
Related to merge commit 3b4defeb35

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.com.br>
2026-08-13 13:49:09 -03:00
Kamil Tekiela
2d39994ae9 DecorateWillReturnMapWithExpectsMockRector
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
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
c605fd63bc Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.com.br>
2026-06-29 23:43:22 -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
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
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
ee0cb7724e Remove getStatusInfo from tests
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-01-25 15:36:48 +00:00
Kamil Tekiela
2438b4ae2f Remove unnecessary arguments
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2026-01-14 14:24:16 +00:00
Kamil Tekiela
d42a1a5440 Fix tests after merge
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2025-12-31 13:01:55 +00:00
William Desportes
4da3aaaf7a Merge branch 'QA_5_2'
Already merged in master: https://github.com/phpmyadmin/phpmyadmin/pull/19960
Re-write of the test from 4de9f0f0b1
Merge of 631cac096f
Merge of 58cee9656f but could not find the code to implement

Signed-off-by: William Desportes <williamdes@wdes.fr>
2025-12-29 18:50:41 +01:00
Kamil Tekiela
86b97b1ba9 Split up fetchResult()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2025-09-12 15:37:11 +01:00
Maurício Meneghini Fauth
44bcf98a43 Extract string constants from RelationParameters class
These strings are very similar to some Config\Settings\Server
properties, so is better to avoid confusion.

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2025-08-05 18:26:40 -03:00
Kamil Tekiela
06057518b0 Separate strtoupper from getStorageEngine
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2025-05-20 18:39:56 +01:00
Kamil Tekiela
0ef9362596 Adjust tests
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2025-01-22 16:38:43 +00:00
Maurício Meneghini Fauth
1280adb2c8 Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2025-01-13 16:17:52 -03:00
Kamil Tekiela
def8e350a0 Create getInstanceForTest
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-12-31 15:41:46 +00:00
Kamil Tekiela
0db131572c Dbi: take Config as a parameter
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-12-31 14:56:02 +00:00
Kamil Tekiela
8015e4de72 Move DatabaseInterface to Dbal
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-12-22 18:34:53 +00:00
Kamil Tekiela
18493d01ba Drop $value param from fetchResultSimple
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-12-22 00:04:18 +00:00
Kamil Tekiela
319ae0d2e3 Split off fetchResultSimple
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-12-22 00:04:18 +00:00
Maurício Meneghini Fauth
c30bc4ddcc Merge pull request #19464 from MauricioFauth/export-globals
Remove some global variables from export plugins
2024-12-21 15:12:41 -03:00
Maurício Meneghini Fauth
75d11f910b Remove sql_* global variables
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2024-12-20 19:42:52 -03:00
Maurício Meneghini Fauth
038c59b1bf Remove some sql_* global variables
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2024-12-20 12:12:08 -03:00
Kamil Tekiela
dd05ed6e45 Change $options into $unbuffered
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-12-18 15:11:02 +00:00
Maurício Meneghini Fauth
7d6b17a417 Replace sql_query global var with Current::$sqlQuery
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2024-12-09 13:51:22 -03:00
Kamil Tekiela
0c84b630a4 Drop getReservedColumnNames()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-10-30 19:29:02 +00:00
Maurício Meneghini Fauth
c6c9aeb678 Merge #19124 - Refactoring move copy
The goal of this was to partition the big method into smaller easier to
understand chunks and get rid of globals. This code is still far from
perfect but I have no idea how to proceed further right now.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-05-10 11:13:57 -03:00
Kamil Tekiela
24e6089625 Add UiProperty enum
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-05-02 23:01:12 +02:00
Kamil Tekiela
bb37e649b9 Fix unit tests
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-04-22 22:56:33 +02:00
Kamil Tekiela
b2fbc55ff2 Make TableMover non-static
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-04-22 21:56:52 +02:00
Kamil Tekiela
a3436e4117 Merge $move into MoveScope
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-04-22 21:52:44 +02:00
Kamil Tekiela
e9a8b439c1 Rename enum cases
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-04-22 21:52:44 +02:00
Kamil Tekiela
e035fdc460 Add MoveScope enum
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-04-22 21:52:44 +02:00
Kamil Tekiela
d485a95fae Create MoveMode enum
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-04-22 21:52:44 +02:00
Kamil Tekiela
81853e877b Create TableMover class
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-04-22 21:52:40 +02:00
Kamil Tekiela
7464263253 Remove useless test
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-03-18 21:24:40 +01:00
Kamil Tekiela
46035d2d6a Minor changes
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-03-18 21:24:39 +01:00
Maurício Meneghini Fauth
606f66b5df Rename tests/classes to tests/unit
This directory is for unit tests only, so let's rename it to unit to be
more clear.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-02-23 13:29:07 -03:00