Download & Extend

DESCRIBE query doesn't work with table prefixes

Project:CCK Create Install
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi,

I'm testing out this module as it might possibly be interesting.

However during my tests, the content_type_XXX table couldn't be created, since the table fields where not added in the create statement.
Some debugging pointed out this was because the 'DESCRIBE ' query didn't work:

Original code:

<?php
$result
= db_query("DESCRIBE {$table_name}");
?>

The brackets there are evaluated by PHP, where they should be literally there to allow table prefixing.
Updated the code to the following, which seems to work:

<?php
$result
= db_query("DESCRIBE {".$table_name."}");
?>

Attached is a patch for this change.

Kind regards,

Sven

AttachmentSize
cck_create_install.module.patch766 bytes

Comments

#1

Status:needs review» fixed

Thanks for the patch, I have applied your patch and commited to CVS. I will likely be making some changes in the near future adding create uninstall option and possibly updates, so I haven't created a new release yet. You patch has been applied though. Thanks!

This is the first time I have received a patch instead of just a complaint so - thank you thank you thank you!

#2

Status:fixed» closed (fixed)

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

nobody click here