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

[suggestion] The ''(empty string) of int type to null(or 0) for MySQL5.6 Query #171

Open
muzudho opened this issue Feb 10, 2016 · 0 comments

Comments

@muzudho
Copy link

muzudho commented Feb 10, 2016

Hi.
Future story.(MySQL 5.5 ----> 5.6) I found it below.

-- MySQL5.6 NG
INSERT INTO mail (id, email, html, template) VALUES ('', 'a', 'b', 1);
-- Error Code: 1366. Incorrect integer value: '' for column 'id' at row 1

-- MySQL5.6 ok
INSERT INTO mail ( id, email, html, template) VALUES ( null, 'a', 'b', 1);
-- 1 row(s) affected

I temporarily resolved. I remove strict mode.

SET @@GLOBAL.sql_mode='';

SELECT @@GLOBAL.sql_mode;

or step by step. I change '' to null ( or 0).

/controller/admin/mailing.php 255
/controller/admin/newsletter.php 90
/controller/dashboard/projects.php 317
/library/feed.php 449
/library/mail.php 205
/library/mail.php 219
/library/sender.php 76
/library/sender.php 82
/model/user.php 287
if($data[':confirmed'] == ''){
$data[':confirmed'] = 0;
}
...... :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant