Posted by firfin on September 3, 2009 at 11:23pm
| Project: | iDEAL Easy | Ubercart Payment |
| Version: | 6.x-1.5 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | keesje |
| Status: | needs review |
Issue Summary
I get the following error when trying to install the module in D6:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'(9) NOT NULL, `transaction_id` (9) NOT NULL, `description` VARCHAR(9) NOT NULL' at line 2 query:
CREATE TABLE uc_payment_ideal_easy ( `order_id` (9) NOT NULL, `transaction_id` (9) NOT NULL, `description` VARCHAR(9) NOT NULL, `order_status` (4) NOT NULL, `return_succes` TEXT NOT NULL, PRIMARY KEY (order_id) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in /site/includes/database.inc op regel 515.And I also solved the problem, after I realized it is because of the new schema API. Tinyint and mediumint are no longer recognized as valid type for the fields. Int is. Also see:
http://api.drupal.org/api/group/schemaapi/6
http://drupal.org/node/159605
So I just changed the 'tinyint' and 'mediumint' in the field definitions of the .install file to 'int' and a appropiate size parameter. After that I could install the module without errors.
Comments
#1
This is a patch for the 1.4 version of the iDEAL Easy payment module.
It fixes 'type' and 'size' parameters of various fields in the schema.
Also corrects a small typo.
#2
@anyone: Please confirm if this patch works for you
#3
Should be fixed in current release, please reopen if necessary.
#4
Would be better to fix this with the Schema API so that it also works with PostgreSQL.
#5
Agreed, will give this more attention.
#6
Please try this patch
#7
Patch failed for me. Tried to apply it to the 1.4 version from 2009-Aug-18 (from http://drupal.org/project/uc_ideal_easy) with the following command:
patch -b ./uc_ideal_easy_payment.install ./uc_ideal_easy_payment.install_1p0.patchWhich resulted in:
(Stripping trailing CRs from patch.)patching file ./uc_ideal_easy_payment.install
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file ./uc_ideal_easy_payment.install.rej
I attached this file for you (I just added .txt to the filename, else drupal.org won't let me upload). Don't know if it helps at all. Looks the same as the original patchfile.
I will try patching the file manually. I will get back to you on that.
#8
I have made a new patch. This works for me with a fresh 1.4 uc_ideal_easy. It fixes a typo, uses the correct dbtypes for hook_schema and calls the correct schema.
I believe I have followed Schema API to the letter. As specified on http://api.drupal.org/api/group/schemaapi/6 and http://api.drupal.org/api/function/db_type_map/6
What exactly do you mean praseodym?
#9
This seemed to be fixed in the 1.5 release. Unfortunately this is because the DB tables were not created. See #562230: drupal_install_schema not used correctly comment #14 for a fix. This fix needs to be applied before the one in this thread will work!
Once DB tables are created the SQL errors return:
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL, `transaction_id` NOT NULL, `description` VARCHAR(9) NOT NULL, `ord' at line 2 query: CREATE TABLE uc_payment_ideal_easy ( `order_id` NOT NULL, `transaction_id` NOT NULL, `description` VARCHAR(9) NOT NULL, `order_status` NOT NULL, `return_succes` TEXT NOT NULL, PRIMARY KEY (order_id) ) /*!40100 DEFAULT CHARACTER SET utf8 */ in /srv/www/tmf/public_html/includes/database.inc on line 551.This warning occurs because of incorrect definition of items in de schema array.
Patch is attached in next comment ( apply patch in #562230: drupal_install_schema not used correctly first! )
#10
Patch created with git for 1.5 version.
Fixes schema definition
Apply patch in #562230: drupal_install_schema not used correctly first!