Projects ⇒ Bugs ⇒ #392: Case sensitivity in Tables ⇒ CPG Dragonfly™ CMS
Bug #392 Case sensitivity in Tables
Project: Dragonfly 9.0 -> 9.0.2 Category: Surveys
Submitted: Tuesday, April 05, 2005 (03:16:39) Modified: Friday, September 29, 2006 (11:32:30)
Status: Bogus Assigned to:
PHP Version: Irrelevant HTTPD Server: Apache 2.0
Votes: 2
Vote results:
Avg. Score: 4.0 ± 1.0 Reproduced: 1 of 1 (100.0%)
Same PHP Version: 0 (0.0%) Same HTTPD Server: 0 (0.0%)

View/Vote Add Comment

by: Brennor
Description:
------------
The SQL standard doesn't specifically say anything about case sensitivity of column names. MySQL by default allows it. Most others by default turn off case sensitivity.

Only in 4 tables in the entire package are the column names mixed case. In all other tables, the column names are lowercase.

In the Surveys module, the 4 tables are poll_check (with pollID), poll_data (with pollID, optionText, optionCount, voteID), poll_desc (with pollID, pollTitle, timeStamp), and pollcomments (with pollID).

As the tables are designed, they do not work in PostgreSQL. There should probably be some form of consistency across all tables too.

Suggest changing pollID to poll_id, optionText to option_text, optionCount to option_count, voteID to vote_id, pollTitle to poll_title, timeStamp to time_stamp (timestamp will conflict with a reserved word).

I'll edit an add a list of lines I've changed shortly (it is alot).
by: Brennor
Not all lines below have to change for Postgres integration, but keeping similarity between the fields in the tables and the PHP variables seems like a good idea.

Convert pollID to poll_id:

/html/admin/modules/comments.php (rev 9.4): lines 58, 59, 60, 62
/html/admin/modules/index.php (rev 9.16): lines 116, 119
/html/blocks/block-Survey.php (rev 9.5): lines 27, 31, 38, 39, 109, 115, 118
/html/install/mysql/new/news.inc (rev 9.2): line 91
/html/install/mysql/new/surveys.inc (rev 9.3): lines 21, 24, 30, 37, 42, 54
/html/install/mysql/upgrade/news.inc (rev 9.1): line 140
/html/install/mysql/upgrade/surveys.inc (rev 9.1): lines 21, 25, 32, 42, 50, 73, 74, 75, 76, 77, 78
/html/modules/News/admin/index.inc (rev 9.10): lines 69, 77, 227, 229, 230
/html/modules/News/article.php (rev 9.3): lines 129, 131, 132, 133, 137, 144, 147
/html/modules/Surveys/admin/index.inc (rev 9.3): lines 24, 26, 33, 47, 48, 68, 71, 72, 80, 83, 84, 90, 93
/html/modules/Surveys/comments.php (rev 9.9): lines 32, 36, 41, 58, 60, 76, 77, 101, 103 (change $pollid to $poll_id for this line only), 121, 127, 175, 177, 178, 204, 207, 210, 234, 244, 264, 272, 276, 287, 332, 334, 335, 364, 367, 370, 393, 401, 404, 422, 426, 430, 450, 456, 467, 481, 484, 495, 498, 514, 516, 520, 555
/html/modules/Surveys/cpg_inst.php (rev 9.4): lines 43, 45, 50, 57, 58, 62, 75
/html/modules/Surveys/index.php (rev 9.4): lines 30, 39 (change $pollId to $poll_id for this line only), 48, 59, 67, 70, 71, 72, 76, 81, 88, 92, 97, 99, 102, 107, 112, 121, 124, 128, 143, 145, 147, 148, 149, 154, 161, 164, 174, 175, 178, 180, 181, 184, 188, 265, 267
/html/modules/Top/index.php (rev 9.5): lines 152, 160
by: Brennor
Not all lines below have to change for Postgres integration, but keeping similarity between the fields in the tables and the PHP variables seems like a good idea.

Convert optionText to option_text:

/html/blocks/block-Survey.php (rev 9.5): lines 39, 84, 104, 105
/html/install/mysql/new/surveys.inc (rev 9.3): line 25
/html/install/mysql/upgrade/surveys.inc (rev 9.1): line 26
/html/modules/News/admin/functions.inc (rev 9.7): lines 103, 112
/html/modules/News/admin/index.inc (rev 9.10): lines 53, 61, 66, 67, 68, 69, 146
/html/modules/News/article.php (rev 9.3): lines 137, 139
/html/modules/Surveys/admin/index.inc (rev 9.3): lines 26, 33, 93, 94, 95
/html/modules/Surveys/cpg_inst.php (rev 9.4): line 46
/html/modules/Surveys/index.php (rev 9.4): lines 154, 156, 188, 189, 190
by: Brennor
Not all lines below have to change for Postgres integration, but keeping similarity between the fields in the tables and the PHP variables seems like a good idea.

Convert optionCount to option_count:

