Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008612TestLinkDatabase Generalpublic2019-03-28 08:592019-04-01 12:23
Reporterc2pil 
Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Fixed in Version 
Summary0008612: Rights Database?? - Provide DDL rights to DB user created during TestLink Installation - needed by PLUGINS
DescriptionHello,

I made a plugin for my own utilization where I need to create some tables in the database.
My problem is the following :
When Testlink create a user account by default, it does not have the "structure rights" (CREATE, DROP, ALTER, etc.).
Would it be possible to fix it please ?

Thanks in advance,

Regards,

c2pil.
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL
Browser
PHP Version
TestCaseID
QA Team - Task Workflow StatusTBD
Attached Files

- Relationships

-  Notes
(0028631)
fman (administrator)
2019-03-29 12:29
edited on: 2019-03-29 12:35

I've re read and just now understood the requests, due to missing pieces.

Probably the author of the plugin module contribution does never tested a plugin that need to create tables as part of the plugin installation.

if you can provide the code of your plugin, then I will be able to test the installation process.

Meanwhile I suppose you have applied the simple workaround of changing DB grants in the db user you are using to access testlink db.

(0028634)
c2pil (reporter)
2019-04-01 12:23

Hello,

Here is a code example to create table in the database :
The code is in the class which implements TestlinkPlugin.

"public function init(){
        $table_1 = "CREATE TABLE IF NOT EXISTS tl_plugin_TemplateTestLink_table_1(
                               id int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
                          title varchar(250) NOT NULL,
                          date date NOT NULL,
                                  text varchar(4000),
                                  bool tinyint(1) DEFAULT '0')
                                  DEFAULT CHARSET=utf8;" ;
        
        $table_2 = "CREATE TABLE IF NOT EXISTS tl_plugin_TemplateTestLink_table_2(
                                  id int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
                          table_1_id int(10) unsigned NOT NULL,
                              CONSTRAINT FOREIGN KEY (table_1_id) REFERENCES tl_plugin_TemplateTestLink_table_1 (id),
                          project_id int(10) unsigned NOT NULL,
                              CONSTRAINT FOREIGN KEY (project_id) REFERENCES testprojects (id),
                          status int(1) unsigned)
                                  DEFAULT CHARSET=utf8;" ;
        
        $this->db->exec_query($table_1);
        $this->db->exec_query($table_2);
}"

And yes, for the moment I can create these tables automatically by changing my user rights in the database.

- Issue History
Date Modified Username Field Change
2019-03-28 08:59 c2pil New Issue
2019-03-29 12:29 fman Note Added: 0028631
2019-03-29 12:30 fman Note Edited: 0028631 View Revisions
2019-03-29 12:35 fman Note Edited: 0028631 View Revisions
2019-03-29 12:36 fman QA Team - Task Workflow Status => TBD
2019-03-29 12:36 fman Summary Rights Database => Rights Database?? - Provide DDL rights to DB user created during TestLink Installation - needed by PLUGINS
2019-04-01 12:23 c2pil Note Added: 0028634



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker