Re: [fpc-devel] MySQL v4.0 v4.1 and v5.0
On 18 nov 2005, at 11:34, Joost van der Sluis wrote: Why is it impossible to have a mysql40connection, mysql41connection and mysql50connection in one application? In what way is this different from having mysqlconnection and ibconnection in one application? If we implement that, and sqldb is installed Laz --> mysql40conn (tmysql40conn) --> mysql40 (pmysql, mysql_init()) mysql41conn (tmysql41conn) --> mysql41 (pmysql, mysql_init()) mysql50conn (tmysql50conn) --> mysql50 (pmysql, mysql_init()) Lazarus uses the mysql40conn,mysql41conn and mysql50conn units, they all use a different mysql-unit, but all those units implement functions and procedures with the same name, but with other arguments. I'm not sure it the compiler will allow that? As long as you use fully qualified identifiers for all types, global variables, functions and procedures you use from those units, it shouldn't be a problem. If you don't use a fully qualified identifier, the one from the last unit in the uses clause which contains that identifier will be used. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] MySQL v4.0 v4.1 and v5.0
Op Fri, 18 Nov 2005, schreef Joost van der Sluis: > > >>For mysql connection I would prefer an component for each version so > > >>users have it clear from begining, and not need to change anything. > > > > > > The problem is that those different components coud not be installed at > > > the same time. > > > Why is it impossible to have a mysql40connection, mysql41connection and > > mysql50connection in one application? In what way is this different from > > having mysqlconnection and ibconnection in one application? > > If we implement that, and sqldb is installed > > Laz --> mysql40conn (tmysql40conn) --> mysql40 (pmysql, mysql_init()) > mysql41conn (tmysql41conn) --> mysql41 (pmysql, mysql_init()) > mysql50conn (tmysql50conn) --> mysql50 (pmysql, mysql_init()) > > Lazarus uses the mysql40conn,mysql41conn and mysql50conn units, they all > use a different mysql-unit, but all those units implement functions and > procedures with the same name, but with other arguments. > > I'm not sure it the compiler will allow that? Should not be a problem. Daniël___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] MySQL v4.0 v4.1 and v5.0
> >>For mysql connection I would prefer an component for each version so > >>users have it clear from begining, and not need to change anything. > > > > The problem is that those different components coud not be installed at > > the same time. > Why is it impossible to have a mysql40connection, mysql41connection and > mysql50connection in one application? In what way is this different from > having mysqlconnection and ibconnection in one application? If we implement that, and sqldb is installed Laz --> mysql40conn (tmysql40conn) --> mysql40 (pmysql, mysql_init()) mysql41conn (tmysql41conn) --> mysql41 (pmysql, mysql_init()) mysql50conn (tmysql50conn) --> mysql50 (pmysql, mysql_init()) Lazarus uses the mysql40conn,mysql41conn and mysql50conn units, they all use a different mysql-unit, but all those units implement functions and procedures with the same name, but with other arguments. I'm not sure it the compiler will allow that? -- Met vriendelijke groeten, Joost van der Sluis CNOC Informatiesystemen en Netwerken http://www.cnoc.nl ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] MySQL v4.0 v4.1 and v5.0
Joost van der Sluis wrote: For mysql connection I would prefer an component for each version so users have it clear from begining, and not need to change anything. The problem is that those different components coud not be installed at the same time. Why is it impossible to have a mysql40connection, mysql41connection and mysql50connection in one application? In what way is this different from having mysqlconnection and ibconnection in one application? Vincent. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] MySQL v4.0 v4.1 and v5.0
> > > Hi all, > > > > > > atm I have a nearly finished mysql.inc file that can be used with > > MySQL > > > v4.0 v4.1 and v5.0. Loaded dynamically and static. > > > > > > It uses several defines to set the right MySQL version and to > > turn the > > > dynamically linking on or off. > > > > > > Create 6 different units in packages/base/mysql - for each > > combination > > > one? (thus mysql40, mysql40dyn, mysql41, mysql41dyn, mysql50 and > > > mysql51dyn?) > > > > > > But then, what to do with the MySQL-connection for sqldb? In > > principle > > > the only thing that has to be changes to use another > > MySQL-version is to > > > change the used unit. So, always use the TMysqlConn-component, > > but > > > changes the usage-clausule. > > > > > > But how can this be handled by Lazarus? With the SQLDB-package > > only one > > > unit can be used. (Or else multiple types with the same name are > > > defined) Let the users manually change the usage-line if they > > want to > > > use a different MySQL-library-version? > > > > FOr the sqldb package, let them add a define to the compiler > > options: > > -dMYSQL40 > > or > > -dMYSQL41 > > or > > -dMYSQL50 > > > > That seems more user friendly than editing the uses clause. > > > > In the source, change the uses clause, depending on the defines. > For mysql connection I would prefer an component for each version so > users have it clear from begining, and not need to change anything. The problem is that those different components coud not be installed at the same time. -- Met vriendelijke groeten, Joost van der Sluis CNOC Informatiesystemen en Netwerken http://www.cnoc.nl ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] MySQL v4.0 v4.1 and v5.0
--- Vincent Snijders <[EMAIL PROTECTED]> escribió: > Joost van der Sluis wrote: > > Hi all, > > > > atm I have a nearly finished mysql.inc file that can be used with > MySQL > > v4.0 v4.1 and v5.0. Loaded dynamically and static. > > > > It uses several defines to set the right MySQL version and to > turn the > > dynamically linking on or off. > > > > Create 6 different units in packages/base/mysql - for each > combination > > one? (thus mysql40, mysql40dyn, mysql41, mysql41dyn, mysql50 and > > mysql51dyn?) > > > > But then, what to do with the MySQL-connection for sqldb? In > principle > > the only thing that has to be changes to use another > MySQL-version is to > > change the used unit. So, always use the TMysqlConn-component, > but > > changes the usage-clausule. > > > > But how can this be handled by Lazarus? With the SQLDB-package > only one > > unit can be used. (Or else multiple types with the same name are > > defined) Let the users manually change the usage-line if they > want to > > use a different MySQL-library-version? > > FOr the sqldb package, let them add a define to the compiler > options: > -dMYSQL40 > or > -dMYSQL41 > or > -dMYSQL50 > > That seems more user friendly than editing the uses clause. > > In the source, change the uses clause, depending on the defines. > > Vincent. For mysql connection I would prefer an component for each version so users have it clear from begining, and not need to change anything. Jesus Reyes A. ___ Do You Yahoo!? La mejor conexión a Internet y 2GB extra a tu correo por $100 al mes. http://net.yahoo.com.mx ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] MySQL v4.0 v4.1 and v5.0
On Thu, 17 Nov 2005, Vincent Snijders wrote: > Joost van der Sluis wrote: > > Hi all, > > > > atm I have a nearly finished mysql.inc file that can be used with MySQL > > v4.0 v4.1 and v5.0. Loaded dynamically and static. > > > > It uses several defines to set the right MySQL version and to turn the > > dynamically linking on or off. > > > > Create 6 different units in packages/base/mysql - for each combination > > one? (thus mysql40, mysql40dyn, mysql41, mysql41dyn, mysql50 and > > mysql51dyn?) > > > > But then, what to do with the MySQL-connection for sqldb? In principle > > the only thing that has to be changes to use another MySQL-version is to > > change the used unit. So, always use the TMysqlConn-component, but > > changes the usage-clausule. > > > > But how can this be handled by Lazarus? With the SQLDB-package only one > > unit can be used. (Or else multiple types with the same name are > > defined) Let the users manually change the usage-line if they want to > > use a different MySQL-library-version? > > FOr the sqldb package, let them add a define to the compiler options: > -dMYSQL40 > or > -dMYSQL41 > or > -dMYSQL50 > > That seems more user friendly than editing the uses clause. > > In the source, change the uses clause, depending on the defines. The problem with this approach is that you can never distribute compiled MySQL support in this way. The only way to do that is to do the mysql40, mysql40dyn, mysql41, mysql41dyn, mysql50, mysql51dyn stuff. So for FPC, I'm for that approach. Michael. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] MySQL v4.0 v4.1 and v5.0
Joost van der Sluis wrote: Hi all, atm I have a nearly finished mysql.inc file that can be used with MySQL v4.0 v4.1 and v5.0. Loaded dynamically and static. It uses several defines to set the right MySQL version and to turn the dynamically linking on or off. Create 6 different units in packages/base/mysql - for each combination one? (thus mysql40, mysql40dyn, mysql41, mysql41dyn, mysql50 and mysql51dyn?) But then, what to do with the MySQL-connection for sqldb? In principle the only thing that has to be changes to use another MySQL-version is to change the used unit. So, always use the TMysqlConn-component, but changes the usage-clausule. But how can this be handled by Lazarus? With the SQLDB-package only one unit can be used. (Or else multiple types with the same name are defined) Let the users manually change the usage-line if they want to use a different MySQL-library-version? FOr the sqldb package, let them add a define to the compiler options: -dMYSQL40 or -dMYSQL41 or -dMYSQL50 That seems more user friendly than editing the uses clause. In the source, change the uses clause, depending on the defines. Vincent. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
[fpc-devel] MySQL v4.0 v4.1 and v5.0
Hi all, atm I have a nearly finished mysql.inc file that can be used with MySQL v4.0 v4.1 and v5.0. Loaded dynamically and static. It uses several defines to set the right MySQL version and to turn the dynamically linking on or off. Nog my question is: what is the best way to use this? Create 6 different units in packages/base/mysql - for each combination one? (thus mysql40, mysql40dyn, mysql41, mysql41dyn, mysql50 and mysql51dyn?) And then remove the existing mysql4 unit? This one is useless anyway because someone tried to update to MySQL 4.1, which wasn't done completely so now it's useless with 4.0 and 4.1. (At least with sqldb, too bad I didn't discovered that, so that mysql-support in 2.0.2 is very bad) But then, what to do with the MySQL-connection for sqldb? In principle the only thing that has to be changes to use another MySQL-version is to change the used unit. So, always use the TMysqlConn-component, but changes the usage-clausule. But how can this be handled by Lazarus? With the SQLDB-package only one unit can be used. (Or else multiple types with the same name are defined) Let the users manually change the usage-line if they want to use a different MySQL-library-version? Or create a TMysqlConn40, TMysqlconn41 and TMyslqconn50 wich are effectively the same, only with another usage-line? (Using the ifdef's again?) Is the problem clear and does someone have any ideas on this? -- Met vriendelijke groeten, Joost van der Sluis CNOC Informatiesystemen en Netwerken http://www.cnoc.nl ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel