-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Moving columns causes the default uuid() value to get quotes around it #18006
Comments
Hi @Nefcanto Some UUID changes where made recently: https://github.com/phpmyadmin/phpmyadmin/issues?q=+milestone%3A5.2.1+is%3Aclosed+uuid+ |
@williamdes yes sure. Thank you for responding so fast. I'll try with the 5.2 snapshot's non official docker image and I'll report the results here. |
@williamdes I tested using This is my pma:
image: botsudo/phpmyadmin-snapshots:5.3-snapshot
container_name: FalconPma
restart: always
logging:
driver: none
ports:
- 7202:80
environment:
- PMA_HOST=database
networks:
- FalconNetwork |
In my case, I can't move the columns. I have to remove the single quotes. Looking at this, it seems that uuid is not defined in and the column can't be moved. 07.01.2023_17.49.13_REC.mp4 |
I think, this's most probably related to #17920 |
@liviuconcioiu does your pull request solve this? Can I test it? |
I think it should, you can apply the patch from the pull-request and let us know |
@williamdes I don't know how to apply the patch from the pull-request. Can I use it as a docker image? |
I could build this some time soon |
@Nefcanto the PR solves the problem. No more quotes and it allows the columns to be moved. 08.01.2023_11.57.09_REC.mp4To test it, is very easy. Just go to https://github.com/phpmyadmin/phpmyadmin/pull/18007/files and copy the code from the right side and paste it at the specified line numbers on this file:
|
@williamdes and @liviuconcioiu you are awesome guys. Thank you so much for the time you spent on this. |
Pull-request: #18007 Signed-off-by: William Desportes <williamdes@wdes.fr>
The fix is now into the snapshot and docker snapshot image, you can pull it. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
@williamdes thank you |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Indeed, sorry for this. I tried the image when I was on my workstation. I can move columns without any issue. I tested the same as you with an I do not think a google meet is best for such a small bug :) |
@williamdes , it's nice of you that you put time into this, there is no need for excuses. I'm the one who should be grateful here. Thank you so much. Please create a table using this script: CREATE TABLE `Temp` (
`Id` int(11) NOT NULL,
`First` text NOT NULL DEFAULT uuid(),
`Second` text NOT NULL DEFAULT uuid()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci Then move the second column between the CREATE TABLE `Temp` (
`Id` int(11) NOT NULL,
`Second` text NOT NULL DEFAULT 'uuid()',
`First` text NOT NULL DEFAULT uuid()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci Then please move the CREATE TABLE `Temp` (
`Second` text NOT NULL DEFAULT '\'uuid()\'',
`First` text NOT NULL DEFAULT 'uuid()',
`Id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci I'm sorry, I don't know PHP and I don't know I should put what file where. :( I just use MariaDB with .NET API and React client. Alos, this is my home page info: |
Also I realized that I can change the column's nullability and it fixes the |
Thank you for the feedback, I will try using MariaDB 10.10 There is maybe a difference |
@williamdes I've attached a video, with @Nefcanto queries. This happens because @Nefcanto uses 11.01.2023_13.49.58_REC.mp4Technically this isn't a bug, because the value he sees, 11.01.2023_14.03.45_REC.mp4 |
@liviuconcioiu thank you. I have to use text data types because I store slug. But if the slug is empty for a given post, then I should create a unique token there, and there is no better unique token than UUID. That's why I use it as the default value for slugs and keys. |
For the the column where a uuid is stored, you can change it to UUID. |
So it seems its a bug from the videos I see, the function is moved to an escaped string |
Could someone contribute to fixing this left over please ? 🙏🏻 As I said on #17830 (comment) the release should occur at the end of the month. |
@williamdes I tested with the This problem does not exist for |
Okay, got it
Awesome
Because of that it's maybe more #14371 like I said on #18006 (comment) |
Yep, you're right, it's similar to the #14371. |
Describe the bug
When I set a default value for a column that is
UUID
touuid()
, and use PHPMyAdmin to move it in the list of columns, and then useshow create table X
, I see that theuuid()
would become'uuid()'
and if I move it one more time, it becomes'''uuid()'''
.To Reproduce
Steps to reproduce the behavior:
uuid()
Move column
feature to change the order of columnsStructure
tabMove column
link (if you can't find it, search it inside the page)show create table X
Expected behavior
The default value
uuid()
should remain as is when we move columns (change the order of columns)Screenshots
From left hand (default state) we get to the right hand after moving columns around
Server configuration
Client configuration
Additional context
Add any other context about the bug here.
The text was updated successfully, but these errors were encountered: