[CONC-20] libmysqlclient incompatibility: uses MYSQL_TYPE_NEWDATE, not supported by MySQL Connector/C++ Created: 2013-03-23  Updated: 2013-03-23  Resolved: 2013-03-23

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Lionel Elie Mamane Assignee: Georg Richter
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

Reproduced on MacOS X and Debian GNU/Linux amd64
Connecting to MySQL server



 Description   

Using bzr/launchpad snapshot revision 40, connecting to MySQL.

Given the table:

CREATE TABLE `oldfmpro` (
...
`Filing_Date1` date DEFAULT NULL,
...
`Prio_FF_Date1` date DEFAULT NULL,
...
)

and the view

CREATE OR REPLACE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `natpha_ddl` AS
select ..., if(((`oldfmpro`.`Prio_FF_Date1` + interval 30 month) is not null),(`oldfmpro`.`Prio_FF_Date1` + interval 30 month),(`oldfmpro`.`Filing_Date1` + interval 30 month)) AS `NATPHA` from `oldfmpro` where ((`oldfmpro`.`Filing_Num` is not null) and (`oldfmpro`.`Ctry_Short` = 'WO') and (`oldfmpro`.`IngJur` like '%ajt%') and (`oldfmpro`.`Filing_Date1` >= (curdate() + interval -(30) month))) order by if(((`oldfmpro`.`Prio_FF_Date1` + interval 30 month) is not null),(`oldfmpro`.`Prio_FF_Date1` + interval 30 month),(`oldfmpro`.`Filing_Date1` + interval 30 month));

When calling mysql_fetch_field on "SELECT * FROM natpha_ddl", for column NATPHA, mariadb client library for C returns:

{name = 0x285b2b8 "NATPHA", ... type = MYSQL_TYPE_NEWDATE, ...}

Which breaks MySQL Connector/C++, which does not support this column type; it throws error:
sql::InvalidArgumentException("allocate_buffer_for_field: invalid rbind data type");

Background:
LibreOffice, in its "master" (trunk) development, has swapped out libmysqlclient for the MariaDB client library for C, and for the time being uses it through MySQL Connector/C+. This breaks this scenario. We are using a bzr snapshot because version 1.0.0 has API incompatibilities with libmysqlclient, which are used by MySQL Connector/C+:

  • missing symbols mysql_library_init and mysql_library_end
  • missing parameter "cipher" to mysql_ssl_set

Full table definition:

