Package: moodle
Version: 1.6.1+20060825-1
Severity: normal
there is a sql (logical) error when trying to install (upgrade) the
book module using postgres as the database. this error may (probably
does) apply to mysql as well, unverified though.
error follows:
from the file: /usr/share/moodle/mod/book/db/postgres7.sql
INSERT INTO prefix_log_display VALUES ('book', 'update', 'book', 'name');
INSERT INTO prefix_log_display VALUES ('book', 'view', 'book', 'name');
INSERT INTO prefix_log_display VALUES ('book', 'view all', 'book', 'name');
INSERT INTO prefix_log_display VALUES ('book', 'print', 'book', 'name');
however the schema for the table prefix_log_display is:
moodle=> \d mdl_log_display
Table "public.mdl_log_display"
Column | Type | Modifiers
--------+-----------------------+--------------------------------------------------------------
id | integer | not null default
nextval('mdl_log_display_id_seq'::regclass)
module | character varying(20) | not null default ''::character varying
action | character varying(40) | not null default ''::character varying
mtable | character varying(30) | not null default ''::character varying
field | character varying(50) | not null default ''::character varying
Indexes:
"mdl_log_display_pkey" PRIMARY KEY, btree (id)
"mdl_log_display_moduleaction" btree (module, "action")
and thus, the value 'book' is being inserted into a integer (field
'id').
instead it should be more like the lines in:
/usr/share/moodle/mod/data/db/postgres7.sql
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES
('data', 'view', 'data', 'name');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES
('data', 'add', 'data', 'name');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES
('data', 'update', 'data', 'name');
a patch follows:
--- /usr/share/moodle/mod/book/db/postgres7.sql.orig 2006-09-08
13:25:58.000000000 -0500
+++ /usr/share/moodle/mod/book/db/postgres7.sql.new 2006-09-08
13:33:49.000000000 -0500
@@ -33,7 +33,7 @@
);
# --------------------------------------------------------
-INSERT INTO prefix_log_display VALUES ('book', 'update', 'book',
'name');
-INSERT INTO prefix_log_display VALUES ('book', 'view', 'book',
'name');
-INSERT INTO prefix_log_display VALUES ('book', 'view all', 'book',
'name');
-INSERT INTO prefix_log_display VALUES ('book', 'print', 'book',
'name');
+INSERT INTO prefix_log_display (module, action, mtable, field) VALUES
('book', 'update', 'book', 'name');
+INSERT INTO prefix_log_display (module, action, mtable, field) VALUES
('book', 'view', 'book', 'name');
+INSERT INTO prefix_log_display (module, action, mtable, field) VALUES
('book', 'view all', 'book', 'name');
+INSERT INTO prefix_log_display (module, action, mtable, field) VALUES
('book', 'print', 'book', 'name');
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (990, 'unstable'), (500, 'testing'), (500, 'stable'), (1,
'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16.4
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]