Commit Graph

188 Commits

Author SHA1 Message Date
William Desportes
3d0e40a9fb
Merge #20223 - Fix #17451 - fetchValue call with connection parameter
Pull-request: #20223
Fixes: #17451
Signed-off-by: Guido Selva <guido.selva@gmail.com>
Signed-off-by: William Desportes <williamdes@wdes.fr>
2026-03-07 16:28:06 +01:00
GS
1ff49d68aa
Fix fetchValue call with connection parameter 2026-03-07 16:11:02 +01:00
William Desportes
f3d76f4066
Merge #19956 - Fix #19749 - Descending index being converted to ascending
Pull-request: #19956
Fixes: #19749
Signed-off-by: William Desportes <williamdes@wdes.fr>
2026-02-08 17:51:22 +01:00
William Desportes
7e0747f5b6
Merge #20060 - Fix virtual column collation support for MariaDB
Pull-request: #20060
Fixes: #17362
2026-02-05 13:19:04 +01:00
Maximilian Krög
41a17b79bd
Set sql mode for sql-parser when connecting to db
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2026-01-31 07:16:33 +01:00
Maximilian Krög
baecf395e5
Fix virtual column collation support for MariaDB
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2026-01-31 06:12:27 +01:00
William Desportes
631cac096f
Merge #19740 - Fix 19367 - renaming a column with current_timestamp/UNIX_TIMESTAMP functions as default values
Pull-request: #19740
Fixes: #19367