CREATE TABLE `oldfmpro` (
`Agent` varchar(254) DEFAULT NULL,
`Ann_Fees1` date DEFAULT NULL,
`Attention` varchar(254) DEFAULT NULL,
`IngJur` char(3) DEFAULT NULL,
`Client` varchar(254) DEFAULT NULL,
`Client_Copy` varchar(254) DEFAULT NULL,
`Comments` varchar(254) DEFAULT NULL,
`Ctry_Short` varchar(254) DEFAULT NULL,
`Prio_Ctry1` char(2) DEFAULT '',
`Prio_Ctry2` char(2) DEFAULT '',
`Prio_Ctry3` char(2) DEFAULT '',
`Prio_Ctry4` char(2) DEFAULT '',
`Prio_Ctry5` char(2) DEFAULT '',
`Prio_Ctry6` char(2) DEFAULT '',
`Exp_Date1` date DEFAULT NULL,
`File_Code` varchar(254) DEFAULT NULL,
`File_Num` varchar(254) DEFAULT NULL,
`Filing_Num` varchar(254) DEFAULT NULL,
`Filing_Date1` date DEFAULT NULL,
`Grant_Num` varchar(254) DEFAULT NULL,
`Grant_Date1` date DEFAULT NULL,
`Inventor1` varchar(50) DEFAULT '',
`Inventor2` varchar(50) DEFAULT '',
`Inventor3` varchar(50) DEFAULT '',
`Inventor4` varchar(50) DEFAULT NULL,
`Inventor5` varchar(50) DEFAULT '',
`Inventor6` varchar(50) DEFAULT '',
`Inventor7` varchar(50) DEFAULT '',
`Inventor8` varchar(50) DEFAULT '',
`Inventor9` varchar(50) DEFAULT '',
`Inventor10` varchar(50) DEFAULT '',
`Keywords` varchar(254) DEFAULT NULL,
`Our_Ref` varchar(254) DEFAULT NULL,
`Owner1` varchar(254) NOT NULL DEFAULT '',
`Owner2` varchar(254) DEFAULT NULL,
`Owner3` varchar(100) DEFAULT '',
`Owner4` varchar(100) DEFAULT '',
`Owner5` varchar(100) DEFAULT '',
`Owner6` varchar(100) DEFAULT '',
`Owner7` varchar(100) DEFAULT '',
`Owner8` varchar(100) DEFAULT '',
`Owner9` varchar(100) DEFAULT '',
`Owner10` varchar(100) DEFAULT '',
`Prio_SN` varchar(254) DEFAULT NULL,
`Prio_SN2` varchar(30) DEFAULT NULL,
`Prio_SN3` varchar(30) DEFAULT NULL,
`Prio_SN4` varchar(30) DEFAULT NULL,
`Prio_SN5` varchar(30) DEFAULT NULL,
`Prio_SN6` varchar(30) DEFAULT NULL,
`Prio_SN7` varchar(30) DEFAULT NULL,
`Prio_SN8` varchar(30) DEFAULT NULL,
`Prio_FF_Date1` date DEFAULT NULL,
`Prio_FF_Date2` date DEFAULT NULL,
`Prio_FF_Date3` date DEFAULT NULL,
`Prio_FF_Date4` date DEFAULT NULL,
`Prio_FF_Date5` date DEFAULT NULL,
`Prio_FF_Date6` date DEFAULT NULL,
`Prio_FF_Date7` date DEFAULT NULL,
`Prio_FF_Date8` date DEFAULT NULL,
`Pub_Num` varchar(254) DEFAULT NULL,
`Pub_Date1` date DEFAULT NULL,
`Related_Files` varchar(254) DEFAULT NULL,
`Summary` varchar(254) DEFAULT NULL,
`Y_ref` varchar(254) DEFAULT NULL,
`State_dep` varchar(254) DEFAULT NULL,
`State_dep_num` varchar(254) DEFAULT NULL,
`chg_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`fmpro_id` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT,
`pay_ann_fee` char(1) NOT NULL DEFAULT 'Y',
`assistant` varchar(7) DEFAULT NULL,
`Prio_Ctry7` char(2) DEFAULT NULL,
`Prio_Ctry8` char(2) DEFAULT NULL,
`abandon` char(1) DEFAULT NULL,
`chg_by` varchar(50) NOT NULL,
PRIMARY KEY (`fmpro_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4474 DEFAULT CHARSET=latin1

Full view definition:

CREATE OR REPLACE ALGORITHM=UNDEFINED DEFINER=`alex`@`%` SQL SECURITY DEFINER VIEW `natpha_ddl` AS select `oldfmpro`.`File_Num` AS `file_num`,`oldfmpro`.`Owner1` AS `Owner1`,`oldfmpro`.`Filing_Num` AS `filing_num`,`oldfmpro`.`Filing_Date1` AS `filing_date1`,`oldfmpro`.`Prio_FF_Date1` AS `Prio_FF_Date1`,if(((`oldfmpro`.`Prio_FF_Date1` + interval 30 month) is not null),(`oldfmpro`.`Prio_FF_Date1` + interval 30 month),(`oldfmpro`.`Filing_Date1` + interval 30 month)) AS `NATPHA` from `oldfmpro` where ((`oldfmpro`.`Filing_Num` is not null) and (`oldfmpro`.`Ctry_Short` = 'WO') and (`oldfmpro`.`IngJur` like '%ajt%') and (`oldfmpro`.`Filing_Date1` >= (curdate() + interval -(30) month))) order by if(((`oldfmpro`.`Prio_FF_Date1` + interval 30 month) is not null),(`oldfmpro`.`Prio_FF_Date1` + interval 30 month),(`oldfmpro`.`Filing_Date1` + interval 30 month));



 Comments   
Comment by Georg Richter [ 2013-03-23 ]

This is not a bug, MYSQL_TYPE_NEWDATE is returned from Server. If MySQL Connector/C++ doesn't support it, you should file a bug report or feature reqeust for.

georg@linux-eozo:~> mysql -uroot test --column-type-info
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 75
Server version: 10.0.1-MariaDB-log Source distribution
 
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql> create table t1(a date, b date);
Query OK, 0 rows affected (0.06 sec)
 
mysql> select if(a is NULL, b, a) FROM t1;
Field   1:  `if(a is NULL, b, a)`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       NEWDATE
Collation:  utf8_unicode_ci (192)
Length:     30
Max_length: 0
Decimals:   0
Flags:      
 
 
0 rows in set (0.00 sec)
 

Comment by Georg Richter [ 2013-03-23 ]

This is not a bug, MYSQL_TYPE_NEWDATE is returned from Server. If MySQL Connector/C++ doesn't support it, you should file a bug report or feature reqeust for.

georg@linux-eozo:~> mysql -uroot test --column-type-info
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 75
Server version: 10.0.1-MariaDB-log Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create table t1(a date, b date);
Query OK, 0 rows affected (0.06 sec)

mysql> select if(a is NULL, b, a) FROM t1;
Field 1: `if(a is NULL, b, a)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: NEWDATE
Collation: utf8_unicode_ci (192)
Length: 30
Max_length: 0
Decimals: 0
Flags:

0 rows in set (0.00 sec)

Comment by Lionel Elie Mamane [ 2013-03-23 ]

So it seems... I get the same problem with libmysqlclient, so indeed this bug report is invalid.

I put too much faith in the bugreport at LibreOffice, which said "it worked before, and since LibreOffice switched from libmysqlclient to mariadb client for C, it gives this error message".

Sorry for the noise.

Generated at Thu Feb 08 03:02:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.