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

手工执行存储过程,报1364错误 #37

Closed
akira82 opened this issue Dec 20, 2012 · 6 comments
Closed

手工执行存储过程,报1364错误 #37

akira82 opened this issue Dec 20, 2012 · 6 comments

Comments

@akira82
Copy link

akira82 commented Dec 20, 2012

手工依次执行:
call rundim();
call runfact('2012-12-20 15:00:00','2012-12-20 15:59:59');
call runsum('2012-12-20');

在runsum处,报:

SQL 错误 [1364] [HY000]: Field 'segment_sk' doesn't have a default value

Field 'segment_sk' doesn't have a default value

我已经将mysql的sql_mode改为:NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

@cobub
Copy link
Owner

cobub commented Dec 21, 2012

Did you restart the mysql service?

@akira82
Copy link
Author

akira82 commented Dec 21, 2012

Yep. MySql service has been restarted.

Now, I found some possible way to resolve it: alter the column "not null" TO "null". It seems OK, but I don't know the risk

@cobub
Copy link
Owner

cobub commented Dec 21, 2012

Your method is OK. Another way is to set a default value for this "not null" column. Now we are checking all tables' structure to fix this problem.

@cobub cobub closed this as completed Dec 21, 2012
@akira82
Copy link
Author

akira82 commented Dec 21, 2012

by the way:

I have check out the sp"runsum()" , finding some thing hard to understand, please see below:

line 6 ~ 11:
insert into razor_fact_usinglog_daily
(product_sk,
date_sk,
session_id,
duration)
, not including the column segment_sk, and the column segment_sk is NOT-NULL, so I think this is the problem.

@cobub
Copy link
Owner

cobub commented Dec 21, 2012

Yes, it depends on mysql is set STRICT_MODE or not. Now we are working to define table structure strictly.

@akira82
Copy link
Author

akira82 commented Dec 21, 2012

Nice!

Really expect the updating!!!!!

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

No branches or pull requests

2 participants