/html/blocks/block-Survey.php (rev 9.5): lines 39, 43, 55, 107
/html/install/mysql/new/surveys.inc (rev 9.3): line 26
/html/install/mysql/upgrade/surveys.inc (rev 9.1): line 27
/html/modules/News/admin/index.inc (rev 9.10): line 69
/html/modules/News/article.php (rev 9.3): lines 137, 140
/html/modules/Surveys/admin/index.inc (rev 9.3): lines 33, 93, 94, 95
/html/modules/Surveys/cpg_inst.php (rev 9.4): line 47
/html/modules/Surveys/index.php (rev 9.4): lines 71, 154, 157, 184, 188, 189, 193, 256
/html/modules/Top/index.php (rev 9.5): line 151
by: Brennor
Not all lines below have to change for Postgres integration, but keeping similarity between the fields in the tables and the PHP variables seems like a good idea.

Convert voteID to vote_id:

/html/blocks/block-Survey.php (rev 9.5): lines 39, 104, 105
/html/install/mysql/new/surveys.inc (rev 9.3): line 27
/html/install/mysql/upgrade/surveys.inc (rev 9.1): line 28
/html/modules/News/admins/index.inc (rev 9.10): line 69
/html/modules/News/article.php (rev 9.3): lines 137, 139
/html/modules/Surveys/admin/index.inc (rev 9.3): lines 26, 33, 93, 94, 95, 96
/html/modules/Surveys/cpg_inst.php (rev 9.4): line 48
/html/modules/Surveys/index.php (rev 9.4): lines 64, 71, 154, 156, 188
by: Brennor
Not all lines below have to change for Postgres integration, but keeping similarity between the fields in the tables and the PHP variables seems like a good idea.

Convert pollTitle to poll_title:

/html/admin/modules/index.php (rev 9.16): lines 116, 118
/html/blocks/block-Survey.php (rev 9.5): lines 27, 31, 32
/html/install/mysql/new/surveys.inc (rev 9.3): line 31
/html/install/mysql/upgrade/surveys.inc (rev 9.1): line 33
/html/modules/News/admin/functions.inc (rev 9.7): lines 103, 108
/html/modules/News/admin/index.inc (rev 9.10): lines 52, 61, 64, 146
/html/modules/News/article.php (rev 9.3): lines 133, 134
/html/modules/Surveys/admin/index.inc (rev 9.3): lines 24, 68, 71, 72, 80, 84, 90, 92
/html/modules/Surveys/comments.php (rev 9.9): line 467
/html/modules/Surveys/cpg_inst.php (rev 9.4): line 51
/html/modules/Surveys/index.php (rev 9.4): lines 30, 39, 112, 149, 151, 181
by: Brennor
Not all lines below have to change for Postgres integration, but keeping similarity between the fields in the tables and the PHP variables seems like a good idea.

Convert timeStamp to time_stamp:

/html/install/mysql/new/surveys.inc (rev 9.3): line 32
/html/install/mysql/upgrade/surveys.inc (rev 9.1): line 34
/html/modules/News/admin/index.inc (rev 9.10): lines 63, 64
/html/modules/Surveys/admin/index.inc (rev 9.3): lines 68, 80
/html/modules/Surveys/cpg_inst.php (rev 9.4): line 52
/html/modules/Surveys/index.php (rev 9.4): lines 30, 39, 112
by: Brennor
Ooops. Missed one.

Convert pollTitle to poll_title:

/html/modules/Top/index.php (rev 9.5): line 160

-----

That's all of those that show up in 9.0.1.1
by: Brennor
By that last statement referencing 9.0.1.1, I mean that I grepped against 9.0.1.1 and then checked out the CVS repository for the current state of the files.

There was only one file missing in my previous listings. It used to reside at html/admin/modules/submissions.php in 9.0.1.1, and now it looks like it resides in html/modules/News/admin/submissions.inc...

I'll parse that one out and put those changes into the next message.
by: Brennor
Not all lines below have to change for Postgres integration, but keeping similarity between the fields in the tables and the PHP variables seems like a good idea.

Convert pollID to poll_id:

/html/modules/News/admin/submissions.inc (rev 9.6): lines 205, 207, 212, 213

Convert optionText to option_text:

/html/modules/News/admin/submissions.inc (rev 9.6): lines 165, 197, 198, 204, 205, 206, 207

Convert optionCount to option_count:

/html/modules/News/admin/submissions.inc (rev 9.6): lines 207

Convert voteID to vote_id:

/html/modules/News/admin/submissions.inc (rev 9.6): lines 205, 207

Convert pollTitle to poll_title:

/html/modules/News/admin/submissions.inc (rev 9.6): lines 165, 196, 198, 200, 202

Convert timeStamp to time_stamp:

/html/modules/News/admin/submissions.inc (rev 9.6): lines 200, 201, 202
by: NanoCaiordo
Thank you for taking the time to report a problem with Dragonfly 9.0 -> 9.0.2.
Unfortunately you are not using a current version of Dragonfly 9.0 -> 9.0.2 --
the problem might already be fixed. Please download a new version of Dragonfly 9.0 -> 9.0.2 from the
Downloads section.

If you are able to reproduce the bug with one of the latest
versions of Dragonfly 9.0 -> 9.0.2, please change the Dragonfly 9.0 -> 9.0.2 version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of Dragonfly 9.0 -> 9.0.2.
User Info

Welcome Anonymous



(Register)
Community

Support for DragonflyCMS in a other languages:

Deutsch
Español