Bug #74315 Unsupported buffer type for mysql_stmt_bind_result function
Submitted: 10 Oct 2014 12:31 Modified: 13 Oct 2014 9:41
Reporter: Hemant Dangi Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[10 Oct 2014 12:31] Hemant Dangi
Description:
Description:
Call function mysql_stmt_bind_result (with simple select that contain geometry data type and buffer with type MYSQL_TYPE_GEOMETRY) fail. Call mysql_stmt_error function after that return message: "Using unsupported buffer type: 255  (parameter: 2)"

How to repeat:
How to repeat:
1. Create database with geometry data:
CREATE DATABASE `MigrationTestGeometry` /*!40100 DEFAULT CHARACTER SET latin1 */;
CREATE TABLE `geom` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `data` geometry DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
INSERT INTO geom(data) VALUES (GeomFromText('POINT(1 1)'));

2. Call select staement: SELECT id, data FROM geom;

3. Call mysql_stmt_bind_result(_select_stmt, &(rowbuffer[0])) with that select staement and buffer that have buffer_type = MYSQL_TYPE_GEOMETRY

Function will return false and call mysql_stmt_error function after that return message: "Using unsupported buffer type: 255  (parameter: 2)"
[10 Oct 2014 12:32] Hemant Dangi
testcase

Attachment: test_geometry.c (text/plain), 886 bytes.

[13 Oct 2014 9:41] MySQL Verification Team
Hello Hemant,

Thank you for the bug report and test case.

Thanks,
Umesh
[13 Oct 2014 9:42] MySQL Verification Team
// With MySQL 5.6.22 and provide c test case

[root@cluster-repo mysql-advanced-5.6.22]# gcc test_geometry.c -Wall -g -o test_geometry -L/data/ushastry/server/mysql-advanced-5.6.22/lib -I /data/ushastry/server/mysql-advanced-5.6.22/include/   -lmysqlclient_r -lz -lm -lpthread
test_geometry.c: In function ‘main’:
test_geometry.c:16: warning: implicit declaration of function ‘exit’
test_geometry.c:16: warning: incompatible implicit declaration of built-in function ‘exit’
test_geometry.c:22: warning: incompatible implicit declaration of built-in function ‘exit’
test_geometry.c:38: warning: control reaches end of non-void function
[root@cluster-repo mysql-advanced-5.6.22]#

[root@cluster-repo mysql-advanced-5.6.22]# ./test_geometry
Using unsupported buffer type: 253  (parameter: 1)