diff options
author | unknown <monty@hundin.mysql.fi> | 2002-05-22 18:51:21 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-05-22 18:51:21 +0300 |
commit | a8652e9957e014c19b47635e09147a7bc17a3b8c (patch) | |
tree | e6741f4cc08ecfcebdfc62b6fab6d6b0e1a7e453 /sql | |
parent | c811538f89925b7111e4ee0e3b940726f32a64d9 (diff) | |
download | mariadb-git-a8652e9957e014c19b47635e09147a7bc17a3b8c.tar.gz |
Fixed problem in fulltest testcase
include/my_base.h:
Fix to ensure that old tables works in 4.1
myisam/mi_open.c:
cleanup
mysys/my_handler.c:
Fixed problem in fulltest testcase
sql/spatial.cc:
cleanup
sql/sql_table.cc:
cleanup
Diffstat (limited to 'sql')
-rw-r--r-- | sql/spatial.cc | 14 | ||||
-rw-r--r-- | sql/sql_table.cc | 20 |
2 files changed, 22 insertions, 12 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc index 32942a70dc2..bb6e03c3c03 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -680,13 +680,16 @@ int GPolygon::centroid_xy(double *x, double *y) const uint32 i; double res_area, res_cx, res_cy; const char *data = m_data; + LINT_INIT(res_area); + LINT_INIT(res_cx); + LINT_INIT(res_cy); if (no_data(data, 4)) return 1; n_linear_rings = uint4korr(data); data += 4; - for(i = 0; i < n_linear_rings; ++i) + for (i = 0; i < n_linear_rings; ++i) { if (no_data(data, 4)) return 1; @@ -720,7 +723,8 @@ int GPolygon::centroid_xy(double *x, double *y) const cur_area = fabs(cur_area) / 2; cur_cx = cur_cx / (n_points - 1); cur_cy = cur_cy / (n_points - 1); - if(i) + + if (i) { double d_area = res_area - cur_area; if (d_area <= 0) @@ -1195,6 +1199,10 @@ int GMultiPolygon::centroid(String *result) const double res_area, res_cx, res_cy; double cur_area, cur_cx, cur_cy; + LINT_INIT(res_area); + LINT_INIT(res_cx); + LINT_INIT(res_cy); + const char *data = m_data; if (no_data(data, 4)) return 1; @@ -1211,7 +1219,7 @@ int GMultiPolygon::centroid(String *result) const if (p.centroid_xy(&cur_cx, &cur_cy)) return 1; - if(i) + if (i) { double sum_area = res_area + cur_area; res_cx = (res_area * res_cx + cur_area * cur_cx) / sum_area; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 36c4f4cba48..bdcb325774b 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -476,20 +476,22 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, checking for proper key parts number: */ - if(key_info->flags == HA_SPATIAL){ - if(key_info->key_parts!=1){ + if (key_info->flags == HA_SPATIAL) + { + if (key_info->key_parts != 1) + { my_printf_error(ER_WRONG_ARGUMENTS, ER(ER_WRONG_ARGUMENTS),MYF(0),"SPATIAL INDEX"); DBUG_RETURN(-1); } - }else + } + else if (key_info->algorithm == HA_KEY_ALG_RTREE) { - if(key_info->algorithm == HA_KEY_ALG_RTREE){ - if((key_info->key_parts&1)==1){ - my_printf_error(ER_WRONG_ARGUMENTS, - ER(ER_WRONG_ARGUMENTS),MYF(0),"RTREE INDEX"); - DBUG_RETURN(-1); - } + if ((key_info->key_parts & 1) == 1) + { + my_printf_error(ER_WRONG_ARGUMENTS, + ER(ER_WRONG_ARGUMENTS),MYF(0),"RTREE INDEX"); + DBUG_RETURN(-1); } } |