The recent change to add support for the Bean module caused problems with databases other than MySQL, e.g. PostgreSQL, because they don't like doing comparisons between different types of values, in this case an integer and a varchar. The solution is to change the rid column back to an integer.

CommentFileSizeAuthor
#2 smartling-n2893683-2.patch1.19 KBdamienmckenna

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new1.19 KB

This reverts the previous changes.

Note: I suspect some custom handling will need to be added for Bean or other entity types that need to allow a non-integer ID. Incidentally, I'm a comaintainer of the Bean module, so we could discuss any changes that are needed for that module.

soul88’s picture

Hello, Damien.
I'm glad to hear from you.

I have 2 thoughts here:
1. Drupal core allows non-int primary keys for entities (like Bean), so it seems that we would need to support it anyway.
2. As for the Bean module, do you think you potentially could switch to an int field, or what other solution for this issue do you see?

Please let me know your thoughts here, as right now I'm honestly hesitating on what would be the best solution here.

Maybe some source of optional type-casting for PgSQL would be a better option here (not sure).

damienmckenna’s picture

Hello again Kostya :)

1. The problem with non-int primary keys only shows up when you use a database other than MySQL, like PostgreSQL; MySQL isn't very strict when it comes to data comparisons, (IIRC) it'll be slower than a direct int-to-int comparison but it works, whereas with PostgreSQL it just fails.

2. The Bean table uses a serial field for its primary key, the "bid" field, so I suspect something else needs to be worked out here. Maybe the Bean integration should work from the "bid" field instead of the delta?