oibo8x / subsonicproject

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

SubSonic 2.1 : 'MySQL contributions' ( Migration of formum post ) #79

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
this is a migration post of
http://forums.subsonicproject.com/forums/t/4324.aspx
=============================================
Posted by cdmdotnet on Saturday, April 18, 2009
=============================================
This may be a misguided post, but I've put a small amount of time into
getting a few things enhanced for the MySQL provider. Specifically I've:

    * added support to translate the MySQL ENUM  data type into a .net ENUM
data type instead of a string
    * added support to translate both MySQL char( 36 ) and MySQL binary( 16
) data types into .net Guids
    * corrected an issue in the MySQL .net connector to compensate for
spaces when parsing the body of an SP, IE if you have an SP parameter
defined as CHAR( 36 ), the connector will not recognise this as a length
and also not add any subsequent parameters when reading it's schemea.

Also I've changed the schemea chosen of using zero as the value of data
types when specifiying SubSonic not use nullable data types. as most people
will use zero to have a meaningful value, using it to represent null seemed
very odd. I've changed my code to use dataType.MinValue as this seems to
make a lot more sense ( very unlikely that this value will be meaningful
and certainly more likely to be less meaningful then zero ).

My questions are

   1. Is anyone else interersted in a copy of this
   2. Is it worth ( and if so how do I ) contribute this back into the
project code?

=============================================
Posted by spookytooth on Sunday, April 19, 2009
=============================================

I am! Can you pin it to an issue at our project site:

http://code.google.com/p/subsonicproject/

Appreciate it!

=============================================
 Posted by cdmdotnet on Thursday, April 23, 2009
=============================================
Not a problem. I've only made the code changes to the generators for c# and
will put some time into getting the VB generators to have the same updates

Also I noticed the views didn't generate non-nullable propertiesIE would
add Guid? instead of Guid and int? instead of int without paying attention
to the parameter specified in the config files.

Again I've only made this change to the c# generator and will add it to my
list of VB generator changes
=============================================

So I'll be getting what I've done thus far into a zip file and uploaded
here so it can be inspected.

Original issue reported on code.google.com by cdmdotn...@gmail.com on 28 Apr 2009 at 8:44

GoogleCodeExporter commented 9 years ago
Firstly I shouldn't have listed this as a defect... my mistake. 
should i in some way checkout the code , copy my changes and check in the 
changes for
review into a different branch ?

Original comment by cdmdotn...@gmail.com on 28 Apr 2009 at 8:52

GoogleCodeExporter commented 9 years ago
I could also be very wrong but... the function wrapper for mysql doesn't add the
"ParameterDirection.ReturnValue" to returnvalue parameters and can sometimes 
ends up
sending the parameter which the mysql function isn't expecting.

I've added this fix into my code changes as well.

Original comment by cdmdotn...@gmail.com on 29 Apr 2009 at 9:03

GoogleCodeExporter commented 9 years ago
Here are the patches, which are good for C# as i've not made the changes to the
generators for VB.NET

Original comment by cdmdotn...@gmail.com on 1 May 2009 at 5:36

Attachments:

GoogleCodeExporter commented 9 years ago
small correction
Utility.cs in the SubSonic project has a missing line at 846
it's currently 

default:

but needs to be

default:
return 0;

( two lines )

Original comment by cdmdotn...@gmail.com on 1 May 2009 at 9:33

GoogleCodeExporter commented 9 years ago
This newer patch is now fixed to work with SubSonic 2.2.
Also if you use the MySQL 6.0.3 connector you don't need the MySQL 5.1.4 patch 
as
they fixed the Tolkenizer

Original comment by cdmdotn...@gmail.com on 2 May 2009 at 3:04

Attachments: