File tree Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -1053,11 +1053,11 @@ MySQL_Prepared_ResultSet::getString(const uint32_t columnIndex) const
1053
1053
case sql::DataType::SET:
1054
1054
case sql::DataType::ENUM:
1055
1055
case sql::DataType::JSON:
1056
+ case sql::DataType::GEOMETRY:
1056
1057
CPP_INFO (" It's a string" );
1057
1058
return sql::SQLString (static_cast <char *>(result_bind->rbind [columnIndex - 1 ].buffer ), *result_bind->rbind [columnIndex - 1 ].length );
1058
1059
default :
1059
1060
break ;
1060
- // ToDo : Geometry? default ?
1061
1061
}
1062
1062
1063
1063
CPP_ERR (" MySQL_Prepared_ResultSet::getString: unhandled type. Please, report" );
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ static struct st_buffer_size_type
113
113
case MYSQL_TYPE_BIT:
114
114
return st_buffer_size_type (new char [8 ], 8 , MYSQL_TYPE_BIT);
115
115
case MYSQL_TYPE_GEOMETRY:
116
+ return st_buffer_size_type (new char [field->max_length ], field->max_length , MYSQL_TYPE_BIT);
116
117
default :
117
118
// TODO: Andrey, there can be crashes when we go through this. Please fix.
118
119
throw sql::InvalidArgumentException (" allocate_buffer_for_field: invalid rbind data type" );
Original file line number Diff line number Diff line change @@ -1270,6 +1270,39 @@ void bugs::bug23235968()
1270
1270
1271
1271
}
1272
1272
1273
+ void bugs::bug19192707 ()
1274
+ {
1275
+ logMsg (" bugs::bug19192707" );
1276
+
1277
+ sql::SQLString direct, ps;
1278
+
1279
+ stmt->executeUpdate (" drop table if exists bug19192707" );
1280
+ stmt->executeUpdate (" create table bug19192707 (i1 point)" );
1281
+
1282
+ pstmt.reset (con->prepareStatement (" insert into bug19192707 (i1) values(ST_PointFromText('POINT(1 2)',4326))" ));
1283
+ pstmt->executeUpdate ();
1284
+
1285
+ logMsg (" Select with Direct execute : " );
1286
+
1287
+ res.reset (stmt->executeQuery (" select i1 from bug19192707" ));
1288
+
1289
+ res->next ();
1290
+ direct = res->getString (1 );
1291
+
1292
+ logMsg (" Select with Prepare/execute : " );
1293
+
1294
+ pstmt.reset (con->prepareStatement (" select i1 from bug19192707" ));
1295
+
1296
+ res.reset (pstmt->executeQuery ());
1297
+
1298
+ res->next ();
1299
+ ps = res->getString (1 );
1300
+
1301
+ ASSERT_EQUALS (direct, ps);
1302
+
1303
+ stmt->executeUpdate (" drop table if exists bug19192707" );
1304
+
1305
+ }
1273
1306
1274
1307
} /* namespace regression */
1275
1308
} /* namespace testsuite */
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ class bugs : public unit_fixture
80
80
TEST_CASE (bug30126457);
81
81
TEST_CASE (bug32695580);
82
82
TEST_CASE (bug23235968);
83
+ TEST_CASE (bug19192707);
83
84
}
84
85
85
86
/* *
@@ -151,6 +152,7 @@ class bugs : public unit_fixture
151
152
152
153
void bug23235968 ();
153
154
155
+ void bug19192707 ();
154
156
};
155
157
156
158
REGISTER_FIXTURE (bugs);
You can’t perform that action at this time.
0 commit comments