For problems and solutions related to database compatibility.

Is there a Drupal version of mysql_data_seek() function?

Is there a Drupal's database version of mysql_data_seek() function? I'd like to use Drupal version of mysql_data_seek function as to maintain future compatibility.

Let me know, Thanks

Some suggestions for database portability guidelines

Almost every table definition I've evaluated so far could be rewritten into portable code. That is, most MySQLisms I have come across are pointless and outdated - and could easily be avoided, making Drupal a much more cross-database solution than it currently is. That is, we should develop some essential database coding guidelines!

The boringly obvious point is of course to use standard SQL statements only - the MySQL and PostgreSQL documentation usually state whether a statement is compatible to standard SQL. As many people will rarely look up whether the statements they have been using for years are deprecated, here are a couple of recommendations to start with:

  • do not copy&paste your table definitions from a dump, or you will end up with the particular backends' database specific view of your design, often with some obsoleted indices and columns from discarded design stages thrown in. Design is a result of planning and consideration, not a snapshot from a trial-and-error process. Rethink, reorder and rewrite your code to be concise, logical and generic...
  • use standard generic data types, that is, integer rather than int(x). And choose text over varchar(y) unless you have very good reasons to use the latter
  • don't force table types - "MyISAM" won't only annoy people using other databases, but also the InnoDB users...
  • " and ` are not ' - portable SQL string literals are in single quotes (') only.

Problem with table aliases and join order in mysql5 and node acces modules

Apparently there are some problems with the join order and table aliases in certain situations.

http://drupal.org/node/40623

Which is discussed more in:

http://drupal.org/node/43735

Anyone have any ideas on these?

I don't mean to be crossposting - but that topic seems like it might be better discussed here than there.

Greg

Beware of 'boolean' on postgresql

I just had some fun w/ debugging the hell out then realizing that boolean fields have values f and t and both of them is treated as TRUE by PHP. Do not use boolean fields with Drupal (well, I might say with PHP) or you'll need to convert all the time. Related bug in PEAR: http://pear.php.net/bugs/bug.php?id=4535 so I am not alone. The fact that PHP manual states this does not help too much -- all I saw were stuck checkboxes.

MySQL current script issues

Hello, I have some suggestions how to improve MySQL script.

1) I suggest to rename all fields named 'timestamp', beacouse TIMESTAMP is MySQL data type. I had already several problems with this.

2) Add FOREIGN KEY constraints. This would:
a) greatly improve readability of database script
b) enables to reverse engineer and visualize the script properly with all bindings
c) db model will be prepared for future, when somebody decides to make use of foreign keys

Pages

Subscribe with RSS Subscribe to RSS - Deprecated - Database compatibility