reserved word in fieldname ?

reserved word in fieldname ?

by Julio Monetti -
Number of replies: 10


Hello,


I'm trying to install version 3.4. 


The database creation script says

     CREATE TABLE mdl_chat_messages (
      id BIGINT(10) NOT NULL auto_increment,
      chatid BIGINT(10) NOT NULL DEFAULT 0,
      userid BIGINT(10) NOT NULL DEFAULT 0,
      groupid BIGINT(10) NOT NULL DEFAULT 0,
       system TINYINT(1) NOT NULL DEFAULT 0,  <========


In my (mysql / mariadb) "system" is  a

reserved word.


Of course: the database creation stop at

this point.


Could you please help me with this issue ?


Julio.


Average of ratings: -
In reply to Julio Monetti

Re: reserved word in fieldname ?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It shouldn't matter... can we get some more info?

What operating system, database server is this and how are you installing Moodle?

In reply to Howard Miller

Re: reserved word in fieldname ?

by Julio Monetti -

Howard,


Thank you very much for responding.  More info:

OS:  Fedora 26

Mysql: Ver 8.0.3-rc for Linux on x86_64 (MySQL Community Server (GPL))

Moodle:  3.4  (eng)

php: PHP 7.1.11 (cli)


I'm installing the server from   http://192.168.1.10/moodle  (from the same

lan network).   (is it what you ask ?)


Can I send you any other information ?


Thank you again for responding  smile


Julio



In reply to Julio Monetti

Re: reserved word in fieldname ?

by Ken Task -
Picture of Particularly helpful Moodlers

As one who learned Linux on the RH family systems and have used Fedora in the past, Fedora isn't long term support - shelf life only two years?  

I'd consider it RH Family (Fedora) 'experimental' as evident in the version of MySQL you have ... an 'rc' is a 'release candidate'.  I have moved away from Fedora because I grew tried of having to backup moodle implementation, archive that backup, wipe out the Fedora X completely and then grabbing the latest supported version of Fedora only have to repeat the entire process in 2 years.  While I learned a lot, decided it best for a production Moodle to be on something long term support.

Suggest using CentOS 7 (that's based on RH Enterprise and is long term support) ... if you want to stay with RH 'family' or Ubuntu 16.04 which is also LTS.

However, should you desire to continue, investigate your RC version of MySQL for 'sql-mode' ... which, if set to ANSI, should alllow you to install 3.4 - in other words, use reserved words as column names in DB's.

If you do continue with what you have, just remember you might run into other issues and due the OS itself, since many in these forums use LTS Linuxes,   answers may not be forthcoming easily. ;)

My 2 'sense', of course! ;)

'spirit of sharing', Ken


In reply to Ken Task

Re: reserved word in fieldname ?

by Julio Monetti -

Thank you Ken.  As I am just installing/starting my arquitecture, i'll follow

your suggestion in moving to Centos 7   smile


Julio.

In reply to Julio Monetti

Re: reserved word in fieldname ?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Created just fine in mysql for me.  What database are you using?  Do you perhaps have a custom setting on your database server causing this?

In reply to Emma Richardson

Re: reserved word in fieldname ?

by Julio Monetti -


database name:  moodle


> Do you perhaps have a custom setting on your database server causing this?

hmmm.. I don't think so.  The database was just created for the installer.

I've not configured anything in the mysql engine from it was installed.


I simplyfied the "experiment".  I create a simple table to verify

    create table A(

        system int

   )


...And got the same error.  So:  Can you (anybody else) ensure the

field name is "system",  and mysql accept it as field name ?



Julio.

In reply to Julio Monetti

Re: reserved word in fieldname ?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I notice you are using mysql 8?  But the latest version I see is 5.7.  So, are you sure you are using mysql and not some other database engine?

Also, you note an rc version of mysql - perhaps that is the issue.

In reply to Julio Monetti

Re: reserved word in fieldname ?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Mine was a fresh install with 5.7 and the field with the 'system' name is present.

If this is perhaps a sign of things to come, devs probably need to be aware so that they can adjust their naming scheme.

In reply to Julio Monetti

Re: reserved word in fieldname ?

by Ken Task -
Picture of Particularly helpful Moodlers

From where did you acquire the code?   And are you, by chance, installing a dev version?

Look at your version.php file in the moodle code.

Reason asked: in a git installed stock 3.4, inspecting that table shows a 'system' but installed with no issues.

'spirit of sharing', Ken