Skip to content

Commit be86a27

Browse files
author
Deepa Dixit
committed
Bug#23280117: 5.7 BUG XXXXX TEST REPLACE NUMBER ROUND+GIS PRECISION DIFFERENCES
(CONTRIBUTION) Post push fix: Changing name of the mysqltest command from 'replace_numberic_round' to 'replace_numeric_round'. Reviewed-by: Pavan Naik <pavan.naik@oracle.com>
1 parent f8ff8c1 commit be86a27

9 files changed

+368
-368
lines changed

client/mysqltest.cc

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ enum enum_commands {
398398
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
399399
Q_IF,
400400
Q_DISABLE_PARSING, Q_ENABLE_PARSING,
401-
Q_REPLACE_REGEX, Q_REPLACE_NUMBERIC_ROUND, Q_REMOVE_FILE, Q_FILE_EXIST,
401+
Q_REPLACE_REGEX, Q_REPLACE_NUMERIC_ROUND, Q_REMOVE_FILE, Q_FILE_EXIST,
402402
Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
403403
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
404404
Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR,
@@ -484,7 +484,7 @@ const char *command_names[]=
484484
"disable_parsing",
485485
"enable_parsing",
486486
"replace_regex",
487-
"replace_numberic_round",
487+
"replace_numeric_round",
488488
"remove_file",
489489
"file_exists",
490490
"write_file",
@@ -664,11 +664,11 @@ void free_replace();
664664
void do_get_replace_regex(struct st_command *command);
665665
void free_replace_regex();
666666

667-
/* For replace numberic round */
668-
static int glob_replace_numberic_round= -1;
669-
void do_get_replace_numberic_round(struct st_command *command);
670-
void free_replace_numberic_round();
671-
void replace_numberic_round_append(int round, DYNAMIC_STRING* ds,
667+
/* For replace numeric round */
668+
static int glob_replace_numeric_round= -1;
669+
void do_get_replace_numeric_round(struct st_command *command);
670+
void free_replace_numeric_round();
671+
void replace_numeric_round_append(int round, DYNAMIC_STRING* ds,
672672
const char *from, size_t len);
673673

674674
/* Used by sleep */
@@ -681,7 +681,7 @@ void free_all_replace(){
681681
free_replace();
682682
free_replace_regex();
683683
free_replace_column();
684-
free_replace_numberic_round();
684+
free_replace_numeric_round();
685685
}
686686

687687

@@ -2599,11 +2599,11 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
25992599
replace_strings_append(glob_replace, &ds_temp, val, len);
26002600

26012601
/*
2602-
Call the replace_numberic_round function with the specified
2602+
Call the replace_numeric_round function with the specified
26032603
precision. It may be used along with replace_result, so use the
2604-
output from replace_result as the input for replace_numberic_round.
2604+
output from replace_result as the input for replace_numeric_round.
26052605
*/
2606-
if (glob_replace_numberic_round >= 0)
2606+
if (glob_replace_numeric_round >= 0)
26072607
{
26082608
/* Copy the result from replace_result if it was used, into buffer */
26092609
if (ds_temp.length > 0)
@@ -2612,15 +2612,15 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
26122612
strcpy(buffer, ds_temp.str);
26132613
dynstr_free(&ds_temp);
26142614
init_dynamic_string(&ds_temp, "", 512, 512);
2615-
replace_numberic_round_append(glob_replace_numberic_round, &ds_temp,
2615+
replace_numeric_round_append(glob_replace_numeric_round, &ds_temp,
26162616
buffer, strlen(buffer));
26172617
}
26182618
else
2619-
replace_numberic_round_append(glob_replace_numberic_round, &ds_temp,
2619+
replace_numeric_round_append(glob_replace_numeric_round, &ds_temp,
26202620
val, len);
26212621
}
26222622

2623-
if(!glob_replace && glob_replace_numberic_round < 0)
2623+
if(!glob_replace && glob_replace_numeric_round < 0)
26242624
dynstr_append_mem(&result, val, len);
26252625
else
26262626
dynstr_append_mem(&result, ds_temp.str, strlen(ds_temp.str));
@@ -9575,8 +9575,8 @@ int main(int argc, char **argv)
95759575
case Q_REPLACE_COLUMN:
95769576
do_get_replace_column(command);
95779577
break;
9578-
case Q_REPLACE_NUMBERIC_ROUND:
9579-
do_get_replace_numberic_round(command);
9578+
case Q_REPLACE_NUMERIC_ROUND:
9579+
do_get_replace_numeric_round(command);
95809580
break;
95819581
case Q_SAVE_MASTER_POS: do_save_master_pos(); break;
95829582
case Q_SYNC_WITH_MASTER: do_sync_with_master(command); break;
@@ -9932,30 +9932,30 @@ void free_replace_column()
99329932
Functions to round numeric results.
99339933
99349934
SYNOPSIS
9935-
do_get_replace_numberic_round()
9935+
do_get_replace_numeric_round()
99369936
command - command handle
99379937
99389938
DESCRIPTION
9939-
replace_numberic_round <precision>
9939+
replace_numeric_round <precision>
99409940
99419941
where precision is the number of digits after the decimal point
99429942
that the result will be rounded off to. The precision can only
99439943
be a number between 0 and 16.
9944-
eg. replace_numberic_round 10;
9944+
eg. replace_numeric_round 10;
99459945
Numbers which are > 1e10 or < -1e10 are represented using the
99469946
exponential notation after they are rounded off.
99479947
Trailing zeroes after the decimal point are removed from the
99489948
numbers.
99499949
If the precision is 0, then the value is rounded off to the
99509950
nearest whole number.
99519951
*/
9952-
void do_get_replace_numberic_round(struct st_command *command)
9952+
void do_get_replace_numeric_round(struct st_command *command)
99539953
{
99549954
DYNAMIC_STRING ds_round;
99559955
const struct command_arg numeric_arg =
99569956
{ "precision", ARG_STRING, TRUE, &ds_round,
99579957
"Number of decimal precision"};
9958-
DBUG_ENTER("get_replace_numberic_round");
9958+
DBUG_ENTER("get_replace_numeric_round");
99599959

99609960
check_command_args(command, command->first_argument,
99619961
&numeric_arg,
@@ -9966,17 +9966,17 @@ void do_get_replace_numberic_round(struct st_command *command)
99669966
long int v= 0;
99679967
if (str2int(ds_round.str, 10, 0, REPLACE_ROUND_MAX, &v) == NullS)
99689968
die("A number between 0 and %d is required for the precision "\
9969-
"in replace_numberic_round", REPLACE_ROUND_MAX);
9969+
"in replace_numeric_round", REPLACE_ROUND_MAX);
99709970

9971-
glob_replace_numberic_round= (int) v;
9971+
glob_replace_numeric_round= (int) v;
99729972
dynstr_free(&ds_round);
99739973
DBUG_VOID_RETURN;
99749974
}
99759975

99769976

9977-
void free_replace_numberic_round()
9977+
void free_replace_numeric_round()
99789978
{
9979-
glob_replace_numberic_round= -1;
9979+
glob_replace_numeric_round= -1;
99809980
}
99819981

99829982

@@ -9985,7 +9985,7 @@ void free_replace_numberic_round()
99859985
by iterating through the result set element, identifying the part to
99869986
be rounded off, and rounding that part off.
99879987
*/
9988-
void replace_numberic_round_append(int round, DYNAMIC_STRING* result,
9988+
void replace_numeric_round_append(int round, DYNAMIC_STRING* result,
99899989
const char *from, size_t len)
99909990
{
99919991
while (len > 0)
@@ -11315,11 +11315,11 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
1131511315
}
1131611316

1131711317
/*
11318-
Call the replace_numberic_round function with the specified
11318+
Call the replace_numeric_round function with the specified
1131911319
precision. It may be used along with replace_result, so use the
11320-
output from replace_result as the input for replace_numberic_round.
11320+
output from replace_result as the input for replace_numeric_round.
1132111321
*/
11322-
if (glob_replace_numberic_round >= 0)
11322+
if (glob_replace_numeric_round >= 0)
1132311323
{
1132411324
/* Copy the result from replace_result if it was used, into buffer */
1132511325
if(ds_temp.length > 0)
@@ -11328,15 +11328,15 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
1132811328
strcpy(buffer, ds_temp.str);
1132911329
dynstr_free(&ds_temp);
1133011330
init_dynamic_string(&ds_temp, "", 512, 512);
11331-
replace_numberic_round_append(glob_replace_numberic_round, &ds_temp,
11331+
replace_numeric_round_append(glob_replace_numeric_round, &ds_temp,
1133211332
buffer, strlen(buffer));
1133311333
}
1133411334
else
11335-
replace_numberic_round_append(glob_replace_numberic_round, &ds_temp,
11335+
replace_numeric_round_append(glob_replace_numeric_round, &ds_temp,
1133611336
val, len);
1133711337
}
1133811338

11339-
if (!glob_replace && glob_replace_numberic_round < 0)
11339+
if (!glob_replace && glob_replace_numeric_round < 0)
1134011340
dynstr_append_mem(ds, val, len);
1134111341
else
1134211342
dynstr_append_mem(ds, ds_temp.str, strlen(ds_temp.str));

mysql-test/r/mysqltest.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,8 +1032,8 @@ SELECT 20;
10321032
20
10331033
20
10341034
# An error is thrown if parameter count is 0
1035-
mysqltest: At line 1: Missing required argument 'precision' to command 'replace_numberic_round'
1035+
mysqltest: At line 1: Missing required argument 'precision' to command 'replace_numeric_round'
10361036
# The maximum value which can be passed is 16
1037-
mysqltest: At line 1: A number between 0 and 16 is required for the precision in replace_numberic_round
1037+
mysqltest: At line 1: A number between 0 and 16 is required for the precision in replace_numeric_round
10381038
# The minimum value which can be passed is 0
1039-
mysqltest: At line 1: A number between 0 and 16 is required for the precision in replace_numberic_round
1039+
mysqltest: At line 1: A number between 0 and 16 is required for the precision in replace_numeric_round

mysql-test/suite/gis/t/gis_bugs_crashes.test

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,24 +1267,24 @@ SELECT ST_ASTEXT(ST_ENVELOPE(ST_GEOMFROMTEXT(@star_of_elems)));
12671267
SELECT ST_ASTEXT(ST_CENTROID(ST_GEOMFROMTEXT(@star_of_elems)));
12681268
SELECT ST_ASTEXT(ST_CONVEXHULL(ST_GEOMFROMTEXT(@star_of_elems)));
12691269

1270-
--replace_numberic_round 4
1270+
--replace_numeric_round 4
12711271
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT(@star_of_elems), 1));
12721272

12731273
SET @buf = ST_BUFFER(ST_GEOMFROMTEXT(@star_of_elems), 1);
12741274

1275-
--replace_numberic_round 4
1275+
--replace_numeric_round 4
12761276
SELECT st_area(@buf);
12771277

1278-
--replace_numberic_round 4
1278+
--replace_numeric_round 4
12791279
SELECT ST_ASTEXT(ST_BUFFER(@buf, 1));
12801280

1281-
--replace_numberic_round 4
1281+
--replace_numeric_round 4
12821282
SELECT ST_ASTEXT(ST_CENTROID(@buf));
12831283

1284-
--replace_numberic_round 4
1284+
--replace_numeric_round 4
12851285
SELECT ST_ASTEXT(ST_CONVEXHULL(@buf));
12861286

1287-
--replace_numberic_round 4
1287+
--replace_numeric_round 4
12881288
SELECT ST_ASTEXT(ST_ENVELOPE(@buf));
12891289

12901290
SELECT ST_DISTANCE(ST_GEOMFROMTEXT(@star_of_elems),ST_GEOMFROMTEXT(@star_top)) as result;
@@ -1634,7 +1634,7 @@ SELECT ST_ASTEXT(
16341634
ST_GEOMFROMTEXT('MULTIPOLYGON(((2 9,-2 9,-3 -5)),((-10 6,1 6,3 -4,-1 6)))'),
16351635
ST_GEOMFROMTEXT('MULTIPOINT(8 -2,-2 -5,9 -9,-4 -10,-9 -4,10 -3,9 10,-1 -5,-3 3)')));
16361636

1637-
# replace_regex is used here instead of replace_numberic_round because
1637+
# replace_regex is used here instead of replace_numeric_round because
16381638
# on some compilers, the rounded off number differs from the expected result.
16391639
--replace_regex /([0-9]+\.[0-9]{4})[0-9]*/\1/ /([0-9]*\.[0-9]{2})[0-9]*(e[-+]*[0-9]+)/\1\2/
16401640
SELECT ST_ASTEXT(
@@ -2321,7 +2321,7 @@ SELECT ST_ISVALID(
23212321
--echo # BUG#20518038 : WL#7929 : ST_BUFFER() IS PRODUCING NON-CLOSED POLYGONS
23222322
--echo ######################################################################################################
23232323

2324-
--replace_numberic_round 4
2324+
--replace_numeric_round 4
23252325
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1)'), 1));
23262326

23272327
--echo ######################################################################################################
@@ -2331,7 +2331,7 @@ SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1)'), 1));
23312331
--echo # Scenario 1
23322332
SELECT ST_AREA(ST_BUFFER(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1)'), 1)) > 0;
23332333

2334-
--replace_numberic_round 4
2334+
--replace_numeric_round 4
23352335
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1)'), 1));
23362336

23372337
--echo # Scenario 2
@@ -2340,7 +2340,7 @@ SELECT ST_AREA(ST_BUFFER(ST_GEOMFROMTEXT('LINESTRING(1 1,1 1)'), 1)) > 0;
23402340
--error ER_GIS_INVALID_DATA
23412341
SELECT ST_AREA(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON(1 1,1 1,1 1,1 1)'), 1)) > 0;
23422342

2343-
--replace_numberic_round 4
2343+
--replace_numeric_round 4
23442344
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('LINESTRING(1 1,1 1)'), 1));
23452345

23462346
--error ER_GIS_INVALID_DATA
@@ -2349,36 +2349,36 @@ SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON(1 1,1 1,1 1,1 1)'), 1));
23492349
--echo # Scenario 3
23502350
SELECT ST_AREA(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))'), 1)) > 0;
23512351