Co-Authored-by: William Desportes <williamdes@wdes.fr>
Signed-off-by: William Desportes <williamdes@wdes.fr>
2025-12-14 21:06:21 +01:00
Nicolai Ehrhardt
1121450864 Fix descending index being converted to ascending (#19749)
Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com>
2025-11-22 19:15:56 +01:00
Yash Punwani
ee2f76bc16
fix: fixed quoting of current timestamp function
Signed-off-by: Yash Punwani <yashpunwani12340@gmail.com>
2025-09-22 11:53:55 +02:00
Kamil Tekiela
b4920017dd
Fix bugs in relations tab
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
(cherry picked from commit ff7395c3ea)
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2025-05-26 20:43:58 -03:00
faissaloux
00aff299de avoid table names htmlentities conversion
Signed-off-by: faissaloux <fwahabali@gmail.com>
2025-01-29 03:35:04 +01:00
Liviu-Mihail Concioiu
01013880df
Fix Undefined global variable $col_priv (#19511)
* Fix query

Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>

* Fix Undefined global variable $col_priv

Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>

* Fix test

Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>

* Update libraries/classes/Normalization.php

Co-authored-by: Maurício Meneghini Fauth <mauricio@mfauth.net>

---------

Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>
Co-authored-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2025-01-13 14:49:00 -03:00
Kamil Tekiela
7652f018aa Fix #17538 Index Rename Button generated incorrect sql
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-12-28 00:25:10 +01:00
Kamil Tekiela
d0e746fac6 Fix dropped triggers on rename
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-08-28 23:34:21 +01:00
Kamil Tekiela
fb2953c487 Force string as return type of showCreate()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-07-24 19:45:24 +01:00
William Desportes
f3bd71d937
Fix a coding-standard issue
Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-02-20 23:52:37 +01:00
Kamil Tekiela
fa339143ea
Fix renaming db with a view (#18106)
* Fix renaming DB with a view

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Add test for the bug

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-20 13:36:46 -03:00
Liviu-Mihail Concioiu
a6e0957d94 Update links
Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>
2023-02-17 18:42:01 +01: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
4d1546f7c5
Fix indentation issues
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-16 13:41:31 -03:00
atomu330
6957064cea
replace isset to empty
IF statement ! isset($this->uiprefs) was causing issue.

Private property 'uiprefs' is initialized to empty array, so ! isset($this->uiprefs) is always FALSE;
It's not hopefull, so I replace ! isset($this->uiprefs) to empty($this->uiprefs) to fix #17617 bug;

Fixes #17617
Closes #17644

Signed-off-by: Atomu Oku <atomu.work@gmail.com>
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-07-19 13:04:59 -03:00
Kamil Tekiela
a74c5aed44 Add few more usages of queryAsControlUser
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-01-06 19:31:27 +00:00
Kamil Tekiela
f5bb90ebb9 Move queryAsControlUser - Dbal refactoring pt.3
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-01-06 19:31:27 +00:00
Kamil Tekiela
83b4dda1a3 Change QUERY_STORE to QUERY_BUFFERED
Set the value to 0 instead of 1 and remove all unnecessary usages of this constant

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-01-01 01:46:01 +00:00
Kamil Tekiela
47a039d70c Implement ResultInterface & MysqliResult
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-31 23:59:24 +00:00
Maurício Meneghini Fauth
feca48cc76
Change return type of DatabaseInterface::getError method
Now, it returns last error message or an empty string instead of false
if no errors occurred.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-27 14:43:14 -03:00
Maurício Meneghini Fauth
d84af02945
Create VO classes for each RelationParameters features
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-26 19:17:58 -03:00
Maurício Meneghini Fauth
4e0141e19f
Merge pull request #17253 from kamil-tekiela/fetchValue
Remove $row_number from DatabaseInterface::fetchValue
2021-12-23 11:40:25 -03:00
Maurício Meneghini Fauth
44fe103b9c
Remove @access annotations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-22 11:43:45 -03:00
Kamil Tekiela
70c86f5e21 Remove $row_number from DatabaseInterface::fetchValue
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-21 21:09:38 +00:00
Maurício Meneghini Fauth
c411121fd8
Move Relation classes into the ConfigStorage namespace
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-17 12:09:13 -03:00
Maurício Meneghini Fauth
c4575fd48b
Add methods to check for RelationParameters features
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-11 08:10:40 -03:00
Kamil Tekiela
f446e6da88 Remove unused variables
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-03 15:12:56 +00:00
Kamil Tekiela
488e7cb5bf Use array_keys whenever only keys are needed in foreach
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-11-29 20:37:39 +00:00
Kamil Tekiela
56a832948c
Refactor DatabaseInterface.php (#17209)
* Use str_starts_with()

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant !empty()

!empty() on a declared variable is redundant.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Replace loop with array_column()

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Simpify assignment by removing temporary variable

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant if statements and array_merge

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove temporary variable

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Unindent code

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Add helper method fetchByMode()

This is done to avoid calling methods through variables. It is the same
in terms of performance.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Move if statements to where they are relevant

I had a choice to either move the while loop out of the if statements
or move the if statements inside. I decided it made more sense to move
them inside.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Add NULL to phpdoc for the two parameters that can be null

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Simplify return statement

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Improve performance and simplify code

Since we are always using STORE mode then we can use data_seek() method.
This will allow us to get rid of the loop and use fetchByMode() method.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Inline value defaulting

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant check

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* [bugfix] getColumnNames() should return an array of strings

There were multiple issues here. If we are selecting only a certain
column from the SQL then let's use the handy function instead of
array_keys. We will never get anything other than an array so checking
if it is not an array makes no sense. Returning null only to cast it to
an array is pointless. If really necessary, we could still check for an
empty array. The ColumnController returned the value without even
casting it to an array. I am not sure how jQuery/JavaScript dealt with it.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Refactor getColumnMapFromSql and add type hint

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Refactor getVirtualTables

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant loop

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant usage of freeResult()

If there was no chance for the object to leak the scope and it is the
end of the scope then there's no reason to call this method.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Replace dynamic variable with declare one

It's always the same name. If we were creating more than one, we could
use associative array, but in this case there seems to be absolutely no
need for any of this. Dynamic variables make it harder to debug the code.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Update psalm-baseline.xml

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Widen the condition per williamdes suggestion

This will allow value such as '' and '0' to pass through. Previously
`if(! empty($database))` and `if($database)` dissallowed them.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* fetchResult() should return only arrays

Tests fixed to return arrays. Non-empty in case of true, empty in case
of false.
Fixed a lot of Psalm issues where the condition was always true.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-11-26 20:17:46 -03:00
Maurício Meneghini Fauth
857a9d3337
Remove unnecessary @var annotations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-11-18 12:15:30 -03:00
Maurício Meneghini Fauth
090d2eece7
Fix some issues found by PHPStan
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-11-16 15:11:57 -03:00
Maurício Meneghini Fauth
7fc8c4bd15
Remove @var annotation in Table::getColumnGenerationExpression
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-11-15 13:36:47 -03:00
Maurício Meneghini Fauth
b2a51c4d84
Create the RelationParameters value object
Replaces the $cfgRelation array with the RelationParameters value
object.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-11-14 18:22:36 -03:00
Maurício Meneghini Fauth
3e0856c77b
Remove useless string concatenations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-27 21:40:22 -03:00
Maurício Meneghini Fauth
f00d70cccb
Remove useless whitespaces
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-15 17:05:40 -03:00
Maurício Meneghini Fauth
9f3510d11a
Add bool return type where possible
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-14 20:11:51 -03:00
Maurício Meneghini Fauth
7f6472b2c2
Add void return type where possible
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-13 15:29:11 -03:00
Maurício Meneghini Fauth
5f4fd07483
Remove some assignments to the $_POST global
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-03 15:49:39 -03:00
William Desportes
72800e2524
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-08-15 00:52:33 +02:00
William Desportes
d804e60820
Fix broken docs link after FK types mismatch error
See: https://web.archive.org/web/20200921164945/https://dev.mysql.com/doc/refman/8.0/en/innodb-foreign-key-constraints.html

Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-08-14 15:28:55 +02:00
William Desportes
12c390948c
Fix a phpstan reported error
[ci skip] One failing test fixed on next push

And remove an error from the baseline from previous merge

Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-20 17:54:04 +02:00
William Desportes
587536b766
Remove non used variables
Running: composer run psalm -- --alter --issues=UnusedVariable
And removing the false positives I reported upstream

Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-16 02:13:27 +02:00
William Desportes
d84e3cde28
Fix psalm detected errors
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-13 21:45:34 +02:00
Fawzi E. Abdulfattah
9954c47577
Fix #16138 - ignore the length of integer types, and show a warning
Fixes: #16138

Signed-off-by: Fawzi E. Abdulfattah <iifawzie@gmail.com>
2021-07-13 15:42:57 +02:00