Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
I tried today installing mariadb-server-5.1 (5.1.39-ourdelta67) on an Ubuntu 8.04 machine that previously ran the standard Ubuntu MySQL 5.0, so an upgrade scenario.
After the install, I see this in the /var/log/daemon.log from the bootstrap done during postinst:
Nov 17 10:40:52 odin mysqld_safe[10176]: 091117 10:40:52 [Warning] options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log_slow_queries is not set
Nov 17 10:40:52 odin mysqld_safe[10176]: ERROR: 1136 Column count doesn't match value count at row 1
Nov 17 10:40:52 odin mysqld_safe[10176]: 091117 10:40:52 [ERROR] Aborting
It seems this comes from this line in mariadb-server-5.1.postinst:
echo "$replace_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
The problem is that my mysql.user table is missing the columns Event_priv and Trigger_priv. The postinst script tries to add them with this statement:
fix_privs=`/bin/echo -e \
"USE mysql;\n" \
"ALTER TABLE user ADD column Create_view_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
"ALTER TABLE user ADD column Show_view_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
"ALTER TABLE user ADD column Create_routine_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
"ALTER TABLE user ADD column Alter_routine_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
"ALTER TABLE user ADD column Create_user_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
"ALTER TABLE user ADD column Event_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " \
"ALTER TABLE user ADD column Trigger_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " `
But this failed to create the Event_priv and Trigger_priv columns. This is not surprising, as in MySQL 5.0 the other columns are already present. So the first ALTER TABLE fails and bootstrap aborts. (I did not find any error message in the logs for failing ALTER TABLE, not sure why...)
Manually adding the Event_priv and Trigger_priv columns and re-installing seems to get rid of the "Column count doesn't match value count" error.
A possible solution might be to seperate this into two bootstrap statements, so that Event_priv and Trigger_priv will be created even if adding the other columns fails.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Re: "ERROR: 1136 Column count doesn't match value count at row 1" when installing mariadb-server-5.1
How things 'should' work is that one should start mysqld, run the
mysql_fix_privilege_tables and then stop mysqld.
I don't think it's correct to duplicate the work to fix the privilege tables as we then have to constantly have to keep
the scripts in sync.
Also the way 'fix_privs' now works, it will not be able to handle all cases that mysql_fix_privilege_tables does.