2352-
--replace_numberic_round 4
2352+
--replace_numeric_round 4
23532353
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))'), 1));
23542354

23552355
--echo # Scenario 4
23562356
SELECT ST_AREA(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,0 8,0 0))'), 1)) > 0;
23572357

23582358
SELECT ST_AREA(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((1 1,10 10,0 8,1 1))'), 1)) > 0;
23592359

2360-
--replace_numberic_round 4
2360+
--replace_numeric_round 4
23612361
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,0 8,0 0))'), 1));
23622362

2363-
--replace_numberic_round 4
2363+
--replace_numeric_round 4
23642364
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((1 1,10 10,0 8,1 1))'), 1));
23652365

23662366
--echo # Scenario 5
23672367
SELECT ST_AREA(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((2 2,2 8,8 8,8 2,2 2))'), 1)) > 0;
23682368

23692369
SELECT ST_AREA(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((2 2,8 2,8 8,2 8,2 2))'), 1)) > 0;
23702370

2371-
--replace_numberic_round 4
2371+
--replace_numeric_round 4
23722372
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((2 2,2 8,8 8,8 2,2 2))'), 1));
23732373

2374-
--replace_numberic_round 4
2374+
--replace_numeric_round 4
23752375
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((2 2,8 2,8 8,2 8,2 2))'), 1));
23762376

23772377
--echo ######################################################################################################
23782378
--echo # BUG#20510010 : ST_BUFFER() : MYSQLD GOT SIGNAL 11
23792379
--echo ######################################################################################################
23802380

2381-
--replace_numberic_round 0
2381+
--replace_numeric_round 0
23822382
SELECT ST_ASTEXT(
23832383
ST_BUFFER(
23842384
ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
@@ -2389,13 +2389,13 @@ SELECT ST_ASTEXT(
23892389
--echo # BUG#20510359 : ST_BUFFER() RETURNS NULL INSTEAD OF AN EMPTY GEOMETRY
23902390
--echo ######################################################################################################
23912391

2392-
--replace_numberic_round 4
2392+
--replace_numeric_round 4
23932393
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))'), -10));
23942394

2395-
--replace_numberic_round 4
2395+
--replace_numeric_round 4
23962396
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))'), -8));
23972397

2398-
--replace_numberic_round 4
2398+
--replace_numeric_round 4
23992399
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))'), -6));
24002400

