Menu

#56 Add Project throws DB-Error (no description)

v1.0 (example)
closed-fixed
nobody
None
8
2018-05-31
2018-03-11
No

svn-access-manager 0.5.6.6
MySQL5.7.21
php5.6
apache 2.4.18

When trying to create a project we get Database error:
Field 'description' doesn't have a default value
INSERT INTO svnproject (svnmodule, modulepath, repo_id, created, created_user) VALUES...

As you see workOnProjects.php does not insert a description and this has to be not NULL.

Is this a bug (tried 0.5.6.5 also) or do i something wrong?

Thanx
Hermann

Discussion

  • Thomas Krieger

    Thomas Krieger - 2018-03-12

    Hi,

    no issues here in my test environment with MariaDB instead of MySQL. Seems that MariaDB and MySQL are behaving differently in that particular case.

    To fix this you have two options:
    1. change database table svnprojects and allow NULL in description column
    2. change database table svnprojects and define a default value " " (Blank) if possible or "N/A" if blank does not work for column "description"

    I think I have to do database tests for MySQL too. I will add unit tests against a MySQL database as well.

    I'm currently working on a new release to make SVN Access Manager run with PHP 7. I will add a fix there. Maybe I will use the "description" field and make it accessable.

    Best regards

    Thomas

     
    • Hermann Gottschalk

      Changed database table svnprojects and define a default value " " (Blank). worked.

      Further errors:

      Whenn creating access_rights we get also DB-Error; either group_id has
      no default value or user_id has no default value.

      In the table svn_access_rights is a default value of 'NULL', which seems
      to be accepted when creating the database but not when using it. When i
      try alter table with a default value 'NULL' it says, the value is not
      valid. With a default value 0 it works, but i fear 0 will lead to
      problems as it is not 'NULL'

      May i change all Defaults 'NULL' to 0??

      Greetings
      Hermann

      --
      OSTC Open Source Training and Consulting GmbH / HRB Nuernberg 20032
      tel +49 9191-3415980 / fax +49 911-1806277 / http://www.ostc.de
      Waldemar-Klink-Str. 10 / D-90425 Nuernberg / Geschaeftsfuehrung:
      Thomas Birnthaler / +49 171-3047465 / pgp 0xFEE7EB4C
      Hermann Gottschalk / +49 173-3600680 / pgp 0x0B2D8EEA

       

      Last edit: Hermann Gottschalk 2018-03-13
  • Thomas Krieger

    Thomas Krieger - 2018-03-13

    I think thats all related to changes in behaviour between MariaDB and MySQL. I work only with MariaDB and have none of you issues. As I mentiones before ich have to do some tests with MySQL and see where the differences are and provide some fixes for that.

    You can try to change to "0" but I think that is not a propper solution. I have no clue at the moment why these errors come up. I will have to setup a test environment with a MySQL database and run my tests against this database to see what happens. Docker will be my best friend.

    Currently I work onsite at a customer. Maybe it will take some time to inverstigate the issues.

    Best regards

    Thomas

     
  • Thomas Krieger

    Thomas Krieger - 2018-03-13

    The default NULL can not work. Had a quick look at the code.

    The database definition:
    user_id int(10) NOT NULL, group_id int(10) NOT NULL

    So Null as default is not a good choise. You can set '0' as default. Should work. I will fix that in the code as well

     
  • Thomas Krieger

    Thomas Krieger - 2018-03-13

    I uploaded a bunch of changes to the svnam-0.5-install-fix branch. There you should find the untested fixed for the default value problems

     
  • Hermann Gottschalk

    Sorry: Seems i did check ou wrong code...

    Don't see a difference neither in create_tables_mysql.sql nor in workOnProjects.php ?! How should the starting point problem with the "description" column in svnprojects be solved?

     

    Last edit: Hermann Gottschalk 2018-03-13
  • Hermann Gottschalk

    Seems to work now! Many thanks for the quick rsponses!!! I will give feedback, when we worked with it...

    Greetings
    Hermann

     
  • Thomas Krieger

    Thomas Krieger - 2018-03-13

    you,re welcome.

    Und ich arbeite auch in Nuernberg. Das habe ich gerade ers in Deinem Footer gesehen.

     
  • Thomas Krieger

    Thomas Krieger - 2018-05-31
    • status: open --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.