I deleted a block that was created by the Views module. The block was still configured on some pages so it screwed something up with the menus. Long story short:

I get a "Page Not Found" on every page
Can't access anything admin/ - still P.N.F.
Tried running update.php
Tried rebuilding the menu as suggested here: http://drupal.org/node/262892

There seems to be an error when running the menu_rebuild() funtion. Here is what I'm seeing in the logs:

error query: begin UPDATE "MENU_LINKS" SET p1=:p_1, p2=p3, p3=p4, p4=p5, p5=p6, p6=p7, p7=p8, p8=p9, p9=0, depth=depth + :depth, menu_name=:db_update_placeholder_0#012WHERE (menu_name = :db_condition_placeholder_0) AND (p1 = :db_condition_placeholder_1) AND (p2 = :db_condition_placeholder_2) ; :db_sql_rowcount := sql%rowcount; end; e: SQLSTATE[HY000]: General error: 2290 OCIStmtExecute: ORA-02290: check constraint (DRUPAL.SYS_C0011618) violated#012ORA-06512: at line 1#012 (/usr/share/php5/PDO_OCI-1.0/oci_statement.c:142) args: Array#012(#012)

This is D7 with the latest stable driver (not -dev). Luckily, I have backups from yesterday :) But hopefully this is fixable. Again, I can't login to the interface to do anything. If I should post in different section please let me know, but I figured I'd get kicked over here as soon as I showed the above error.

Thanks for any help!

Comments

oshelot’s picture

Priority: Normal » Major

So I'm not sure this was the smartest thing to do but I removed the constraint that was throwing the error:

select CONSTRAINT_NAME from user_constraints where CONSTRAINT_NAME = 'SYS_C0011618';

CONSTRAINT_NAME C
------------------------------ -
SYS_C0011618 C

SQL> ALTER TABLE MENU_LINKS DROP constraint SYS_C0011618;

Table altered.

After doing so, the menu_rebuild() was able to complete and I was able to access everything and fix the broken menu links.

I wanted to add the constraint back to the table but unfortunately I didn't make note the constraint and closed the terminal where the output was (FAIL, I know). I do remember that it was type 'C' - (check constraint on a table) but don't know what the parameter are.

I think if someone can login to the DB with the drupal DB user account and run the following query it will give me what I need:

select * from user_constraints where CONSTRAINT_NAME = 'SYS_C0011618';

Thanks!

oshelot’s picture

Priority: Major » Normal
miopa’s picture

Category: support » bug

The constraint checks if p1 >= 0. Removing it will force the default value (0) into that field.

I debugged, and $stmt->bindParam($placeholder, $argument); is called with the right values (p_1 as $placeholder and positive integer as $argument).

I'm reclassifying it as major because it seems that the bug is somewhere in the drivers binding of the params.

aaaristo’s picture

Status: Active » Needs review

bindParam is implemented into the database.inc the only thing it does is a cleanupArgValue
before passing it to the PDOStatement class, have you tried to see if cleanupArgValue alters the value?
otherwise it is a pdo_oci bug.

miopa’s picture

Priority: Major » Normal

After some more investigation, everything works well when the constraints are disabled (p1..p9 >= 0). The fields are updated with the correct values, meaning that there is no binding problem.

The question remains, why a violation is reported, when the values satisfy the condition?

aaaristo’s picture

Status: Needs review » Postponed (maintainer needs more info)

cannot reproduce it...

miopa’s picture

Edit menus.

Try moving menu item up in the tree.

aaaristo’s picture

Status: Postponed (maintainer needs more info) » Fixed

fixed in 1.9

miopa’s picture

That was fast! :)

What was the issue, I still can't figure it out how can this happen?

aaaristo’s picture

There was a problem on the expressionFields of the UpdateQuery_oracle... and the way pdo_oci uses references to the php variables... mainly the args of the update where not bound to the query. Check the commit for details...

aaaristo’s picture

sorry wrong post.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.