Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #16975 - Fixing the null issue with datetime in insert mode #17008

Merged
merged 1 commit into from
Jul 13, 2021

Conversation

iifawzi
Copy link
Contributor

@iifawzi iifawzi commented Jul 13, 2021

Signed-off-by: Fawzi E. Abdulfattah iifawzie@gmail.com

Description

Hi, The issue was happening due to filling the default value, regardless of the Null constraint, which was leading to go over this if statement and not changing the $real_null_value to true, which's used to determine if the checkbox will be checked or not.

private function getSpecialCharsAndBackupFieldForInsertingMode(
array $column,
$real_null_value
) {
if (! isset($column['Default'])) {
$column['Default'] = '';
$real_null_value = true;
$data = '';
} else {
$data = $column['Default'];
}

I've just added a check, to check whether the Null constraint is set or not before setting a default value.

Fixes #16975

Signed-off-by: Fawzi E. Abdulfattah <iifawzie@gmail.com>
@codecov
Copy link

codecov bot commented Jul 13, 2021

Codecov Report

Merging #17008 (90793f6) into QA_5_1 (51b9a81) will increase coverage by 10.76%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             QA_5_1   #17008       +/-   ##
=============================================
+ Coverage     45.89%   56.65%   +10.76%     
- Complexity    15248    15289       +41     
=============================================
  Files           482      471       -11     
  Lines         60372    62098     +1726     
=============================================
+ Hits          27708    35182     +7474     
+ Misses        32664    26916     -5748     
Flag Coverage Δ
arch-7-amd64 ?
arch-7-arm32v6 ?
arch-7-arm32v7 ?
arch-7-arm64v8 60.05% <100.00%> (+11.89%) ⬆️
arch-7-i386 ?
arch-7-s390x 59.90% <100.00%> (+11.86%) ⬆️
dbase-extension 56.25% <100.00%> (+10.81%) ⬆️
recode-extension 56.21% <100.00%> (+10.77%) ⬆️
unit-7.1-ubuntu-latest 56.21% <100.00%> (?)
unit-7.2-ubuntu-latest 56.40% <100.00%> (+11.04%) ⬆️
unit-7.3-ubuntu-latest 60.06% <100.00%> (+11.82%) ⬆️
unit-7.4-ubuntu-latest 60.06% <100.00%> (+11.75%) ⬆️
unit-8.0-ubuntu-latest 60.23% <100.00%> (+11.86%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
libraries/classes/InsertEdit.php 87.68% <100.00%> (+1.43%) ⬆️
libraries/classes/Sql.php 50.00% <100.00%> (+38.22%) ⬆️
libraries/classes/SubPartition.php 0.00% <0.00%> (-100.00%) ⬇️
libraries/classes/Engines/PerformanceSchema.php 0.00% <0.00%> (-100.00%) ⬇️
libraries/classes/TablePartitionDefinition.php 30.76% <0.00%> (-69.24%) ⬇️
...Controllers/Database/MultiTableQueryController.php 0.00% <0.00%> (-62.50%) ⬇️
libraries/classes/Template.php 27.50% <0.00%> (-52.10%) ⬇️
libraries/classes/InternalRelations.php 50.00% <0.00%> (-50.00%) ⬇️
libraries/classes/CreateAddField.php 43.98% <0.00%> (-47.69%) ⬇️
libraries/classes/UserPassword.php 0.00% <0.00%> (-17.83%) ⬇️
... and 446 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 749fc55...90793f6. Read the comment docs.

@williamdes williamdes added this to the 5.1.2 milestone Jul 13, 2021
@williamdes williamdes added this to In progress in pull-requests via automation Jul 13, 2021
Copy link
Member

@williamdes williamdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you !

pull-requests automation moved this from In progress to Reviewer approved Jul 13, 2021
@williamdes williamdes linked an issue Jul 13, 2021 that may be closed by this pull request
@williamdes williamdes self-assigned this Jul 13, 2021
@williamdes williamdes merged commit a552b15 into phpmyadmin:QA_5_1 Jul 13, 2021
pull-requests automation moved this from Reviewer approved to Done Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
pull-requests
  
Done
Development

Successfully merging this pull request may close these issues.

Default NULL is ignored for datetime type
2 participants