Re: How Do I Determine the Server's Version on Old Server?

2004-10-11 Thread Benjamin Arai
mysqladmin version


On Mon, 11 Oct 2004 10:36:54 -0400, Michael Stassen
<[EMAIL PROTECTED]> wrote:
> You should keep threads on the list.  That way, more people can help, and
> more can benefit from the answers.
> 
> I've not looked at the code behind mysql_get_server_info(), but every
> version of mysql I've seen has 3 parts to the version number.  It seems
> clear that the mysql version numbering scheme is release.version, where
> release is 3.23, 4.0, 4.1, or 5.0, and version is sequential.  Assuming
> you'll always get a 3 part version seems safe to me.
> 
> Michael
> 
> Matthew Boehm wrote:
> 
> >>Will mysql_get_server_info() give you what you need?
> >>
> >
> >
> > I guess I could use that and parse out on the . separator.
> >
> > Will I always get a 3 . separated string? ie: X.XX.XX ? Or could I sometimes
> > get X.XX?
> >
> > Thanks,
> > Matthew
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 


-- 
Benjamin Arai
http://www.cs.ucr.edu/~barai
[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How Do I Determine the Server's Version on Old Server?

2004-10-11 Thread Michael Stassen
You should keep threads on the list.  That way, more people can help, and 
more can benefit from the answers.

I've not looked at the code behind mysql_get_server_info(), but every 
version of mysql I've seen has 3 parts to the version number.  It seems 
clear that the mysql version numbering scheme is release.version, where 
release is 3.23, 4.0, 4.1, or 5.0, and version is sequential.  Assuming 
you'll always get a 3 part version seems safe to me.

Michael
Matthew Boehm wrote:
Will mysql_get_server_info() give you what you need?


I guess I could use that and parse out on the . separator.
Will I always get a 3 . separated string? ie: X.XX.XX ? Or could I sometimes
get X.XX?
Thanks,
Matthew
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: How Do I Determine the Server's Version on Old Server?

2004-10-08 Thread Michael Stassen
Will mysql_get_server_info() give you what you need? 


Otherwise, I suppose you could
  SELECT VERSION();
and parse the result.
Michael
Matthew Boehm wrote:
Hey guys,
 I see there is a mailing list for all other API's except the built in one.
Hmmm. Anyway, I'm writing an app in C that will connect to a MySQL database
server and run some queries. I'd like to use prepared statements in some
cases but since prepared statements are only available in 4.1 or higher I
need to find out what the server's version is first.
 Normally I could just check MYSQL_VERSION_ID and if it is greater or equal
to 40100 then I can use the prepared statements. But, in my case, I'm using
the 4.1 client libraries but the test server I'm connecting to is 3.23.50
which will not support prepared statements. But if I use my MYSQL_VERSION_ID
method, everything will seem ok and the compiler will put in the unusable
4.1 code.
 I found this function on the docs: mysql_get_server_version()
 However, the docs say this was added in 4.1.
 So, how do I find the server's version that I am connected to if the
function I need to use won't work on pre 4.1 and the VERSION_ID check won't
work for different client-server versions?
Thanks,
Matthew
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


How Do I Determine the Server's Version on Old Server?

2004-10-08 Thread Matthew Boehm
Hey guys,
 I see there is a mailing list for all other API's except the built in one.
Hmmm. Anyway, I'm writing an app in C that will connect to a MySQL database
server and run some queries. I'd like to use prepared statements in some
cases but since prepared statements are only available in 4.1 or higher I
need to find out what the server's version is first.
 Normally I could just check MYSQL_VERSION_ID and if it is greater or equal
to 40100 then I can use the prepared statements. But, in my case, I'm using
the 4.1 client libraries but the test server I'm connecting to is 3.23.50
which will not support prepared statements. But if I use my MYSQL_VERSION_ID
method, everything will seem ok and the compiler will put in the unusable
4.1 code.

 I found this function on the docs: mysql_get_server_version()

 However, the docs say this was added in 4.1.

 So, how do I find the server's version that I am connected to if the
function I need to use won't work on pre 4.1 and the VERSION_ID check won't
work for different client-server versions?

Thanks,
Matthew
-- 

Matthew Boehm
[EMAIL PROTECTED]
The University of Texas at Austin, Department of Geography

"Why did the prison use Windows2K as a guard? Because it always locks up!"





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]