24012401
--echo ######################################################################################################
@@ -2415,10 +2415,10 @@ SELECT ST_ASTEXT(ST_BUFFER(0x010100000002000000000000000000000000000000, 1));
24152415
--echo # BUG#20558289 : ST_BUFFER() RETURNS EMPTY GEOMETRY WITH [MULTI]LINESTRING GEOMETRY
24162416
--echo ######################################################################################################
24172417

2418-
--replace_numberic_round 4
2418+
--replace_numeric_round 4
24192419
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('LINESTRING(0 0,10 10,10 0,0 10)'), 20, ST_BUFFER_STRATEGY('end_flat')));
24202420

2421-
--replace_numberic_round 4
2421+
--replace_numeric_round 4
24222422
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,10 10),(10 0,0 10))'), 50, ST_BUFFER_STRATEGY('end_flat')));
24232423

24242424
--echo ######################################################################################################
@@ -2456,7 +2456,7 @@ SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 5,
24562456
--echo # BUG#20607166 : SERVER IS HANGING WITH MULTIPOINT GEOMETRY AND '1' AS POINT_PER_CIRCLE' VALUE
24572457
--echo ######################################################################################################
24582458

2459-
--replace_numberic_round 4
2459+
--replace_numeric_round 4
24602460
SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('MULTIPOINT(5 13,9 -10,12 -7,-1 -16,-18 15,-13 -10,-1 5,12 -7)'), 1, ST_BUFFER_STRATEGY('point_circle',1)));
24612461

24622462
--echo ######################################################################################################

0 commit comments

Comments
 (0)