Problem/Motivation

The schema API documentation lists "char:normal" as an available data type. However, this data type is currently not supported for sqlite, so schemas using this data type will not be installed properly.

Proposed resolution

Map char:normal to the SQLite CHAR data type. #1177284-3: Add support to sqlite for char:normal type implements this fix.

Remaining tasks

Once patch is committed, update http://drupal.org/node/159605 to indicate the type is now supported. (It was changed to "unsupported" after this issue was reported.)

User interface changes

None.

API changes

None.

Original report by @Bobík

After enable the module you can see this messages:

Notice: Undefined index: char:normal ve funkci DatabaseSchema_sqlite->processField() (řádek: 127 v souboru /Users/Bobik/Sites/drupal-7/includes/database/sqlite/schema.inc).
Notice: Undefined index: char:normal ve funkci DatabaseSchema_sqlite->processField() (řádek: 127 v souboru /Users/Bobik/Sites/drupal-7/includes/database/sqlite/schema.inc).
Notice: Undefined index: char:normal ve funkci DatabaseSchema_sqlite->processField() (řádek: 127 v souboru /Users/Bobik/Sites/drupal-7/includes/database/sqlite/schema.inc).
Notice: Undefined index: char:normal ve funkci DatabaseSchema_sqlite->processField() (řádek: 127 v souboru /Users/Bobik/Sites/drupal-7/includes/database/sqlite/schema.inc).

CommentFileSizeAuthor
#3 drupal-1177284.patch1012 bytesohnobinki
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ohnobinki’s picture

+ (seeing a similar thing with ubercart's uc_store schema.)

ohnobinki’s picture

Title: Notices after install » Add support to sqlite for char:normal type
Project: OAuth 1.0 » Drupal core
Version: 7.x-3.x-dev » 8.x-dev
Component: Code » sqlite database
Issue tags: +sqlite

Data Types documents the availability of a char:normal type. DatabaseSchema_sqlite::getFieldTypeMap() does not yet support this in drupal7 nor drupal8.

Both the modules OAuth (_oauth_common_consumer_schema()) and ubercart's uc_store module (uc_store_schema()) make use of char:normal.

Errors from uc_store's uc_store_schema():

Notice: Undefined index: char:normal in DatabaseSchema_sqlite->processField() (line 122 of /var/www/localhost/htdocs/drupal/includes/database/sqlite/schema.inc).
Notice: Undefined index: char:normal in DatabaseSchema_sqlite->processField() (line 122 of /var/www/localhost/htdocs/drupal/includes/database/sqlite/schema.inc).
PDOException: SQLSTATE[HY000]: General error: 1 near "(": syntax error: CREATE TABLE {uc_countries} ( country_id INTEGER NOT NULL CHECK (country_id>= 0), country_name VARCHAR(255) NOT NULL DEFAULT '', country_iso_code_2 (2) NOT NULL DEFAULT '', country_iso_code_3 (3) NOT NULL DEFAULT '', version INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (country_id) ); ; Array ( ) in db_create_table() (line 2592 of /var/www/localhost/htdocs/drupal/includes/database/database.inc)

I believe that mapping this type onto 'CHAR' makes the most sense and will add a patch which does that. This bug affects both drupal-8.x and drupal-7.x.

ohnobinki’s picture

FileSize
1012 bytes

This patch seems to fix the issue for me and makes uc_store (from ubercart) more functional on sqlite.

ohnobinki’s picture

Status: Active » Needs review
longwave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs backport to D7

#3 fixes the errors in uc_store for me too.

Damien Tournoud’s picture

Issue tags: -sqlite

+1 from me.

xjm’s picture

Added summary.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x and 7.x! Thanks!

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.