Commit 816dc4eb authored by Sinisa@sinisa.nasamreza.org's avatar Sinisa@sinisa.nasamreza.org
Browse files

Added functions :

* binary XOR
* logical XOR
* CHECK_LOCK("lock_name")
parent ade20c5b
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
@@ -49578,6 +49578,39 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
Added binary XOR. 
The one that with a query like :
select 11 ^ 3;
returns 8.
Based on the code originated  by Hartmut Holzgraefe <hartmut@six.de>.
@item
Added logical XOR.
The one that with a query like:
select 1 XOR 1;
returns 0;
Based on the code originated by Hartmut Holzgraefe <hartmut@six.de>.
@item
Add function CHEDK_LOCK("lock_name"). 
This function checks if the lock of the certain name is available or not. 
This function does not attempt to take a look.
It is used like this:
   SELECT CHECK_LOCK("some_lock");
it will return 1 if the lock is held by a process (including by
itself), 0 if it is currently not held by anyone and NULL on
errors.
Based on the code originated  by Hartmut Holzgraefe <hartmut@six.de>.
@item
Removed @code{mysql_ssl_clear()}, as this was not needed.
@item
@code{DECIMAL} and @code{NUMERIC} types can now read exponential numbers.
+6 −0
Original line number Diff line number Diff line
@@ -40,6 +40,12 @@ select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,
select -1.49 or -1.49,0.6 or 0.6;
-1.49 or -1.49	0.6 or 0.6
1	1
select 3 ^ 11;
3 ^ 11
8
select 1 XOR 0;
1 XOR 0
1
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
5 between 0 and 10 between 0 and 1	(5 between 0 and 10) between 0 and 1
0	1
+3 −0
Original line number Diff line number Diff line
@@ -17,4 +17,7 @@ get_lock("lock",3)
select * from t1;
n
1
select check_lock("lock");
check_lock("lock")
1
drop table t1;
+2 −1
Original line number Diff line number Diff line
@@ -15,7 +15,8 @@ select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between
select 'b' between 'a' and 'c', 'B' between 'a' and 'c';
select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0);
select -1.49 or -1.49,0.6 or 0.6;

select 3 ^ 11;
select 1 XOR 0;
#
# Wrong usage of functions
#
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ sync_with_master;
select get_lock("lock",3);
select * from t1;
connection master1;
select check_lock("lock");
drop table t1;
save_master_pos;
connection slave;
Loading