Re: [Modeling-users] MySQL TEXT
Status: Abandoned
Brought to you by:
sbigaret
|
From: Sebastien B. <sbi...@us...> - 2003-05-31 12:42:08
|
Three months ago Yannick, then Soaf requested support for TEXT
sql-datatypes in mysql. A patch was posted for mysql but I got no
report.
I think this should be added to the main trunk (for both mysql and
postgresql). Are some of you using this on a regular basis and can confirm
that it's ok?
-- S=E9bastien.
Sebastien Bigaret <sbi...@us...> wrote:
> Hi,
>=20
> Yannick Gingras <yan...@sa...> wrote:
> > the user guide section 2.2.4 talk about CHAR and VARCHAR external type
> > support but there is no mention about the support for TEXT. I have
> > really strange errors when using TEXT.
> >=20
> > File "<stdin>", line 92, in insertElement
> > File "/usr/lib/python2.2/site-packages/Modeling/EditingContext.py", l=
ine=20
> > 678, in saveChanges
> > self.parentObjectStore().saveChangesInEditingContext(self)
> > File "/usr/lib/python2.2/site-packages/Modeling/ObjectStoreCoordinato=
r.py",=20
> > line 559, in saveChangesInEditingContext
> > raise RuntimeError, _error
> > RuntimeError: performChanges() failed on=20
> > <Modeling.DatabaseContext.DatabaseContext instance at 0x88dd2ec>:=20
> > exceptions.ValueError:Unknown value type: None for externalType: text=20
> > (attribute: JOBI18N.description)
> >=20
> > Is it possible I am positively certain that my default value is not
> > None and that I did put a value in JOBI18N.description before insert.
> >=20
> > Anyone have a clue about the cause ?
>=20
> Yes, this is because TEXT is an unknown sql type for the MySQLAdaptor.
> Didn't the validation of the model indicate it ?-)
>=20
> (I agree the message is not very informative, I added bug #699046)
>=20
> It is raised by SQLExpression.formatValueForAttribute(), which got an
> 'None' type from valueTypeForExternalType().
>=20
> If TEXT is a valid mysql format mapped to a python string, then modify
> MySQLSQLExpression.valueTypeForExternalTypeMapping() in
> DatabaseAdaptors.MySQLAdaptorLayer:
>=20
> diff -c -r1.2 MySQLSQLExpression.py
> *** MySQLSQLExpression.py 1 Feb 2003 11:59:13 -0000 1.2
> --- MySQLSQLExpression.py 6 Mar 2003 22:18:13 -0000
> ***************
> *** 77,81 ****
> """
> values=3DSQLExpression.valueTypeForExternalTypeMapping.im_func(self)
> del values['timestamp']
> ! values.update({ 'datetime': DateType })
> return values
> --- 77,82 ----
> """
> values=3DSQLExpression.valueTypeForExternalTypeMapping.im_func(self)
> del values['timestamp']
> ! values.update({ 'datetime': DateType,
> ! 'text': CharacterType })
> return values
>=20
>=20
> (SQL types should be lower-cased)
>=20
>=20=20=20
> This should work ; please report and I'll apply the patch when you
> confirm that this is ok.
>=20
> Regards,
>=20
>=20
> -- S=E9bastien.
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of TotalView, The debugg=
er=20
> for complex code. Debugging C/C++ programs can leave you feeling lost and=
=20
> disoriented. TotalView can help you find your way. Available on major UNI=
X=20
> and Linux platforms. Try it free. www.etnus.com
> _______________________________________________
> Modeling-users mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modeling-users
|