Summary | Wrong datatype "?" to "unsigned bigint" in datatree. \lib\Horde\DataTree\sql.php |
Queue | Horde Framework Packages |
Queue Version | FRAMEWORK_3 |
Type | Bug |
State | No Feedback |
Priority | 2. Medium |
Owners | |
Requester | c-master (at) freenet (dot) de |
Created | 09/28/2009 (5753 days ago) |
Due | 12/31/2009 (5659 days ago) |
Updated | 12/07/2009 (5683 days ago) |
Assigned | 09/29/2009 (5752 days ago) |
Resolved | 12/04/2009 (5686 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Thats it: I'm giving up. When there is a new Version of Sybase (I
think it is 11 at the moment) I'll try again.
Anyway: many many thanks for your help!
State ⇒ No Feedback
current state.
obviously don't care about their customers.
I'll check the sybase ticket tomorrow.
If sybase won't answer: Is there any kind of workaround for my problem?
regards
... See what happens next.
apply when using pgsql or mssql. There might be a syntax that works
for Sybase, but since we have a single driver for ODBC it might break
other ODBC-driven databases.
One for Sybase, another for all other ODBC-driven databases?
apply when using pgsql or mssql. There might be a syntax that works
for Sybase, but since we have a single driver for ODBC it might break
other ODBC-driven databases.
When I change this line
(a1.attribute_name = 'owner' AND a1.attribute_value = 'root') OR
to this line
(a1.attribute_name = 'owner' AND a1.attribute_value = 'root') AND
it works! But maybe it won't in certain circumstances, because the
logic is changed.
First problem is solved, but there's another (same) one.
This statement now works:
SELECT c.datatree_id, c.datatree_name FROM horde_datatree c LEFT JOIN
horde_datatree_attributes a1 ON a1.datatree_id = c.datatree_id LEFT
JOIN horde_datatree_attributes a2 ON a2.datatree_id = c.datatree_id
WHERE c.group_uid = 'horde.shares.kronolith' AND (a1.attribute_name =
'perm_groups' AND a1.attribute_key IN ('1', '2') AND
(a1.attribute_value & 2) = 2) AND a2.attribute_name = 'name' GROUP
BY c.datatree_id, c.datatree_name, c.datatree_order,
a2.attribute_value ORDER BY a2.attribute_value ASC
...after I changed the following values (Sybase Database Options):
Blocking = Off
Optimization_Goal = First-Row
Optimization_Level = 0
Optimization_Logging = On
Prefetch = Off
Now the same problem on a even more complex statement. (It can be
found in the already attached file horde.log) Error code again -157.
Message 'conversion from "Kalender von root" to unsigned bigint not
possible'.
SELECT c.datatree_id, c.datatree_name FROM horde_datatree c
LEFT JOIN horde_datatree_attributes a1 ON a1.datatree_id = c.datatree_id
LEFT JOIN horde_datatree_attributes a2 ON a2.datatree_id = c.datatree_id
LEFT JOIN horde_datatree_attributes a3 ON a3.datatree_id = c.datatree_id
WHERE c.group_uid = 'horde.shares.kronolith' AND
(
(
(a1.attribute_name = 'owner' AND a1.attribute_value = 'root') OR
(a1.attribute_name = 'perm_users' AND a1.attribute_key = 'root'
AND (a1.attribute_value & 2) = 2) OR
(a1.attribute_name = 'perm_creator' AND (a1.attribute_value & 2) = 2) OR
(a1.attribute_name = 'perm_default' AND (a1.attribute_value & 2) = 2) OR
(a1.attribute_name = 'perm_groups' AND a1.attribute_key IN ('1',
'2') AND (a1.attribute_value & 2) = 2)
) AND a2.attribute_name = 'owner' AND a2.attribute_value = 'root')
AND a1.datatree_id = a2.datatree_id AND a3.attribute_name = 'name'
GROUP BY c.datatree_id, c.datatree_name, c.datatree_order,
a3.attribute_value ORDER BY a3.attribute_value ASC
-------
But when I remove the line
(a1.attribute_name = 'owner' AND a1.attribute_value = 'root') OR
it runs perfectly!
possibility for you to do some testing with a Sybase-DB?
At this moment I also don't know what is wrong with sybase. I will try
several database-settings and report back. Is there any possibility
for you to do some testing with a Sybase-DB?
From the error message it looks like it is doing the
(a1.attribute_value & 2) = 2 comparison on rows where attribute_value
contains 'Kalender von root'. This is an expected value for rows that
have attribute_name = 'name'. But we explicitly ask for attribute_name
= 'perm_groups' in the query *first*. No idea, why it gets the order
correct without the group_uid part. And I don't know how to tell
Sybase to get its optimization correctly done either.
New Attachment: hordeStatements.JPG
SELECT c.datatree_id, c.datatree_name FROM horde_datatree c
LEFT JOIN horde_datatree_attributes a1 ON a1.datatree_id = c.datatree_id
LEFT JOIN horde_datatree_attributes a2 ON a2.datatree_id = c.datatree_id
WHERE (c.group_uid = 'horde.shares.kronolith') AND
(a1.attribute_name = 'perm_groups' AND a1.attribute_key IN ('1', '2')
AND (a1.attribute_value & 2) = 2) AND a2.attribute_name = 'name'
GROUP BY c.datatree_id, c.datatree_name, c.datatree_order,
a2.attribute_value ORDER BY a2.attribute_value ASC
to this statement
SELECT c.datatree_id, c.datatree_name FROM horde_datatree c
LEFT JOIN horde_datatree_attributes a1 ON a1.datatree_id = c.datatree_id
LEFT JOIN horde_datatree_attributes a2 ON a2.datatree_id = c.datatree_id
WHERE
(a1.attribute_name = 'perm_groups' AND a1.attribute_key IN ('1', '2')
AND (a1.attribute_value & 2) = 2) AND a2.attribute_name = 'name'
GROUP BY c.datatree_id, c.datatree_name, c.datatree_order,
a2.attribute_value ORDER BY a2.attribute_value ASC
the execution works and returns the values:
datatree_id = 2 and datatree_name = 'root'
if I put "... where (c.group_uid = 'horde.shares.kronolith') AND ..."
back in, the same error appeares... See attachment 'hordeStatements.JPG'
"... AND a1.attribute_key IN ('1', '2') AND (a1.attribute_value & 8) =
8) AND a2.attribute_name = 'name' ...".
Because attribute_value is varchar(255) and not an integer sybase
seems not to refer to the actual VALUE of attribute_value but instead
to the TYPE of attribute_value. Maybe it needs some explicit
conversation at this time.
OR (my 2nd guess)
The mapping between attribute_name and attribute_value somehow fails
and horde (or sybase?) just takes a wrong value from attribute_value.
convert the varchar to bigint for some reason and fails. I don't
know why this conversion is needed, or if it is needed at all.
Anyway it fails with error: "Umwandeln von Kalender von root auf
unsigned bigint nicht möglich" [pid 1052 on line 1252 of
"\lib\Horde\DataTree\sql.php"]
-> I translated it to english: "Conversion from 'Kalender von root'
to unsigned bigint not possible"
Sybase. And I don't know either why this conversion would be needed,
or when Sybase is trying to do the conversion.
converted to bigint? The column is a string, and from your screenshot
it save both string and integer values just fine, like expected.
convert the varchar to bigint for some reason and fails. I don't know
why this conversion is needed, or if it is needed at all. Anyway it
fails with error: "Umwandeln von Kalender von root auf unsigned bigint
nicht möglich" [pid 1052 on line 1252 of "\lib\Horde\DataTree\sql.php"]
-> I translated it to english: "Conversion from 'Kalender von root' to
unsigned bigint not possible"
which can not be converted to bigint (because it is a string)
converted to bigint? The column is a string, and from your screenshot
it save both string and integer values just fine, like expected.
New Attachment: hordeTables.JPG
script is based) is not really up-to-date. The datatree_order column
is missing and the horde_datatree_attributes is missing completely.
horde-error-logs and using the datatree-create statements.
My tables look like this (sql form)
CREATE TABLE "php"."horde_datatree" (
"datatree_id" integer NOT NULL,
"group_uid" varchar(255) NOT NULL,
"user_uid" varchar(255) NOT NULL,
"datatree_name" varchar(255) NOT NULL,
"datatree_parents" varchar(255) NOT NULL,
"datatree_order" integer NULL,
"datatree_data" varchar(255) NULL,
"datatree_serialized" smallint NOT NULL DEFAULT 0,
PRIMARY KEY ( "datatree_id" )
);
CREATE TABLE "php"."horde_datatree_attributes" (
"datatree_id" integer NOT NULL,
"attribute_name" varchar(255) NOT NULL,
"attribute_key" varchar(255) NULL,
"attribute_value" varchar(255) NULL
);
Table Data visible in attachment. The Problem is attribute_value which
can not be converted to bigint (because it is a string)
MDB2_Driver_odbc?
and then replaced 'datatree_data TEXT NOT NULL' with 'datatree_data
VARCHAR(255) NOT NULL' by hand. (Did not help)
script is based) is not really up-to-date. The datatree_order column
is missing and the horde_datatree_attributes is missing completely.
MDB2_Driver_odbc?
and then replaced 'datatree_data TEXT NOT NULL' with 'datatree_data
VARCHAR(255) NOT NULL' by hand. (Did not help)
MDB2_Driver_odbc?
State ⇒ Feedback
missing MDB2_ODBC driver.
New Attachment: horde.log
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Due ⇒ 12/31/2009
Summary ⇒ Wrong datatype "?" to "unsigned bigint" in datatree. \lib\Horde\DataTree\sql.php
Type ⇒ Bug
Queue ⇒ Horde Framework Packages
ODBC. (Works perfectly)
When using the share method "sql" horde crashes completely because of
missing MDB2_ODBC driver.
When using the share method "dataTree" (as workaround) horde says
"HORDE [error] [kronolith] DB Error: unknown error: SELECT
c.datatree_id, c.datatree_name FROM
horde_datatree..................Umwandeln von Kalender von root auf
unsigned bigint nicht möglich]................."
As a result no shared calendars are configurable. Calendars could be
created, but don't appear in calendar-settings...
I strongly believe, the dataTree issue is a real bug. Please solve it