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

Invalid default value for bit field #14734

Closed
OlafvdSpek opened this issue Nov 18, 2018 · 12 comments
Closed

Invalid default value for bit field #14734

OlafvdSpek opened this issue Nov 18, 2018 · 12 comments
Assignees
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete help wanted
Milestone

Comments

@OlafvdSpek
Copy link

While trying to reorder columns in a table:

Original:

`top10Show` bit(1) NOT NULL DEFAULT b'1',

pMA:

`top10Show` BIT(1)   NOT NULL DEFAULT b'0010' AFTER `notified`, 

V: master

@williamdes
Copy link
Member

@OlafvdSpek Please try to detail steps to reproduce the issues you submit because it is not always easy for a newbie to reproduce and create a fix.
Thanks :)

@OlafvdSpek
Copy link
Author

I know, but that costs way more time that I'd rather spend elsewhere.

@williamdes
Copy link
Member

Reproduced on master : 5.0.0-dev
Error when moving columns on : 4.8.x
Impossible to edit the bit column on master: Blank page.

Test data

CREATE TABLE `test` (
  `id` int(11) NOT NULL,
  `a` bit(1) NOT NULL DEFAULT b'1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

@williamdes williamdes added Bug A problem or regression with an existing feature help wanted labels Nov 18, 2018
@williamdes
Copy link
Member

And bad displayed default value on 4.8.x
'1'

Screenshot

2cfc8f01-1870-46ab-8e71-e25d82e06582

@OlafvdSpek
Copy link
Author

Is the default value shown wrong even for int?

@williamdes
Copy link
Member

@OlafvdSpek For me, no, because I did not specify any ;)

@OlafvdSpek
Copy link
Author

Ah, I misunderstood the "Aucun(e)". :p

@williamdes
Copy link
Member

@OlafvdSpek okay ^^
Thank you for reporting issues ;)

@bahl24
Copy link
Contributor

bahl24 commented Jan 21, 2019

And bad displayed default value on 4.8.x
'1'

Screenshot

2cfc8f01-1870-46ab-8e71-e25d82e06582

@williamdes @OlafvdSpek This might be because htmlspecialchars in php changes ' to &#039 as a way to prevent scripting attacks in website. Let me see the issue in detail and try to provide a fix.

@bahl24
Copy link
Contributor

bahl24 commented Jan 22, 2019

@williamdes @ibennetch I worked on the issue and found that $bit_default_value passed to the Util.php is b'1' instead of b'1' . Hence, I modified Util.php to satisfy our needs without affecting previous functionality. Kindly take a look at it.

Also, should I open the pull request for the master branch or QA_4_8 branch. Currently I worked off the QA_4_8 branch and it looks good.

@williamdes
Copy link
Member

@bahl24 you can open a PR that targets and uses as base QA_4_8
Thank you for the research :) !

@bahl24
Copy link
Contributor

bahl24 commented Jan 23, 2019

@bahl24 you can open a PR that targets and uses as base QA_4_8
Thank you for the research :) !

@williamdes done, kindly take a look at it.

@williamdes williamdes added the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Jan 23, 2019
williamdes added a commit that referenced this issue Mar 6, 2019
Fixes: #14734
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Mar 6, 2019
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes williamdes self-assigned this Mar 6, 2019
@williamdes williamdes added this to the 4.8.6 milestone Mar 6, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete help wanted
Projects
None yet
Development

No branches or pull requests

3 participants