Maurício Meneghini Fauth
dd885dc7b8
Use single-line arrays when possible
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-27 17:39:17 -03:00
Maurício Meneghini Fauth
40cc4a0dee
Fix merge issue
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-26 13:37:27 -03:00
Maurício Meneghini Fauth
802d8f13b6
Merge pull request #18203 from kamil-tekiela/first-class-callable
...
Use first class callables
2023-03-25 15:16:07 -03:00
Maurício Meneghini Fauth
8972c0ec22
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-24 18:15:47 -03:00
Nicolas Hervouet
e4d9a1a66a
Fix for handle large number of tables in a single database (more than 10k)
...
getTablesFull was taking too much time, because MySQL do not have a real table where it stores all tables information.
So when it runs a query like select * from information_schema.TABLES ORDER BY Name limit 250 offset 0, MySQL has to read information about all tables to build his in memory table, then sort it by name, and then return 250 first tables.
But reading information about one table takes time, and that's why the query is very slow when you have a lot of tables.
Note that the problem is the same with 'SHOW TABLE STATUS'.
So, in order to speed up this query, we have to limit it to a small list of tables, as it, MySQL has to read table information only for few tables.
Note that SHOW TABLES is not that long, even with a large amount of tables.
The idea here is to use the result of SHOW TABLES query, to apply paging on this table list, and then to run the query on information_schema.TABLES only on tables we want.
Signed-off-by: Nicolas Hervouet <github@pico12.fr>
2023-03-24 11:55:30 -03:00
Kamil Tekiela
4feeeb0c89
Add @psalm-return
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-22 10:14:56 +00:00
Kamil Tekiela
924fcc79f9
Refactor logic for getting Tracking status
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-17 22:36:21 +00:00
Kamil Tekiela
3ecf14df34
Fixing erroneous params
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-17 12:47:43 +00:00
Kamil Tekiela
3774c29604
Fix implicit nulls
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-17 12:45:18 +00:00
Kamil Tekiela
555c6798eb
Add native param types
...
Includes TypeHints.UnionTypeHintFormat
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-17 12:45:18 +00:00
Maurício Meneghini Fauth
d19ebcf9b8
Add context for date/time related translations
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-04 10:44:22 -03:00
Kamil Tekiela
31800be779
Use quoteString in Util
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-03 17:36:34 -03:00
Kamil Tekiela
e71b8c2030
Use first class callables
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-02 23:00:43 +00:00
Maurício Meneghini Fauth
342ab3f67a
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-27 14:36:32 -03:00
Kamil Tekiela
0bdcaba2d2
Add native property types ( #18143 )
...
* Add native property types
Includes TypeHints.UnionTypeHintFormat
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Set some default values for properties
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Format and promote properties
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Remove redundant asserts
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant cast
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* $tmanager->theme is never null
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant variable
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Fix empty on $statementInfo bool
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant casts
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant issets
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* getPacked() returns nullable string
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant if
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* $this->content can be null
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Simplify ThemeManager::getInstance()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Use isset for checking if property is initialized
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Use nullable instead of uninitialized property
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* password is no longer nullable
I can't verify that none of the globals ever tried to set it to null, but the variable should never be nullable.
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Update baselines
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* $same_wide_width param can be float or int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Update Message.php
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast Sub_part to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Fix one line doc comments
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-26 23:30:41 -03:00
Maurício Meneghini Fauth
77957a69a5
Add trailing comma for multi-line functions
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-24 20:48:46 -03:00
Kamil Tekiela
e8c5eef6f8
Remove annoying empty statements ( #18114 )
...
* Remove annoying empty statements
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Make $extra strict and stop passing false to it
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Make $page strict and stop passing null
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-24 20:11:37 -03:00
Kamil Tekiela
902d1a1e77
Add native return type hints ( #18126 )
...
* Add remaining native return type hints to flush out bugs
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast the mixed value to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Fix tests
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* getAutoIncrement() is supposed to return string
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast values to string in DummyResult
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Make getCollation() return non-nullable string
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast seqInIndex to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast $cardinality to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* createFile may return false
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Remove redundant cast
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Update baselines
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-23 15:43:36 -03:00
Kamil Tekiela
aa63c6821a
Fix bug related to tables with numerical names
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-22 13:18:06 +00:00
Maurício Meneghini Fauth
47846068fa
Remove some useless comments
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 23:45:06 -03:00
Maurício Meneghini Fauth
4ff3724c3f
Use union with null instead of short nullable type
...
Since union type are now possible, using union with null makes more
clear that it is a union type.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 21:48:19 -03:00
Kamil Tekiela
80c4db7253
Use strict check when type is known
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-19 23:19:54 +00:00
Kamil Tekiela
cb2e1932f8
Better array types part 1 ( #18096 )
...
* Plugins getScripts() return array of strings
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* These methods always return an array
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* extractPrivInfo returns an array of strings
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* getInfoPages returns an array of strings
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* returnClassNamesFromMenuButtons returns a string map
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Use array shape for getDatabasesForSelectOptions
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Some methods in Table return array of strings
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* getLines returns an array if ints
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Array shapes in TwoFactor
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* parseEnumSetValues always returns an array of strings
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-15 16:52:00 -03:00
Kamil Tekiela
cfe54a501b
Add union types
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-15 15:23:28 +00:00
Kamil Tekiela
2b35303aae
Remove redundant code ( #18063 )
...
PHPStorm has been a little annoying with showing all these code issues. I took some time to analyse most of them and fix whichever were easy to fix. This kind of change should improve future maintenance as developers do not need to wonder what a line of code does. Code that has no impact on functionality should be removed.
* Remove redundant variables
* Invert condition for better clarity
* Remove some of the redundant casts
* Replace switch with an if
* Fix foreach variable
* Remove redundant variable concat
* Remove redundant concats
* Replace for loop with str_repeat
* Remove always true param
* Turn property $position into local var
* Turn Pdf properties into local vars
* Remove unused properties in Pdf
* Change ternary into condition
* Remove redundant assignments
They are immediately overwritten with a different value.
* Redundant array append
* Collapse if statements into assignments
* Use boolean constants instead of variables
* Remove unneeded parameter
* Remove null-coalesce
* Unnecessary assignment
* Remove redundant isset
* Remove readOnly flag for InsertEdit fields
* Remove function_exists and $mode var
* Remove duplicate condition
* Remove redundant elseif
* Remove redundant isset
* Use hasBodyParam()
* Simplify isRoutesCacheFileValid()
Psalm complains but is wrong.
https://github.com/phpmyadmin/phpmyadmin/pull/18063
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-15 09:11:05 -03:00
Kamil Tekiela
87e42d591c
Use short closures where possible
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-14 13:44:42 +00:00
Maurício Meneghini Fauth
040b4c582d
Bump minimum PHP version to 8.1.0
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-10 19:20:51 -03:00
Kamil Tekiela
7a22334167
Designer controller globals ( #17985 )
...
* Remove globals from DesignerController
* Remove $GLOBALS['params'] in ManageController
* Remove $GLOBALS['params']
* Remove $GLOBALS['total_num_tables']
* Remove $GLOBALS['tooltip_truename']
* Remove $GLOBALS['tooltip_aliasname']
* Remove $GLOBALS['pos']
* Remove $GLOBALS['tables'] (partially)
* Remove $GLOBALS['num_tables'] (partially)
* Remove redundant calls to Util::getDbInfo()
* Move unrelated functionality out of getDbInfo()
* Extract new method getTableListPosition()
* Code style changes
* Update phpstan-baseline.neon
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-01-26 22:58:24 -03:00
Kamil Tekiela
e37c240c9c
Remove old !== null check
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-01-26 20:20:00 +00:00
Kamil Tekiela
6264f6f1ea
Various refactorings 2 ( #17965 )
...
* Remove extra blank lines
* Remove useless param annotations
* Refactor Index::singleton
* Refactor Config.php
* Refactor Header::addRecentTable()
* Collapse return statement into a single line
* Refactor Message.php
* Convert $getUniqueCondition into a scalar
* Code style
* Fix invalid return phpdoc
* Remove unused variable
* Remove redundant empty array checks
* Refactor Export::closeFile()
* Simplify else statement
* Remove redundant else
* Refactor TablePartitionDefinition::getDetails
* Simpler returns
* Add types for getCellContent()
* Remove useless method mngInsideStructComm
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-12-24 12:54:23 -03:00
Kamil Tekiela
dd699f348d
Clean up LIKE escaping
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-25 00:06:52 +00:00
Maurício Meneghini Fauth
ca489f3b41
Improve type of DatabaseInterface::getLowerCaseNames()
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-19 15:50:14 -03:00
William Desportes
c08b4a78f3
Merge branch 'QA_5_2'
...
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-11-14 14:26:16 +01:00
William Desportes
f89cb7050a
Add sodium to the extension list on the main page
...
It has a polyfill and would be nice to know that it is installed
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-11-14 14:24:44 +01:00
Maurício Meneghini Fauth
f103bdc1e2
Replace $_REQUEST with ServerRequest in Util::getDbInfo()
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-08 00:06:25 -03:00
Maurício Meneghini Fauth
97aac39a40
Remove the sub_part global variable
...
It's only used inside Util::getDbInfo() for pagination when not
exporting.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-07 22:06:59 -03:00
Maurício Meneghini Fauth
103968f352
Replace fatalError() with exception in Core::warnMissingExtension()
...
Also moves some other calls to Core::warnMissingExtension() to the
Common::checkRequiredPhpExtensions() method.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-31 20:25:55 -03:00
William Desportes
25c13d667b
Merge branch 'QA_5_2'
...
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-10-26 12:22:38 +02:00
Mo Sureerat
aeab8a1c41
Fix #17793 - insert UUID ( #17797 )
...
* Add/Change table schema - Add UUID in default options
* Insert/Update - Generate uuid only not defined and not check null option
* Add/Change table schema - Hide UUID from default options if database not support & add unit test
Fix #17793
Signed-off-by: Mo Sureerat <sureemo@gmail.com>
2022-10-20 15:57:53 -03:00
Maurício Meneghini Fauth
3890d11dd8
Fix some coding style issues
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-16 17:18:54 -03:00
Maurício Meneghini Fauth
ba02d77c53
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-09 15:18:27 -03:00
Mo Sureerat
f0a938f783
Fix issue - Edit/Copy/Delete row doesn't work when using GROUP BY ( #17758 )
...
* Fix issue - Edit/Copy/Delete row doesn't work when using GROUP BY
Root cause: GROUP_FLAG and NUM_FLAG have the same flags value 32768
Reference to https://www.php.net/manual/en/mysqli-result.fetch-fields.php
Fixes #17756
Signed-off-by: Mo Sureerat <sureemo@gmail.com>
2022-10-09 14:33:21 -03:00
Maurício Meneghini Fauth
9cdf0b1cd9
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-03 21:00:20 -03:00
William Desportes
49b4951cbb
Document why zlib is the only value for a compressed column
...
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-09-30 23:39:50 +02:00
Fawzi E. Abdulfattah
1be3cad6e3
Supporting the compressed option for MariaDB
...
Ref: #14956
Signed-off-by: Fawzi E. Abdulfattah <iifawzie@gmail.com>
2022-09-30 23:11:22 +02:00
Maurício Meneghini Fauth
4ad66f464f
Fix some errors reported by PHPStan
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-28 22:53:38 -03:00
Rodrigo Pokemaobr
be976e4b57
Adjusting parameters in ExportPlugin class
...
Signed-off-by: Rodrigo Pokemaobr <contato@pokemaobr.dev>
2022-04-28 16:32:06 -03:00
Maurício Meneghini Fauth
4891f2dc74
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-21 14:45:17 -03:00
Maurício Meneghini Fauth
4c1668d663
Merge branch 'QA_5_1' into QA_5_2
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-21 14:29:25 -03:00
Maurício Meneghini Fauth
533766b3d7
Merge pull request #17437 from erolatreston/switch-user-QA_5_1
...
Allow authentication plugin to switch database users
2022-04-21 13:55:47 -03:00