Author Topic: mysql varchar length  (Read 9820 times)

Sue

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
mysql varchar length
« on: February 19, 2008, 08:19:28 am »
I am creating a MySQL data model in EA version 6.5 build 805 and keep getting an error message complaining the maximum length for varchar can not exceed 255 characters.  Based on the EA release notes, this problem should already be fixed in build 801.  Any ideas why I am still seeing the error in build 805?

Thanks,
Sue

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: mysql varchar length
« Reply #1 on: February 19, 2008, 09:01:27 am »
Hi Sue,

[I'm guessing here, but...]
Perhaps your reference data is still behind the times, and is using pre-801 information. This can happen if you patched an earlier build rather than doing a complete installation. Your EABase project would still have older reference data.

I think you might be able to find an EABase model on the Sparx site. Failing that perhaps a recent example model would do. If either file has current reference data you could be fine. [Assuming I'm right, of course.] Try extracting the appropriate reference data types - I think they are evident enough - from the new file. Then import these into a test copy of your project file.

If the problem goes away, use the new EABase file (if you were able to find one) or import the new reference data into your EABase project.

HTH, David
No, you can't have it!

Sue

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: mysql varchar length
« Reply #2 on: February 19, 2008, 09:37:00 am »
Hi David,

I actually uninstalled the earlier version (6.1) before reinstall version 6.5.    Regarding a recent example model, would the file EAExample.eap under the install directory C:\Program Files\Sparx Systems\EA be considered one?  I tried open this project and exported all reference data types into a file and imported this file back into my project.  I still have the same problem.  

There is also a file called EABase.eap under the same install directory as EAExample.eap.  Are you saying this EABase.eap file is from the previous installations?

Thanks,
Sue

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: mysql varchar length
« Reply #3 on: February 19, 2008, 09:53:50 am »
You're on the right track there sue, but not quite there yet.

I was a bit vague in my wording. By "recent" I meant from a recent build of EA. I am trying to remember back to which build 6.5 started at, but just can't quite place it. Was that after build 801?

In any case, browse the Registered Users part of the Sparx site. See if you can find an EABase or an example project that has a more recent build than you've got. Try exporting the reference data from there.

The reason I think this might work, is that when I upgraded to EA 7 - or was it 6.5? - database support for SQL Server 2005 (with the XML data type) appeared. However I could not use it in projects I was already working on. Since the 'smarts' for the new database and type were in the reference data, I needed to perform an export-import cycle.

David

[EDIT: Now that I think about it... Are you working on projects you started before build 801? Even if they had no database components before now, the project files themselves would contain the (now) obsolete reference data. If this is the case, try starting a new project to see what happens.]
« Last Edit: February 19, 2008, 09:55:26 am by Midnight »
No, you can't have it!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: mysql varchar length
« Reply #4 on: February 19, 2008, 10:14:34 am »
Oops...

My aim was off a bit Sue. The files I mentioned are on the Corporate Resources page. Go to the Registered Users page - there might be similar entries outside of the registered section, but that's the route I tried - and click the Resources entry on the left-side menu. You'll find the files under Corporate Resources most of the way down the left-hand column of the resulting page.

David
No, you can't have it!

Sue

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: mysql varchar length
« Reply #5 on: February 20, 2008, 01:57:25 am »
David,

I downloaded both EAExample.eap and EABase.eap from the Corporate Resource page, but still have no luck.  Even if I create a new project and create a new MySQL table, I'd still have the same issue.  Looking at the About EA page, it says database version is 4.0.1 released on Jan-31-2004.  Maybe this is the cause.  Is there way to update the database version?

Thanks,
Sue

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: mysql varchar length
« Reply #6 on: February 20, 2008, 02:07:22 am »
Hi again Sue,

Perhaps we - our you and the EA release notes - are talking about two different things.

My impression is that you are trying to model a MySQL database. That database has a table with a varchar column, the maximum length of which should be > 255.

IIRC - and I did not reread the release notes - the problem that got addressed in build 801 may have related to the MySQL schema for EA project repositories; that schema may have had a text-type field that was limited to 255 characters, but should have been longer. Not your problem at all.

That's why I am pointing you at reference data. Database products and field definitions are stored there. Some - the products that are supported by EA 'out of the box' - are provided as part of the EABase project with each build. What I'm hoping is that the correct maximum length for MySQL data fields is stored in a newer version of that data than you have.

BTW, have you made sure that 255 is not a limit in MySQL - at least in some version? I don't use MySQL anymore, and it's been years since I last looked at it. Surely somebody must have tripped over this in the past if EA simply has the incorrect maximum field length.

As to the 4.01 version, this refers (AFAIK) to the version of the EAP structure that EA uses, which has not changed much since EA 4.0 came out.

David
No, you can't have it!

Sue

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: mysql varchar length
« Reply #7 on: February 20, 2008, 02:19:38 am »
David,

Prior to MySQL 5.0.3, the maximum length of varchar is 255, but after MySQL 5.0.3, the max is now 65535.  I had thought this is what the release note meant to address.  

Thanks,
Sue


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: mysql varchar length
« Reply #8 on: February 20, 2008, 04:06:35 am »
Sue,

Well, that certainly explains your problem. I checked the current build (825) with a new EABase project, and the settings for all MySQL character types are max 255.

But all is not lost, I least I don't think so.

First, please send a bug report or feature request to Sparx. They need to address this since MySQL 5.x is a reality.

I suspect this can be easily solved by creating a new database 'product' entry and changing the maximum length of the appropriate character datatypes. That seems to be how Sparx handled the difference between SQL Server 2000 and 2005.

The same method should work for you. Essentially what you need to do is use the Add Product button on the Settings | Database Datatypes dialog to create a MySQL 5 (or whatever) product. Then you need to add the field types from the current MySQL product. When you add the character types change the maximum length to the correct value.

There does not seem to be a (convenient) 'clone' capability. My guess is that you could export the MySQL reference data and edit the XML file to create your new product. Perform this on a copy of your project in case things go wrong. In particular, if there are any GUID values in the XML file you probably want to generate new GUIDs (via some utility) and substitute those. This could be done via a quick program of some sort.

Otherwise just do the entire list by hand. It will take a while, and somebody else should proof your work in case of typos. But it is only work, the 'pain' will fade.

David

PS: You can then create a data type mapping via the same dialog. This will let you transfer your models to your new product. Follow the directions in EA Help. At least this part should be quite easy.
« Last Edit: February 20, 2008, 04:08:12 am by Midnight »
No, you can't have it!