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

Users are not creating #2

Open
pmarcis opened this issue Nov 22, 2014 · 2 comments
Open

Users are not creating #2

pmarcis opened this issue Nov 22, 2014 · 2 comments
Assignees

Comments

@pmarcis
Copy link

pmarcis commented Nov 22, 2014

Similarly to tasks, users cannot be created, because the data base table does not accept NULL for some parameters.

Query failed:
errorno=1364
error=Field 'username' doesn't have a default value
query=INSERT INTO user (name,registered,refuser) VALUES ('_NEW_',now(),0);
@pmarcis
Copy link
Author

pmarcis commented Nov 23, 2014

I changed the import command to the following:

$res = safe_query("INSERT INTO user (name,username,password,email,status,team,activated,notes,registered,refuser) VALUES ('".$userinfo["name"]."','".$userinfo["username"]."','".$userinfo["password"]."','".$userinfo["email"]."','".$userinfo["status"]."','".$userinfo["team"]."','".$userinfo["activated"]."','".$userinfo["notes"]."',now(),".$mysession["userid"].");");

Now it seems to work, but the tasks are not automatically saved. They have to be assigned after creation of the user.

@cgirardi cgirardi self-assigned this Nov 24, 2014
@pmarcis
Copy link
Author

pmarcis commented Nov 27, 2014

This issue was due to MySQL 5.6 (starting from) having sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES as the default parameter. That means that non-strict behaviour was not allowed. However, I would encourage writing queries that are compliant with SQL table definitions nonetheless (makes support easier as well, because you won't have to troubleshoot issues that could have been avoided).

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

2 participants