1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

merge 5.1->5.5

This commit is contained in:
Georgi Kodinov
2013-03-27 16:06:33 +02:00
2 changed files with 59 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ class Gis_read_stream;
const uint SRID_SIZE= 4;
const uint SIZEOF_STORED_DOUBLE= 8;
const uint POINT_DATA_SIZE= SIZEOF_STORED_DOUBLE*2;
const uint POINT_DATA_SIZE= (SIZEOF_STORED_DOUBLE * 2);
const uint WKB_HEADER_SIZE= 1+4;
const uint32 GET_SIZE_ERROR= ((uint32) -1);
@@ -321,10 +321,33 @@ protected:
const char *get_mbr_for_points(MBR *mbr, const char *data, uint offset)
const;
inline bool no_data(const char *cur_data, uint32 data_amount) const
/**
Check if there're enough data remaining as requested
@arg cur_data pointer to the position in the binary form
@arg data_amount number of points expected
@return true if not enough data
*/
inline bool no_data(const char *cur_data, size_t data_amount) const
{
return (cur_data + data_amount > m_data_end);
}
/**
Check if there're enough points remaining as requested
Need to perform the calculation in logical units, since multiplication
can overflow the size data type.
@arg data pointer to the begining of the points array
@arg expected_points number of points expected
@return true if there are not enough points
*/
inline bool not_enough_points(const char *data, uint32 expected_points) const
{
return (m_data_end < data ||
(expected_points > ((m_data_end - data) / POINT_DATA_SIZE)));
}
const char *m_data;
const char *m_data_end;
};