Yitzchok / subsonicproject

Automatically exported from code.google.com/p/subsonicproject
0 stars 0 forks source link

MySQL Deleted / IsDeleted #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. MySQL 5
2. DB.Delete<ObjectType>(MyObject)
3.

What is the expected output? What do you see instead?
I expect the Deleted or IsDeleted (both fail) flags to be set to true (1) 
in the database.  Also, should these records be filtered out 
automatically, or do I need to manually add the exclusion to every 
subsequent query?

What version of the product are you using? On what operating system?
2.1 on Windows XP

Please provide any additional information below.

Server Error in '/' Application.
---------------------------------------------------------------------------
-----

Incorrect integer value: 'True' for column 'IsDeleted' at row 1 
Description: An unhandled exception occurred during the execution of the 
current web request. Please review the stack trace for more information 
about the error and where it originated in the code. 

Exception Details: SubSonic.SqlQueryException: Incorrect integer 
value: 'True' for column 'IsDeleted' at row 1

Source Error: 

Line 116:        {
Line 117:            
Line 118:            Repository.Delete<T>(item);
Line 119:        }
Line 120:        

Source File: e:\Web\tectonic\App_Code\DAL\AllStructs.cs    Line: 118 

Stack Trace: 

[SqlQueryException: Incorrect integer value: 'True' for column 'IsDeleted' 
at row 1]
   SubSonic.Update.Execute() +324
   SubSonic.SubSonicRepository.Delete(String columnName, Object 
columnValue) +338
   SubSonic.SubSonicRepository.Delete(RepositoryRecord`1 item) +89
   Tectonic.DAL.DB.Delete(RepositoryRecord`1 item) in 
e:\Web\tectonic\App_Code\DAL\AllStructs.cs:118
   _Admin_WebpageEdit.btnSave_Click(Object sender, EventArgs e) in 
e:\Web\tectonic\_Admin\WebpageEdit.aspx.cs:54
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String 
eventArgument) +110

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaiseP
ostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler 
sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean 
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Original issue reported on code.google.com by sweep...@gmail.com on 16 Mar 2009 at 6:11

GoogleCodeExporter commented 9 years ago
Could this have something to do with "bool" value types in MySQL being stored as
TinyInt(1).  When DB.Delete<ObjectType>(MyObject) is called, is it setting the
parameter type to Integer, then attempting to pass it a boolean?

Original comment by sweep...@gmail.com on 16 Mar 2009 at 1:32

GoogleCodeExporter commented 9 years ago
Fixed with revision 510

Original comment by robcon...@gmail.com on 9 Apr 2009 at 3:20