-
Notifications
You must be signed in to change notification settings - Fork 254
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
[3.0] Fix an issue with mediumtext type #8127
[3.0] Fix an issue with mediumtext type #8127
Conversation
Signed-off-by: Bugo <[email protected]>
Signed-off-by: Bugo <[email protected]>
Sources/Db/APIs/MySQL.php
Outdated
'mediumtext' => 'text', | ||
'largetext' => 'text', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem correct to me. Why would we want to change MEDIUMTEXT and LARGETEXT data types to regular TEXT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. This means something changed somewhere, because in Alpha 1 database.php
worked as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now a query like this is generated:
CREATE TABLE `smf_alpha`.smf_lp_pages ( `page_id` smallint(5) unsigned auto_increment, `alias` varchar(255) NOT NULL , `description` varchar(255) , `content` mediumtext(0) NOT NULL , `type` varchar(10) NOT NULL DEFAULT 'bbc', PRIMARY KEY (page_id), UNIQUE alias (alias(191))) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci
And it needs to be like this:
CREATE TABLE `smf_alpha`.smf_lp_pages ( `page_id` smallint(5) unsigned auto_increment, `alias` varchar(255) NOT NULL , `description` varchar(255) , `content` mediumtext NOT NULL , `type` varchar(10) NOT NULL DEFAULT 'bbc', PRIMARY KEY (page_id), UNIQUE alias (alias(191))) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type hinting issue is defaulting the size to 0 and it needs to be nullable so when null we don't pass a size.
Signed-off-by: Bugo <[email protected]>
Signed-off-by: Bugo <[email protected]>
Fixes #8126