Skip to content

Commit 7585a5d

Browse files
author
Libing Song
committed
Bug#16028934 GTID FUNCTIONS ARE CONDITIONALLY COMPILED
Problem: Comment in item_create.c says: "do **NOT** conditionally (#ifdef, #ifndef) define a function". But gtid_subset and gtid_subtract were compiled only when HAVE_REPLICATION was defined. Fix: Removed the HAVE_REPLICATION condition for those two functions.
1 parent 030599b commit 7585a5d

5 files changed

Lines changed: 5 additions & 19 deletions

File tree

sql/item_create.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -1156,7 +1156,6 @@ class Create_func_greatest : public Create_native_func
11561156
};
11571157

11581158

1159-
#ifdef HAVE_REPLICATION
11601159
class Create_func_gtid_subtract : public Create_func_arg2
11611160
{
11621161
public:
@@ -1181,7 +1180,6 @@ class Create_func_gtid_subset : public Create_func_arg2
11811180
Create_func_gtid_subset() {}
11821181
virtual ~Create_func_gtid_subset() {}
11831182
};
1184-
#endif
11851183

11861184

11871185
class Create_func_hex : public Create_func_arg1
@@ -3975,7 +3973,6 @@ Create_func_greatest::create_native(THD *thd, LEX_STRING name,
39753973
}
39763974

39773975

3978-
#ifdef HAVE_REPLICATION
39793976
Create_func_gtid_subtract Create_func_gtid_subtract::s_singleton;
39803977

39813978
Item*
@@ -3992,7 +3989,6 @@ Create_func_gtid_subset::create(THD *thd, Item *arg1, Item *arg2)
39923989
{
39933990
return new (thd->mem_root) Item_func_gtid_subset(arg1, arg2);
39943991
}
3995-
#endif
39963992

39973993

39983994
Create_func_hex Create_func_hex::s_singleton;
@@ -5466,10 +5462,8 @@ static Native_func_registry func_array[] =
54665462
{ { C_STRING_WITH_LEN("GET_LOCK") }, BUILDER(Create_func_get_lock)},
54675463
{ { C_STRING_WITH_LEN("GLENGTH") }, GEOM_BUILDER(Create_func_glength)},
54685464
{ { C_STRING_WITH_LEN("GREATEST") }, BUILDER(Create_func_greatest)},
5469-
#ifdef HAVE_REPLICATION
54705465
{ { C_STRING_WITH_LEN("GTID_SUBTRACT") }, BUILDER(Create_func_gtid_subtract) },
54715466
{ { C_STRING_WITH_LEN("GTID_SUBSET") }, BUILDER(Create_func_gtid_subset) },
5472-
#endif
54735467
{ { C_STRING_WITH_LEN("HEX") }, BUILDER(Create_func_hex)},
54745468
{ { C_STRING_WITH_LEN("IFNULL") }, BUILDER(Create_func_ifnull)},
54755469
{ { C_STRING_WITH_LEN("INET_ATON") }, BUILDER(Create_func_inet_aton)},

sql/item_func.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -4102,7 +4102,6 @@ longlong Item_master_gtid_set_wait::val_int()
41024102
return event_count;
41034103
}
41044104

4105-
#ifdef HAVE_REPLICATION
41064105
/**
41074106
Return 1 if both arguments are Gtid_sets and the first is a subset
41084107
of the second. Generate an error if any of the arguments is not a
@@ -4138,7 +4137,6 @@ longlong Item_func_gtid_subset::val_int()
41384137
}
41394138
DBUG_RETURN(ret);
41404139
}
4141-
#endif
41424140

41434141

41444142
/**

sql/item_func.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef ITEM_FUNC_INCLUDED
22
#define ITEM_FUNC_INCLUDED
33

4-
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
4+
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
55
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -1596,7 +1596,6 @@ class Item_master_gtid_set_wait :public Item_int_func
15961596
void fix_length_and_dec() { max_length= 21; maybe_null= 1; }
15971597
};
15981598

1599-
#ifdef HAVE_REPLICATION
16001599
class Item_func_gtid_subset : public Item_int_func
16011600
{
16021601
String buf1;
@@ -1607,7 +1606,6 @@ class Item_func_gtid_subset : public Item_int_func
16071606
const char *func_name() const { return "gtid_subset"; }
16081607
void fix_length_and_dec() { max_length= 21; maybe_null= 0; }
16091608
};
1610-
#endif // if HAVE_REPLICATION
16111609

16121610

16131611
/**

sql/item_strfunc.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -4373,7 +4373,6 @@ String *Item_func_uuid::val_str(String *str)
43734373
}
43744374

43754375

4376-
#ifdef HAVE_REPLICATION
43774376
void Item_func_gtid_subtract::fix_length_and_dec()
43784377
{
43794378
maybe_null= args[0]->maybe_null || args[1]->maybe_null;
@@ -4430,4 +4429,3 @@ String *Item_func_gtid_subtract::val_str_ascii(String *str)
44304429
null_value= true;
44314430
DBUG_RETURN(NULL);
44324431
}
4433-
#endif // HAVE_REPLICATION

sql/item_strfunc.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef ITEM_STRFUNC_INCLUDED
22
#define ITEM_STRFUNC_INCLUDED
33

4-
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
4+
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
55
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -1019,7 +1019,6 @@ class Item_func_uuid: public Item_str_func
10191019
String *val_str(String *);
10201020
};
10211021

1022-
#ifdef HAVE_REPLICATION
10231022
class Item_func_gtid_subtract: public Item_str_ascii_func
10241023
{
10251024
String buf1, buf2;
@@ -1029,6 +1028,5 @@ class Item_func_gtid_subtract: public Item_str_ascii_func
10291028
const char *func_name() const{ return "gtid_subtract"; }
10301029
String *val_str_ascii(String *);
10311030
};
1032-
#endif // if HAVE_REPLICATION
10331031

10341032
#endif /* ITEM_STRFUNC_INCLUDED */

0 commit comments

Comments
 (0)