Page 1 of 1

bug found in file upload

Posted: 01 Feb 2016, 05:43
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.

Re: bug found in file upload

Posted: 01 Feb 2016, 07:55
by atrol
Have you set mode STRICT_ALL_TABLES in MySQL?

Re: bug found in file upload

Posted: 01 Feb 2016, 08:45
by AlexeiK
sorry.
its about ms sql 2008 r2 installation.

Re: bug found in file upload

Posted: 01 Feb 2016, 10:06
by atrol
I asked as this might be the same issue https://www.mantisbt.org/bugs/view.php?id=20547

Re: bug found in file upload

Posted: 01 Feb 2016, 10:52
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.

Re: bug found in file upload

Posted: 01 Feb 2016, 11:04
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.

Re: bug found in file upload

Posted: 01 Feb 2016, 21:28
by atrol
Sorry, I can't provide help for SQL Server issues.

Re: bug found in file upload

Posted: 02 Feb 2016, 05:41
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.

Re: bug found in file upload

Posted: 02 Feb 2016, 07:05
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.

Re: bug found in file upload

Posted: 02 Feb 2016, 12:16
by AlexeiK
u r right.
this is it.

Re: bug found in file upload

Posted: 13 Jun 2016, 09:36
by millahjovich
Have you set mode STRICT_ALL_TABLES in MySQL?