bug found in file upload

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
AlexeiK
Posts: 31
Joined: 11 Jan 2016, 10:29

bug found in file upload

Post by AlexeiK »

1.3.0-rc.2-dev master-9d8d010
place- file upload in comments.
it cant upload because field Content in table bug_file_table now allowed null.
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: bug found in file upload

Post by atrol »

Have you set mode STRICT_ALL_TABLES in MySQL?
Please use Search before posting and read the Manual
AlexeiK
Posts: 31
Joined: 11 Jan 2016, 10:29

Re: bug found in file upload

Post by AlexeiK »

sorry.
its about ms sql 2008 r2 installation.
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: bug found in file upload

Post by atrol »

I asked as this might be the same issue https://www.mantisbt.org/bugs/view.php?id=20547
Please use Search before posting and read the Manual
AlexeiK
Posts: 31
Joined: 11 Jan 2016, 10:29

Re: bug found in file upload

Post by AlexeiK »

APPLICATION ERROR #401
error recieved - #515: SQLState: 23000
Error Code: 515
Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cannot insert the value NULL into column 'content', table 'mantisdb.dbo.mantis_bug_file_table'; column does not allow nulls. INSERT fails.
SQLState: 01000
Error Code: 3621
Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]The statement has been terminated.
, query: INSERT INTO mantis_bug_file_table ( bug_id, title, description, diskfile, filename, folder,
filesize, file_type, date_added, user_id )
VALUES
( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ).



for attachments i use option DISK.
$g_file_upload_method = DISK;
this is it.
i have generated this error by setting content = not null.
To make it works i set content allow null.
AlexeiK
Posts: 31
Joined: 11 Jan 2016, 10:29

Re: bug found in file upload

Post by AlexeiK »

APPLICATION ERROR #401
Запрос к базе данных не удался. Получена ошибка - #515: SQLState: 23000
Error Code: 515
Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cannot insert the value NULL into column 'content', table 'mantisdb.dbo.mantis_bug_file_table'; column does not allow nulls. INSERT fails.
SQLState: 01000
Error Code: 3621
Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]The statement has been terminated.
, запрос: INSERT INTO mantis_bug_file_table ( bug_id, title, description, diskfile, filename, folder,
filesize, file_type, date_added, user_id )
VALUES
( 9192, '', '', '90edf77af97b41c307368a0633b61ef4', 'desktop.ini', 'I:\inetpub\wwwroot\mantis\mantis.attach\', 178, 'application/octet-stream', 1454324637, 4 ).

Column @Content@ is not used in SQL query, but in table has NOT NULL.

more detailed.
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: bug found in file upload

Post by atrol »

Sorry, I can't provide help for SQL Server issues.
Please use Search before posting and read the Manual
AlexeiK
Posts: 31
Joined: 11 Jan 2016, 10:29

Re: bug found in file upload

Post by AlexeiK »

its not about SQL SERVER USERS. its about constraint and $g_file_upload_method=DISK

bug_file_table has constaint on Content field=(NOT NULL)
mantis generate dynamic sql where is no Content field.

Code: Select all

 INSERT INTO mantis_bug_file_table ( bug_id, title, description, diskfile, filename, folder,
filesize, file_type, date_added, user_id )
so?
SQL SERVER doesnt allow to insert row where is no value for Content field.

Code: Select all

Cannot insert the value NULL into column 'content', table 'mantisdb.dbo.mantis_bug_file_table'; column does not allow nulls
that is it.

workaround :
drop constraint on Content field. i did that and its ok now.
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: bug found in file upload

Post by atrol »

AlexeiK wrote:its not about SQL SERVER USERS.
That's why I wrote
atrol wrote:I asked as this might be the same issue https://www.mantisbt.org/bugs/view.php?id=20547
The proposed fix for it might also fix your issue.
Please use Search before posting and read the Manual
AlexeiK
Posts: 31
Joined: 11 Jan 2016, 10:29

Re: bug found in file upload

Post by AlexeiK »

u r right.
this is it.
millahjovich
Posts: 2
Joined: 13 Jun 2016, 08:09

Re: bug found in file upload

Post by millahjovich »

Have you set mode STRICT_ALL_TABLES in MySQL?
Post Reply