PDA

View Full Version : Fix for No Temporary Table Permissions in Snapshot 2.0.1


profounded
08-06-05, 06:44 AM
Hey, because of the change in forums and update to dotProject, the other post does not help too much for new users. Here is an updated version thanks to all those who figured out the solution:

Apply this SQL to your db -

CREATE TABLE `tasks_problems` (
`task_project` VARCHAR( 10 ) default NULL ,
`task_log_problem` TINYINT(1) default NULL
) TYPE=MyISAM;

CREATE TABLE `tasks_critical` (
`task_project` VARCHAR( 10 ) default NULL ,
`critical_task` INT( 11 ) default NULL ,
`project_actual_end_date` DATETIME default NULL
) TYPE=MyISAM;


CREATE TABLE `tasks_sum` (
`task_project` VARCHAR( 10 ) default NULL ,
`total_tasks` INT( 6 ) default NULL ,
`project_percent_complete` VARCHAR( 11 ) default NULL
) TYPE=MyISAM;

CREATE TABLE `tasks_summy` (
`my_tasks` varchar(10) default NULL,
`task_project` varchar(10) default NULL
) TYPE=MyISAM;


THEN
For file /modules/projects/index.php :

between line numbers 60-80 (67 for my version i think)
Replace (or comment out):

$q->dropTemp('tasks_sum, tasks_summy, tasks_critical, tasks_problems');
$q->exec();
$q->clear();

with:
//$q->dropTemp('tasks_sum, tasks_summy, tasks_critical, tasks_problems');
//$q->exec();
//$q->clear();
do not comment out:
$q = new DBQuery;

then right above those lines,
insert this:

$sql = "TRUNCATE TABLE tasks_sum";
db_exec($sql);
$sql = "TRUNCATE TABLE tasks_summy";
db_exec($sql);
$sql = "TRUNCATE TABLE tasks_critical";
db_exec($sql);
$sql = "TRUNCATE TABLE tasks_problems";
db_exec($sql);

save and upload and you should be good! I wish ya luck!

augustorosa
08-07-05, 10:39 AM
What is that for?
How do I know if I need this fix?
I've just installed 2.01 and trying the software.

tks, Augusto

profounded
08-07-05, 02:40 PM
THis is if you dont have permissions to make temporary tables. It only applies with some webhosts.

-Bryan

tetsu
28-07-05, 06:45 AM
Unfortunately this does not solve the problem. I have searched these forums for about an hour now and haven't been able to find a solution - anyone know how to fix this (without switching to a host that gives permission to create temporary tables :P )?

Cheers

pedroa
29-07-05, 12:07 AM
If these didn't work the other approach would be to emulate the temporary tables behavior.

What I mean is:

The Workflow of Temporary tables (as it is in dP):
1) Server creates a table in memory
2) Executes the data insertions
3) Deletes the table from memory

This solution:
1) Create static tables
2) Executes the data insertions
3) Deletes (truncates) the records on demand (the tables remain in db)

Emulation solution:
1) Create static tables
2) Executes the data insertions
3) Drop the tables (delete the tables from db)

Of course this is the slower solution, but it is another approach that could work if the 2nd didn't...

Pedro A.

jdstl1977
29-07-05, 09:45 AM
This Fix for Temporary Table Permissions doesn't work. I've called GoDaddy.com and they told me they do not allow Temporary Tables to be created.

Is there another work-around for this issue?

DcnCDrew
06-08-05, 10:02 AM
I have taken this info and modified the index.php file in the projects module folder and I was able to get this fix to work.

The forum software was messing up the code so here is a text file that you can cut and pate and replace it with and it works fine. :lol:

http://www.dc-nc.com/dotproject/index.php.txt

place this in

/modules/projects/

dougedmunds
06-09-05, 10:21 AM
The quoted change will work if you also make one more change:

in classes/query.class.php at about line 393
comment out this line:

$q = 'CREATE TEMPORARY TABLE ' . $this->_table_prefix . $this->create_table;

so it reads:

//$q = 'CREATE TEMPORARY TABLE ' . $this->_table_prefix . $this->create_table;


Hey, because of the change in forums and update to dotProject, the other post does not help too much for new users. Here is an updated version thanks to all those who figured out the solution:

Apply this SQL to your db -

CREATE TABLE `tasks_problems` (
`task_project` VARCHAR( 10 ) default NULL ,
`task_log_problem` TINYINT(1) default NULL
) TYPE=MyISAM;

CREATE TABLE `tasks_critical` (
`task_project` VARCHAR( 10 ) default NULL ,
`critical_task` INT( 11 ) default NULL ,
`project_actual_end_date` DATETIME default NULL
) TYPE=MyISAM;


CREATE TABLE `tasks_sum` (
`task_project` VARCHAR( 10 ) default NULL ,
`total_tasks` INT( 6 ) default NULL ,
`project_percent_complete` VARCHAR( 11 ) default NULL
) TYPE=MyISAM;

CREATE TABLE `tasks_summy` (
`my_tasks` varchar(10) default NULL,
`task_project` varchar(10) default NULL
) TYPE=MyISAM;


THEN
For file /modules/projects/index.php :

between line numbers 60-80 (67 for my version i think)
Replace (or comment out):

$q->dropTemp('tasks_sum, tasks_summy, tasks_critical, tasks_problems');
$q->exec();
$q->clear();

with:
//$q->dropTemp('tasks_sum, tasks_summy, tasks_critical, tasks_problems');
//$q->exec();
//$q->clear();
do not comment out:
$q = new DBQuery;

then right above those lines,
insert this:

$sql = "TRUNCATE TABLE tasks_sum";
db_exec($sql);
$sql = "TRUNCATE TABLE tasks_summy";
db_exec($sql);
$sql = "TRUNCATE TABLE tasks_critical";
db_exec($sql);
$sql = "TRUNCATE TABLE tasks_problems";
db_exec($sql);

save and upload and you should be good! I wish ya luck!

sparhawk
10-11-05, 01:38 AM
Just a minor info. I'm running apache locally on my machine and I gave my dotproject user all privileges and it still did not work. After applying the above fix it works now. I'm running MySQL 5.0.15 so it might be related to this. Since the above solution works it's fine for me.