The sql_query global variable should be a string, and it can be a string
in this case, which will cause an error as the string will not be
converted to array.
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
Backports #18907 to QA_5_2.
This makes merging QA_5_2 into master easier.
Changes done using Rector.
- #18907
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
Adds unit test for preview SQL button when renaming an index and using
an old MySQL server.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* Test editing empty geometry collection
- 'GEOMETRYCOLLECTION()'
- 'GEOMETRYCOLLECTION EMPTY'
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
* Fix editing GEOMETRYCOLLECTION EMPTY
Instead of searching for first parenthesis look for word end.
Parsing was and is somewhat unsafe, though it works with the data
received from ST_AsText.
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
---------
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
When find and replace searching used with regex, at the time of replace
empty CASE END condition was causing issue.
Fixes#17388Closes#17641
Signed-off-by: Ankush Patil <aspraz2658@gmail.com>
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
These classes were added by 6408b7179a.
However they aren't exactly the same as thead-light classes that exists
in Bootstrap 4.
Related to https://github.com/phpmyadmin/phpmyadmin/issues/17455.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* Remove redundant conditions
They were always true. First, the variable is set to -1.
If the variable is -1, then set it to Message.
If the variable is Message then set the JSON array. All of this is
redundant.
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* $sqlQuery is not used anywhere
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Enforce $selected to be an array
I can't remove it as it is a global. Previously, it was set to a POST
variable. Since we validate that the variable is set and is not null,
we can use the value from $params. If we validate that it's also an
array we can replace for loop with foreach.
There is no passing by reference, so this change should be safe.
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Replace $rebuildDatabaseList with input validation
The validation message says 'No databases selected.' so I assume that
we should check that we actually got at least one entry in the list.
If that is true, then the $rebuildDatabaseList is not needed and the
condition redundant.
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* drop_selected_dbs is always set and is redundant
I am not sure if this is necessary. The AJAX request sends a value of "1"
but the code doesn't really do anything with it other than checking if
it is actually set. Is there some other path possible?
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Flatten the array with a single element
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Remove redundant isset
The variable is set, so !isset === is_null. Why check for null if we can
check just for !is_array.
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Update psalm-baseline.xml
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Adhere to the coding standard
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>