mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
This commit is contained in:
commit
be7c5c1900
88 changed files with 838 additions and 262 deletions
|
@ -1116,3 +1116,4 @@ vio/test-ssl
|
|||
vio/test-sslclient
|
||||
vio/test-sslserver
|
||||
vio/viotest-ssl
|
||||
ndb/src/dummy.cpp
|
||||
|
|
|
@ -136,7 +136,7 @@ unsigned long Crop(unsigned long value, unsigned int size)
|
|||
|
||||
|
||||
#if !(defined(_MSC_VER) && (_MSC_VER < 1300)) && \
|
||||
!(defined(__HP_aCC) && (__HP_aCC <= 35700))
|
||||
!(defined(__HP_aCC) && (__HP_aCC <= 36300))
|
||||
using std::new_handler;
|
||||
using std::set_new_handler;
|
||||
#endif
|
||||
|
|
|
@ -300,7 +300,7 @@ set @arg00=1;
|
|||
prepare stmt1 from ' select a,b from t1 order by a
|
||||
limit 1 ';
|
||||
execute stmt1 ;
|
||||
prepare stmt1 from ' select a,b from t1 limit ? ';
|
||||
prepare stmt1 from ' select a,b from t1 order by a limit ? ';
|
||||
execute stmt1 using @arg00;
|
||||
|
||||
##### parameter used in many places
|
||||
|
|
|
@ -58,6 +58,8 @@ INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05
|
|||
SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
|
||||
Kundentyp kategorie
|
||||
Privat (Private Nutzung) Mobilfunk
|
||||
Warnings:
|
||||
Warning 1052 Column 'kundentyp' in group statement is ambiguous
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
AUFNR varchar(12) NOT NULL default '',
|
||||
|
|
|
@ -344,3 +344,14 @@ select cast(s1 as decimal(7,2)) from t1;
|
|||
cast(s1 as decimal(7,2))
|
||||
111111.00
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
|
||||
mt mediumtext, lt longtext);
|
||||
INSERT INTO t1 VALUES ('1.01', '2.02', '3.03', '4.04', '5.05');
|
||||
SELECT CAST(v AS DECIMAL), CAST(tt AS DECIMAL), CAST(t AS DECIMAL),
|
||||
CAST(mt AS DECIMAL), CAST(lt AS DECIMAL) from t1;
|
||||
CAST(v AS DECIMAL) CAST(tt AS DECIMAL) CAST(t AS DECIMAL) CAST(mt AS DECIMAL) CAST(lt AS DECIMAL)
|
||||
1.01 2.02 3.03 4.04 5.05
|
||||
DROP TABLE t1;
|
||||
select cast(NULL as decimal(6)) as t1;
|
||||
t1
|
||||
NULL
|
||||
|
|
|
@ -16,3 +16,8 @@ explain select * from t1 where str <> default(str);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (id int(11), s varchar(20));
|
||||
INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three');
|
||||
SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL;
|
||||
ERROR HY000: Field 'mi' doesn't have a default value
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -146,3 +146,9 @@ drop table t1;
|
|||
select round(150, 2);
|
||||
round(150, 2)
|
||||
150.00
|
||||
select ceil(0.09);
|
||||
ceil(0.09)
|
||||
1
|
||||
select ceil(0.000000000000000009);
|
||||
ceil(0.000000000000000009)
|
||||
1
|
||||
|
|
|
@ -722,3 +722,27 @@ WHERE hostname LIKE '%aol%'
|
|||
GROUP BY hostname;
|
||||
hostname no
|
||||
cache-dtc-af05.proxy.aol.com 1
|
||||
drop table if exists t1, t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't2'
|
||||
create table t1 (c1 char(3), c2 char(3));
|
||||
create table t2 (c3 char(3), c4 char(3));
|
||||
insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2');
|
||||
insert into t2 values ('aaa', 'bb1'), ('aaa', 'bb2');
|
||||
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
|
||||
group by c2;
|
||||
c2
|
||||
aaa
|
||||
aaa
|
||||
Warnings:
|
||||
Warning 1052 Column 'c2' in group statement is ambiguous
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 1052 Column 'c2' in group statement is ambiguous
|
||||
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
|
||||
group by t1.c1;
|
||||
c2
|
||||
aaa
|
||||
show warnings;
|
||||
Level Code Message
|
||||
drop table t1, t2;
|
||||
|
|
|
@ -1954,6 +1954,24 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
explain select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 163 NULL 128 Using where; Using index
|
||||
explain select a1 from t1 where a2 = 'b' group by a1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL idx_t1_1 130 NULL 5 Using where; Using index for group-by
|
||||
select a1 from t1 where a2 = 'b' group by a1;
|
||||
a1
|
||||
a
|
||||
b
|
||||
c
|
||||
d
|
||||
explain select distinct a1 from t1 where a2 = 'b';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL idx_t1_1 130 NULL 5 Using where; Using index for group-by
|
||||
select distinct a1 from t1 where a2 = 'b';
|
||||
a1
|
||||
a
|
||||
b
|
||||
c
|
||||
d
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
|
|
|
@ -304,6 +304,7 @@ s1
|
|||
0
|
||||
0
|
||||
Warnings:
|
||||
Warning 1052 Column 's1' in group statement is ambiguous
|
||||
Warning 1052 Column 's1' in having clause is ambiguous
|
||||
select s1*0 from t1 group by s1 having s1 = 0;
|
||||
s1*0
|
||||
|
|
|
@ -1321,3 +1321,25 @@ NULL NULL NULL
|
|||
18 NULL NULL
|
||||
19 NULL NULL
|
||||
DROP TABLE t1,t2,t3;
|
||||
CREATE TABLE t1 (c11 int);
|
||||
CREATE TABLE t2 (c21 int);
|
||||
CREATE TABLE t3 (c31 int);
|
||||
INSERT INTO t1 VALUES (4), (5);
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
|
||||
c11 c21
|
||||
4 NULL
|
||||
5 NULL
|
||||
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 system NULL NULL NULL NULL 0 const row not found
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
|
||||
SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
|
||||
c11 c21 c31
|
||||
4 NULL NULL
|
||||
5 NULL NULL
|
||||
EXPLAIN SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 0
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 0
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
|
|
@ -975,3 +975,11 @@ EMPNUM NAME GRP
|
|||
0 KERI 10
|
||||
9 BARRY NULL
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (c11 int);
|
||||
CREATE TABLE t2 (c21 int);
|
||||
INSERT INTO t1 VALUES (30), (40), (50);
|
||||
INSERT INTO t2 VALUES (300), (400), (500);
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON (c11=c21 AND c21=30) WHERE c11=40;
|
||||
c11 c21
|
||||
40 NULL
|
||||
DROP TABLE t1, t2;
|
||||
|
|
|
@ -36,3 +36,10 @@ lock table t1 write, t2 write;
|
|||
drop table t2;
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
drop table t1;
|
||||
create table t1(a int);
|
||||
lock tables t1 write;
|
||||
show columns from t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) YES NULL
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
|
|
|
@ -48,3 +48,9 @@ Test 'go' command g
|
|||
a
|
||||
1
|
||||
drop table t1;
|
||||
create table t1(a int);
|
||||
lock tables t1 write;
|
||||
database()
|
||||
test
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa;
|
||||
drop database if exists mysqldump_test_db;
|
||||
drop view if exists v1;
|
||||
drop database if exists db1;
|
||||
drop view if exists v1, v2;
|
||||
CREATE TABLE t1(a int);
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
<?xml version="1.0"?>
|
||||
|
@ -1422,3 +1423,51 @@ UNLOCK TABLES;
|
|||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
create database db1;
|
||||
use db1;
|
||||
CREATE TABLE t2 (
|
||||
a varchar(30) default NULL,
|
||||
KEY a (a(5))
|
||||
);
|
||||
INSERT INTO t2 VALUES ('alfred');
|
||||
INSERT INTO t2 VALUES ('angie');
|
||||
INSERT INTO t2 VALUES ('bingo');
|
||||
INSERT INTO t2 VALUES ('waffle');
|
||||
INSERT INTO t2 VALUES ('lemon');
|
||||
create view v2 as select * from t2 where a like 'a%' with check option;
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
CREATE TABLE `t2` (
|
||||
`a` varchar(30) default NULL,
|
||||
KEY `a` (`a`(5))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
|
||||
LOCK TABLES `t2` WRITE;
|
||||
INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
|
||||
UNLOCK TABLES;
|
||||
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
DROP VIEW IF EXISTS `v2`;
|
||||
CREATE ALGORITHM=UNDEFINED VIEW `db1`.`v2` AS select `db1`.`t2`.`a` AS `a` from `db1`.`t2` where (`db1`.`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
drop table t2;
|
||||
drop view v2;
|
||||
drop database db1;
|
||||
|
|
|
@ -444,7 +444,7 @@ limit 1 ';
|
|||
execute stmt1 ;
|
||||
a b
|
||||
1 one
|
||||
prepare stmt1 from ' select a,b from t1 limit ? ';
|
||||
prepare stmt1 from ' select a,b from t1 order by a limit ? ';
|
||||
execute stmt1 using @arg00;
|
||||
a b
|
||||
1 one
|
||||
|
|
|
@ -444,7 +444,7 @@ limit 1 ';
|
|||
execute stmt1 ;
|
||||
a b
|
||||
1 one
|
||||
prepare stmt1 from ' select a,b from t1 limit ? ';
|
||||
prepare stmt1 from ' select a,b from t1 order by a limit ? ';
|
||||
execute stmt1 using @arg00;
|
||||
a b
|
||||
1 one
|
||||
|
|
|
@ -445,7 +445,7 @@ limit 1 ';
|
|||
execute stmt1 ;
|
||||
a b
|
||||
1 one
|
||||
prepare stmt1 from ' select a,b from t1 limit ? ';
|
||||
prepare stmt1 from ' select a,b from t1 order by a limit ? ';
|
||||
execute stmt1 using @arg00;
|
||||
a b
|
||||
1 one
|
||||
|
|
|
@ -487,7 +487,7 @@ limit 1 ';
|
|||
execute stmt1 ;
|
||||
a b
|
||||
1 one
|
||||
prepare stmt1 from ' select a,b from t1 limit ? ';
|
||||
prepare stmt1 from ' select a,b from t1 order by a limit ? ';
|
||||
execute stmt1 using @arg00;
|
||||
a b
|
||||
1 one
|
||||
|
@ -3499,7 +3499,7 @@ limit 1 ';
|
|||
execute stmt1 ;
|
||||
a b
|
||||
1 one
|
||||
prepare stmt1 from ' select a,b from t1 limit ? ';
|
||||
prepare stmt1 from ' select a,b from t1 order by a limit ? ';
|
||||
execute stmt1 using @arg00;
|
||||
a b
|
||||
1 one
|
||||
|
|
|
@ -444,7 +444,7 @@ limit 1 ';
|
|||
execute stmt1 ;
|
||||
a b
|
||||
1 one
|
||||
prepare stmt1 from ' select a,b from t1 limit ? ';
|
||||
prepare stmt1 from ' select a,b from t1 order by a limit ? ';
|
||||
execute stmt1 using @arg00;
|
||||
a b
|
||||
1 one
|
||||
|
|
|
@ -444,10 +444,10 @@ limit 1 ';
|
|||
execute stmt1 ;
|
||||
a b
|
||||
1 one
|
||||
prepare stmt1 from ' select a,b from t1 limit ? ';
|
||||
prepare stmt1 from ' select a,b from t1 order by a limit ? ';
|
||||
execute stmt1 using @arg00;
|
||||
a b
|
||||
3 three
|
||||
1 one
|
||||
set @arg00='b' ;
|
||||
set @arg01=0 ;
|
||||
set @arg02=2 ;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -168,3 +168,20 @@ create table t1(s1 time);
|
|||
insert into t1 values ('11:11:11');
|
||||
select cast(s1 as decimal(7,2)) from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test for bug #11283: field conversion from varchar, and text types to decimal
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
|
||||
mt mediumtext, lt longtext);
|
||||
INSERT INTO t1 VALUES ('1.01', '2.02', '3.03', '4.04', '5.05');
|
||||
|
||||
SELECT CAST(v AS DECIMAL), CAST(tt AS DECIMAL), CAST(t AS DECIMAL),
|
||||
CAST(mt AS DECIMAL), CAST(lt AS DECIMAL) from t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
# Bug @10237 (CAST(NULL DECIMAL) crashes server)
|
||||
#
|
||||
select cast(NULL as decimal(6)) as t1;
|
||||
|
||||
|
|
|
@ -16,4 +16,14 @@ explain select * from t1 where str <> default(str);
|
|||
#show create table from t1;
|
||||
#insert into t2 select select default(str), default(strnull), default(intg), default(rel) from t1;
|
||||
|
||||
drop table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #11314 (HAVING DEFAULT() hangs)
|
||||
#
|
||||
CREATE TABLE t1 (id int(11), s varchar(20));
|
||||
INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three');
|
||||
--error 1364
|
||||
SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
|
|
@ -84,3 +84,10 @@ drop table t1;
|
|||
# Bug #10083 (round doesn't increase decimals)
|
||||
#
|
||||
select round(150, 2);
|
||||
|
||||
#
|
||||
# Bug @10632 (Ceiling function returns wrong answer)
|
||||
#
|
||||
select ceil(0.09);
|
||||
select ceil(0.000000000000000009);
|
||||
|
||||
|
|
|
@ -539,3 +539,26 @@ SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
|
|||
WHERE hostname LIKE '%aol%'
|
||||
GROUP BY hostname;
|
||||
|
||||
#
|
||||
# Bug#11211: Ambiguous column reference in GROUP BY.
|
||||
#
|
||||
|
||||
drop table if exists t1, t2;
|
||||
create table t1 (c1 char(3), c2 char(3));
|
||||
create table t2 (c3 char(3), c4 char(3));
|
||||
insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2');
|
||||
insert into t2 values ('aaa', 'bb1'), ('aaa', 'bb2');
|
||||
|
||||
# query with ambiguous column reference 'c2'
|
||||
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
|
||||
group by c2;
|
||||
|
||||
show warnings;
|
||||
|
||||
# this query has no ambiguity
|
||||
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
|
||||
group by t1.c1;
|
||||
|
||||
show warnings;
|
||||
|
||||
drop table t1, t2;
|
||||
|
|
|
@ -482,7 +482,6 @@ select a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
|
|||
select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
|
||||
select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
|
||||
|
||||
--
|
||||
-- DISTINCT queries
|
||||
--
|
||||
|
@ -526,6 +525,7 @@ select distinct a1,a1 from t1;
|
|||
select distinct a2,a1,a2,a1 from t1;
|
||||
select distinct t1.a1,t2.a1 from t1,t2;
|
||||
|
||||
|
||||
--
|
||||
-- DISTINCT queries with GROUP-BY
|
||||
--
|
||||
|
@ -641,6 +641,17 @@ explain select a1,a2,count(a2) from t1 group by a1,a2,b;
|
|||
explain select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b;
|
||||
explain select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
|
||||
|
||||
#
|
||||
# BUG#11044: DISTINCT or GROUP BY queries with equality predicates instead of MIN/MAX.
|
||||
#
|
||||
|
||||
explain select a1 from t1 where a2 = 'b' group by a1;
|
||||
select a1 from t1 where a2 = 'b' group by a1;
|
||||
|
||||
explain select distinct a1 from t1 where a2 = 'b';
|
||||
select distinct a1 from t1 where a2 = 'b';
|
||||
|
||||
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
|
|
|
@ -752,3 +752,21 @@ EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
|
|||
SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
|
||||
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
#
|
||||
# Test for bug #11284: empty table in a nested left join
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c11 int);
|
||||
CREATE TABLE t2 (c21 int);
|
||||
CREATE TABLE t3 (c31 int);
|
||||
|
||||
INSERT INTO t1 VALUES (4), (5);
|
||||
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
|
||||
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
|
||||
|
||||
SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
|
||||
EXPLAIN SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
|
||||
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
|
|
@ -698,4 +698,16 @@ SELECT * FROM v1 WHERE EMPNUM < 10;
|
|||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Test for bug #11285: false Item_equal on expression in outer join
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c11 int);
|
||||
CREATE TABLE t2 (c21 int);
|
||||
INSERT INTO t1 VALUES (30), (40), (50);
|
||||
INSERT INTO t2 VALUES (300), (400), (500);
|
||||
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON (c11=c21 AND c21=30) WHERE c11=40;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
|
|
@ -94,3 +94,15 @@ connection reader;
|
|||
reap;
|
||||
connection locker;
|
||||
drop table t1;
|
||||
|
||||
|
||||
#
|
||||
# BUG#9998 - MySQL client hangs on USE "database"
|
||||
|
||||
create table t1(a int);
|
||||
lock tables t1 write;
|
||||
connection reader;
|
||||
show columns from t1;
|
||||
connection locker;
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
|
|
|
@ -30,5 +30,14 @@ select "Test 'go' command(vertical output) \G" as " ";
|
|||
select "Test 'go' command \g" as " ";
|
||||
--exec $MYSQL test -e 'select * from t1\g'
|
||||
--enable_query_log
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG9998 - MySQL client hangs on USE "database"
|
||||
#
|
||||
create table t1(a int);
|
||||
lock tables t1 write;
|
||||
--exec $MYSQL -e 'use test; select database();'
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa;
|
||||
drop database if exists mysqldump_test_db;
|
||||
drop view if exists v1;
|
||||
drop database if exists db1;
|
||||
drop view if exists v1, v2;
|
||||
--enable_warnings
|
||||
|
||||
# XML output
|
||||
|
@ -563,3 +564,27 @@ CREATE TABLE t1 (a int);
|
|||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
--exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
#
|
||||
# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
|
||||
#
|
||||
|
||||
create database db1;
|
||||
use db1;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
a varchar(30) default NULL,
|
||||
KEY a (a(5))
|
||||
);
|
||||
|
||||
INSERT INTO t2 VALUES ('alfred');
|
||||
INSERT INTO t2 VALUES ('angie');
|
||||
INSERT INTO t2 VALUES ('bingo');
|
||||
INSERT INTO t2 VALUES ('waffle');
|
||||
INSERT INTO t2 VALUES ('lemon');
|
||||
create view v2 as select * from t2 where a like 'a%' with check option;
|
||||
--exec $MYSQL_DUMP --skip-comments db1
|
||||
drop table t2;
|
||||
drop view v2;
|
||||
drop database db1;
|
||||
|
|
|
@ -756,4 +756,36 @@ flush query cache;
|
|||
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# SP cursors and selects with query cache (BUG#9715)
|
||||
#
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2);
|
||||
|
||||
delimiter //;
|
||||
CREATE PROCEDURE `p1`()
|
||||
begin
|
||||
Declare c1 cursor for select a from t1;
|
||||
open c1;
|
||||
select * from t1;
|
||||
end//
|
||||
call p1()//
|
||||
drop procedure p1;
|
||||
|
||||
create function f1() returns int
|
||||
begin
|
||||
Declare var1 int;
|
||||
select max(a) from t1 into var1;
|
||||
return var1;
|
||||
end//
|
||||
create procedure `p1`()
|
||||
begin
|
||||
select a, f1() from t1;
|
||||
end//
|
||||
call p1()//
|
||||
drop procedure p1//
|
||||
|
||||
drop table t1//
|
||||
delimiter ;//
|
||||
|
||||
set GLOBAL query_cache_size=0;
|
||||
|
|
|
@ -914,7 +914,7 @@ static void init_default_directories()
|
|||
/* Only add shared system directory if different from default. */
|
||||
if (GetSystemWindowsDirectory(shared_system_dir,sizeof(shared_system_dir)) &&
|
||||
strcmp(system_dir, shared_system_dir))
|
||||
*ptr++= &shared_system_dir;
|
||||
*ptr++= (char *)&shared_system_dir;
|
||||
#endif
|
||||
|
||||
#elif defined(__NETWARE__)
|
||||
|
|
|
@ -58,8 +58,8 @@ int modify_defaults_file(const char *file_location, const char *option,
|
|||
if (my_fstat(fileno(cnf_file), &file_stat, MYF(0)))
|
||||
goto err;
|
||||
|
||||
optlen= strlen(option);
|
||||
optval_len= strlen(option_value);
|
||||
optlen= (uint) strlen(option);
|
||||
optval_len= (uint) strlen(option_value);
|
||||
|
||||
/*
|
||||
Reserve space to read the contents of the file and some more
|
||||
|
@ -79,7 +79,7 @@ int modify_defaults_file(const char *file_location, const char *option,
|
|||
FN_REFLEN), MYF(MY_WME))))
|
||||
goto malloc_err;
|
||||
|
||||
sect_len= strlen(section_name);
|
||||
sect_len= (uint) strlen(section_name);
|
||||
|
||||
for (dst_ptr= file_buffer; fgets(linebuff, BUFF_SIZE, cnf_file); )
|
||||
{
|
||||
|
|
|
@ -601,7 +601,7 @@ int _my_b_read_r(register IO_CACHE *info, byte *Buffer, uint Count)
|
|||
info->error= info->share->active->error;
|
||||
info->read_end= info->share->active->read_end;
|
||||
info->pos_in_file= info->share->active->pos_in_file;
|
||||
len= (info->error == -1 ? -1 : info->read_end-info->buffer);
|
||||
len= (int) (info->error == -1 ? -1 : info->read_end-info->buffer);
|
||||
}
|
||||
info->read_pos=info->buffer;
|
||||
info->seek_not_done=0;
|
||||
|
|
|
@ -2191,7 +2191,7 @@ static int flush_cached_blocks(KEY_CACHE *keycache,
|
|||
{
|
||||
int error;
|
||||
int last_errno= 0;
|
||||
uint count= end-cache;
|
||||
uint count= (uint) (end-cache);
|
||||
|
||||
/* Don't lock the cache during the flush */
|
||||
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
||||
|
|
|
@ -333,7 +333,7 @@ void set_prealloc_root(MEM_ROOT *root, char *ptr)
|
|||
|
||||
char *strdup_root(MEM_ROOT *root,const char *str)
|
||||
{
|
||||
return strmake_root(root, str, strlen(str));
|
||||
return strmake_root(root, str, (uint) strlen(str));
|
||||
}
|
||||
|
||||
char *strmake_root(MEM_ROOT *root,const char *str, uint len)
|
||||
|
|
|
@ -180,7 +180,7 @@ int handle_options(int *argc, char ***argv,
|
|||
}
|
||||
opt_str= check_struct_option(cur_arg, key_name);
|
||||
optend= strcend(opt_str, '=');
|
||||
length= optend - opt_str;
|
||||
length= (uint) (optend - opt_str);
|
||||
if (*optend == '=')
|
||||
optend++;
|
||||
else
|
||||
|
@ -323,7 +323,7 @@ int handle_options(int *argc, char ***argv,
|
|||
return EXIT_NO_ARGUMENT_ALLOWED;
|
||||
}
|
||||
value= optp->var_type & GET_ASK_ADDR ?
|
||||
(*getopt_get_addr)(key_name, strlen(key_name), optp) : optp->value;
|
||||
(*getopt_get_addr)(key_name, (uint) strlen(key_name), optp) : optp->value;
|
||||
|
||||
if (optp->arg_type == NO_ARG)
|
||||
{
|
||||
|
@ -519,7 +519,7 @@ static char *check_struct_option(char *cur_arg, char *key_name)
|
|||
*/
|
||||
if (end - ptr > 1)
|
||||
{
|
||||
uint len= ptr - cur_arg;
|
||||
uint len= (uint) (ptr - cur_arg);
|
||||
set_if_smaller(len, FN_REFLEN-1);
|
||||
strmake(key_name, cur_arg, len);
|
||||
return ++ptr;
|
||||
|
@ -833,7 +833,7 @@ void my_print_help(const struct my_option *options)
|
|||
if (strlen(optp->name))
|
||||
{
|
||||
printf("--%s", optp->name);
|
||||
col+= 2 + strlen(optp->name);
|
||||
col+= 2 + (uint) strlen(optp->name);
|
||||
if ((optp->var_type & GET_TYPE_MASK) == GET_STR ||
|
||||
(optp->var_type & GET_TYPE_MASK) == GET_STR_ALLOC)
|
||||
{
|
||||
|
@ -904,7 +904,7 @@ void my_print_variables(const struct my_option *options)
|
|||
if (value)
|
||||
{
|
||||
printf("%s", optp->name);
|
||||
length= strlen(optp->name);
|
||||
length= (uint) strlen(optp->name);
|
||||
for (; length < name_space; length++)
|
||||
putchar(' ');
|
||||
switch ((optp->var_type & GET_TYPE_MASK)) {
|
||||
|
|
|
@ -53,7 +53,7 @@ void *my_mmap(void *addr, size_t len, int prot,
|
|||
flProtect|=SEC_COMMIT;
|
||||
|
||||
hFileMap=CreateFileMapping(hFile, &mmap_security_attributes,
|
||||
PAGE_READWRITE, 0, len, NULL);
|
||||
PAGE_READWRITE, 0, (DWORD) len, NULL);
|
||||
if (hFileMap == 0)
|
||||
return MAP_FAILED;
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ gptr my_once_alloc(unsigned int Size, myf MyFlags)
|
|||
|
||||
char *my_once_strdup(const char *src,myf myflags)
|
||||
{
|
||||
uint len=strlen(src)+1;
|
||||
uint len= (uint) strlen(src)+1;
|
||||
char *dst=my_once_alloc(len, myflags);
|
||||
if (dst)
|
||||
memcpy(dst, src, len);
|
||||
|
|
|
@ -91,7 +91,7 @@ my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size)
|
|||
|
||||
my_bool dynstr_append(DYNAMIC_STRING *str, const char *append)
|
||||
{
|
||||
return dynstr_append_mem(str,append,strlen(append));
|
||||
return dynstr_append_mem(str,append,(uint) strlen(append));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -343,6 +343,7 @@ void start_master()
|
|||
add_arg(&al, "--character-sets-dir=%s", char_dir);
|
||||
add_arg(&al, "--tmpdir=%s", mysql_tmp_dir);
|
||||
add_arg(&al, "--language=%s", lang_dir);
|
||||
add_arg(&al, "--log-bin-trust-routine-creators");
|
||||
#ifdef DEBUG //only for debug builds
|
||||
add_arg(&al, "--debug");
|
||||
#endif
|
||||
|
@ -516,6 +517,7 @@ void start_slave()
|
|||
add_arg(&al, "--master-retry-count=10");
|
||||
add_arg(&al, "-O");
|
||||
add_arg(&al, "slave_net_timeout=10");
|
||||
add_arg(&al, "--log-bin-trust-routine-creators");
|
||||
#ifdef DEBUG //only for debug builds
|
||||
add_arg(&al, "--debug");
|
||||
#endif
|
||||
|
@ -1164,6 +1166,8 @@ void setup(char *file)
|
|||
setenv("MYSQL_CLIENT_TEST",file_path,1);
|
||||
snprintf(file_path, PATH_MAX*2, "%s/mysql --no-defaults --user=root --port=%u ", bin_dir, master_port);
|
||||
setenv("MYSQL",file_path,1);
|
||||
snprintf(file_path, PATH_MAX*2, "%s/mysqlshow --no-defaults --user=root --port=%u", bin_dir, master_port);
|
||||
setenv("MYSQL_SHOW",file_path,1);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
DESCRIPTION
|
||||
|
||||
Function to add a string to the buffer. It is different from
|
||||
store_to_string, which is used in the protocol.cc. The last
|
||||
store_to_protocol_packet, which is used in the protocol.cc. The last
|
||||
one also stores the length of the string in a special way.
|
||||
This is required for MySQL client/server protocol support only.
|
||||
|
||||
|
@ -104,11 +104,12 @@ int Show_instances::execute(struct st_net *net, ulong connection_id)
|
|||
while ((instance= iterator.next()))
|
||||
{
|
||||
position= 0;
|
||||
store_to_string(&send_buff, instance->options.instance_name, &position);
|
||||
store_to_protocol_packet(&send_buff, instance->options.instance_name,
|
||||
&position);
|
||||
if (instance->is_running())
|
||||
store_to_string(&send_buff, (char*) "online", &position);
|
||||
store_to_protocol_packet(&send_buff, (char*) "online", &position);
|
||||
else
|
||||
store_to_string(&send_buff, (char*) "offline", &position);
|
||||
store_to_protocol_packet(&send_buff, (char*) "offline", &position);
|
||||
if (my_net_write(net, send_buff.buffer, (uint) position))
|
||||
goto err;
|
||||
}
|
||||
|
@ -199,18 +200,19 @@ int Show_instance_status::execute(struct st_net *net,
|
|||
{
|
||||
Instance *instance;
|
||||
|
||||
store_to_string(&send_buff, (char*) instance_name, &position);
|
||||
store_to_protocol_packet(&send_buff, (char*) instance_name, &position);
|
||||
if (!(instance= instance_map->find(instance_name, strlen(instance_name))))
|
||||
goto err;
|
||||
if (instance->is_running())
|
||||
store_to_string(&send_buff, (char*) "online", &position);
|
||||
store_to_protocol_packet(&send_buff, (char*) "online", &position);
|
||||
else
|
||||
store_to_string(&send_buff, (char*) "offline", &position);
|
||||
store_to_protocol_packet(&send_buff, (char*) "offline", &position);
|
||||
|
||||
if (instance->options.mysqld_version)
|
||||
store_to_string(&send_buff, instance->options.mysqld_version, &position);
|
||||
store_to_protocol_packet(&send_buff, instance->options.mysqld_version,
|
||||
&position);
|
||||
else
|
||||
store_to_string(&send_buff, (char*) "unknown", &position);
|
||||
store_to_protocol_packet(&send_buff, (char*) "unknown", &position);
|
||||
|
||||
|
||||
if (send_buff.is_error() ||
|
||||
|
@ -272,17 +274,17 @@ int Show_instance_options::execute(struct st_net *net, ulong connection_id)
|
|||
|
||||
if (!(instance= instance_map->find(instance_name, strlen(instance_name))))
|
||||
goto err;
|
||||
store_to_string(&send_buff, (char*) "instance_name", &position);
|
||||
store_to_string(&send_buff, (char*) instance_name, &position);
|
||||
store_to_protocol_packet(&send_buff, (char*) "instance_name", &position);
|
||||
store_to_protocol_packet(&send_buff, (char*) instance_name, &position);
|
||||
if (my_net_write(net, send_buff.buffer, (uint) position))
|
||||
goto err;
|
||||
if ((instance->options.mysqld_path))
|
||||
{
|
||||
position= 0;
|
||||
store_to_string(&send_buff, (char*) "mysqld-path", &position);
|
||||
store_to_string(&send_buff,
|
||||
(char*) instance->options.mysqld_path,
|
||||
&position);
|
||||
store_to_protocol_packet(&send_buff, (char*) "mysqld-path", &position);
|
||||
store_to_protocol_packet(&send_buff,
|
||||
(char*) instance->options.mysqld_path,
|
||||
&position);
|
||||
if (send_buff.is_error() ||
|
||||
my_net_write(net, send_buff.buffer, (uint) position))
|
||||
goto err;
|
||||
|
@ -291,8 +293,8 @@ int Show_instance_options::execute(struct st_net *net, ulong connection_id)
|
|||
if ((instance->options.nonguarded))
|
||||
{
|
||||
position= 0;
|
||||
store_to_string(&send_buff, (char*) "nonguarded", &position);
|
||||
store_to_string(&send_buff, "", &position);
|
||||
store_to_protocol_packet(&send_buff, (char*) "nonguarded", &position);
|
||||
store_to_protocol_packet(&send_buff, "", &position);
|
||||
if (send_buff.is_error() ||
|
||||
my_net_write(net, send_buff.buffer, (uint) position))
|
||||
goto err;
|
||||
|
@ -310,13 +312,16 @@ int Show_instance_options::execute(struct st_net *net, ulong connection_id)
|
|||
if (option_value != NULL)
|
||||
{
|
||||
*option_value= 0;
|
||||
store_to_string(&send_buff, tmp_option + 2, &position);
|
||||
store_to_string(&send_buff, option_value + 1, &position);
|
||||
store_to_protocol_packet(&send_buff, tmp_option + 2, &position);
|
||||
store_to_protocol_packet(&send_buff, option_value + 1, &position);
|
||||
/* join name and the value into the same option again */
|
||||
*option_value= '=';
|
||||
}
|
||||
else
|
||||
store_to_string(&send_buff, tmp_option + 2, &position);
|
||||
{
|
||||
store_to_protocol_packet(&send_buff, tmp_option + 2, &position);
|
||||
store_to_protocol_packet(&send_buff, "", &position);
|
||||
}
|
||||
|
||||
if (send_buff.is_error() ||
|
||||
my_net_write(net, send_buff.buffer, (uint) position))
|
||||
|
@ -478,7 +483,7 @@ int Show_instance_log::execute(struct st_net *net, ulong connection_id)
|
|||
char *bf= (char*) malloc(sizeof(char)*buff_size);
|
||||
if ((read_len= my_read(fd, bf, buff_size, MYF(0))) < 0)
|
||||
return ER_READ_FILE;
|
||||
store_to_string(&send_buff, (char*) bf, &position, read_len);
|
||||
store_to_protocol_packet(&send_buff, (char*) bf, &position, read_len);
|
||||
close(fd);
|
||||
}
|
||||
else
|
||||
|
@ -593,19 +598,19 @@ int Show_instance_log_files::execute(struct st_net *net, ulong connection_id)
|
|||
|
||||
position= 0;
|
||||
/* store the type of the log in the send buffer */
|
||||
store_to_string(&send_buff, log_files->name, &position);
|
||||
store_to_protocol_packet(&send_buff, log_files->name, &position);
|
||||
if (stat(log_files->value, &file_stat))
|
||||
{
|
||||
store_to_string(&send_buff, "", &position);
|
||||
store_to_string(&send_buff, (char*) "0", &position);
|
||||
store_to_protocol_packet(&send_buff, "", &position);
|
||||
store_to_protocol_packet(&send_buff, (char*) "0", &position);
|
||||
}
|
||||
else if (S_ISREG(file_stat.st_mode))
|
||||
{
|
||||
store_to_string(&send_buff,
|
||||
(char*) log_files->value,
|
||||
&position);
|
||||
store_to_protocol_packet(&send_buff,
|
||||
(char*) log_files->value,
|
||||
&position);
|
||||
int10_to_str(file_stat.st_size, buff, 10);
|
||||
store_to_string(&send_buff, (char*) buff, &position);
|
||||
store_to_protocol_packet(&send_buff, (char*) buff, &position);
|
||||
}
|
||||
|
||||
if (my_net_write(net, send_buff.buffer, (uint) position))
|
||||
|
|
|
@ -58,7 +58,7 @@ int net_send_ok(struct st_net *net, unsigned long connection_id,
|
|||
if (message != NULL)
|
||||
{
|
||||
buff.reserve(position, 9 + strlen(message));
|
||||
store_to_string(&buff, message, &position);
|
||||
store_to_protocol_packet(&buff, message, &position);
|
||||
}
|
||||
|
||||
return my_net_write(net, buff.buffer, position) || net_flush(net);
|
||||
|
@ -117,8 +117,8 @@ char *net_store_length(char *pkg, uint length)
|
|||
}
|
||||
|
||||
|
||||
int store_to_string(Buffer *buf, const char *string, uint *position,
|
||||
uint string_len)
|
||||
int store_to_protocol_packet(Buffer *buf, const char *string, uint *position,
|
||||
uint string_len)
|
||||
{
|
||||
uint currpos;
|
||||
|
||||
|
@ -137,12 +137,12 @@ err:
|
|||
}
|
||||
|
||||
|
||||
int store_to_string(Buffer *buf, const char *string, uint *position)
|
||||
int store_to_protocol_packet(Buffer *buf, const char *string, uint *position)
|
||||
{
|
||||
uint string_len;
|
||||
|
||||
string_len= strlen(string);
|
||||
return store_to_string(buf, string, position, string_len);
|
||||
return store_to_protocol_packet(buf, string, position, string_len);
|
||||
}
|
||||
|
||||
|
||||
|
@ -176,21 +176,28 @@ int send_fields(struct st_net *net, LIST *fields)
|
|||
position= 0;
|
||||
field= (NAME_WITH_LENGTH *) tmp->data;
|
||||
|
||||
store_to_string(&send_buff, (char*) "", &position); /* catalog name */
|
||||
store_to_string(&send_buff, (char*) "", &position); /* db name */
|
||||
store_to_string(&send_buff, (char*) "", &position); /* table name */
|
||||
store_to_string(&send_buff, (char*) "", &position); /* table name alias */
|
||||
store_to_string(&send_buff, field->name, &position); /* column name */
|
||||
store_to_string(&send_buff, field->name, &position); /* column name alias */
|
||||
store_to_protocol_packet(&send_buff,
|
||||
(char*) "", &position); /* catalog name */
|
||||
store_to_protocol_packet(&send_buff,
|
||||
(char*) "", &position); /* db name */
|
||||
store_to_protocol_packet(&send_buff,
|
||||
(char*) "", &position); /* table name */
|
||||
store_to_protocol_packet(&send_buff,
|
||||
(char*) "", &position); /* table name alias */
|
||||
store_to_protocol_packet(&send_buff,
|
||||
field->name, &position); /* column name */
|
||||
store_to_protocol_packet(&send_buff,
|
||||
field->name, &position); /* column name alias */
|
||||
send_buff.reserve(position, 12);
|
||||
if (send_buff.is_error())
|
||||
goto err;
|
||||
send_buff.buffer[position++]= 12;
|
||||
int2store(send_buff.buffer + position, 1); /* charsetnr */
|
||||
int4store(send_buff.buffer + position + 2, field->length); /* field length */
|
||||
send_buff.buffer[position+6]= FIELD_TYPE_STRING; /* type */
|
||||
int2store(send_buff.buffer + position + 7, 0); /* flags */
|
||||
send_buff.buffer[position + 9]= (char) 0; /* decimals */
|
||||
int2store(send_buff.buffer + position, 1); /* charsetnr */
|
||||
int4store(send_buff.buffer + position + 2,
|
||||
field->length); /* field length */
|
||||
send_buff.buffer[position+6]= FIELD_TYPE_STRING; /* type */
|
||||
int2store(send_buff.buffer + position + 7, 0); /* flags */
|
||||
send_buff.buffer[position + 9]= (char) 0; /* decimals */
|
||||
send_buff.buffer[position + 10]= 0;
|
||||
send_buff.buffer[position + 11]= 0;
|
||||
position+= 12;
|
||||
|
|
|
@ -41,10 +41,10 @@ int send_fields(struct st_net *net, LIST *fields);
|
|||
|
||||
char *net_store_length(char *pkg, uint length);
|
||||
|
||||
int store_to_string(Buffer *buf, const char *string, uint *position);
|
||||
int store_to_protocol_packet(Buffer *buf, const char *string, uint *position);
|
||||
|
||||
int store_to_string(Buffer *buf, const char *string, uint *position,
|
||||
uint string_len);
|
||||
int store_to_protocol_packet(Buffer *buf, const char *string, uint *position,
|
||||
uint string_len);
|
||||
|
||||
int send_eof(struct st_net *net);
|
||||
|
||||
|
|
|
@ -2130,7 +2130,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
|
|||
for (; ptr<end; ptr++)
|
||||
{
|
||||
MYSQL_RES *res;
|
||||
if (mysql_real_query(mysql,*ptr, strlen(*ptr)))
|
||||
if (mysql_real_query(mysql,*ptr, (ulong) strlen(*ptr)))
|
||||
goto error;
|
||||
if (mysql->fields)
|
||||
{
|
||||
|
|
46
sql/field.cc
46
sql/field.cc
|
@ -1921,7 +1921,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
|
|||
int_digits_added_zeros=0;
|
||||
}
|
||||
}
|
||||
tmp_uint= (tmp_dec+(int_digits_end-int_digits_from)+
|
||||
tmp_uint= (uint) (tmp_dec+(int_digits_end-int_digits_from)+
|
||||
(uint)(frac_digits_from-int_digits_tail_from)+
|
||||
int_digits_added_zeros);
|
||||
}
|
||||
|
@ -5957,14 +5957,6 @@ longlong Field_string::val_int(void)
|
|||
}
|
||||
|
||||
|
||||
my_decimal *Field_longstr::val_decimal(my_decimal *decimal_value)
|
||||
{
|
||||
str2my_decimal(E_DEC_FATAL_ERROR, ptr, field_length, charset(),
|
||||
decimal_value);
|
||||
return decimal_value;
|
||||
}
|
||||
|
||||
|
||||
String *Field_string::val_str(String *val_buffer __attribute__((unused)),
|
||||
String *val_ptr)
|
||||
{
|
||||
|
@ -5976,6 +5968,14 @@ String *Field_string::val_str(String *val_buffer __attribute__((unused)),
|
|||
}
|
||||
|
||||
|
||||
my_decimal *Field_string::val_decimal(my_decimal *decimal_value)
|
||||
{
|
||||
str2my_decimal(E_DEC_FATAL_ERROR, ptr, field_length, charset(),
|
||||
decimal_value);
|
||||
return decimal_value;
|
||||
}
|
||||
|
||||
|
||||
int Field_string::cmp(const char *a_ptr, const char *b_ptr)
|
||||
{
|
||||
uint a_len, b_len;
|
||||
|
@ -6289,6 +6289,15 @@ String *Field_varstring::val_str(String *val_buffer __attribute__((unused)),
|
|||
}
|
||||
|
||||
|
||||
my_decimal *Field_varstring::val_decimal(my_decimal *decimal_value)
|
||||
{
|
||||
uint length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
|
||||
str2my_decimal(E_DEC_FATAL_ERROR, ptr+length_bytes, length, charset(),
|
||||
decimal_value);
|
||||
return decimal_value;
|
||||
}
|
||||
|
||||
|
||||
int Field_varstring::cmp(const char *a_ptr, const char *b_ptr)
|
||||
{
|
||||
uint a_length, b_length;
|
||||
|
@ -6907,6 +6916,18 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
|
|||
}
|
||||
|
||||
|
||||
my_decimal *Field_blob::val_decimal(my_decimal *decimal_value)
|
||||
{
|
||||
char *blob;
|
||||
memcpy_fixed(&blob, ptr+packlength, sizeof(char*));
|
||||
if (!blob)
|
||||
blob= "";
|
||||
str2my_decimal(E_DEC_FATAL_ERROR, blob, get_length(ptr), charset(),
|
||||
decimal_value);
|
||||
return decimal_value;
|
||||
}
|
||||
|
||||
|
||||
int Field_blob::cmp(const char *a,uint32 a_length, const char *b,
|
||||
uint32 b_length)
|
||||
{
|
||||
|
@ -7735,9 +7756,9 @@ bool Field_enum::eq_def(Field *field)
|
|||
for (uint i=0 ; i < from_lib->count ; i++)
|
||||
if (my_strnncoll(field_charset,
|
||||
(const uchar*)typelib->type_names[i],
|
||||
strlen(typelib->type_names[i]),
|
||||
(uint) strlen(typelib->type_names[i]),
|
||||
(const uchar*)from_lib->type_names[i],
|
||||
strlen(from_lib->type_names[i])))
|
||||
(uint) strlen(from_lib->type_names[i])))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
@ -8595,7 +8616,8 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code,
|
|||
{
|
||||
char str_nr[22];
|
||||
char *str_end= longlong10_to_str(nr, str_nr, -10);
|
||||
make_truncated_value_warning(table->in_use, str_nr, str_end - str_nr,
|
||||
make_truncated_value_warning(table->in_use, str_nr,
|
||||
(uint) (str_end - str_nr),
|
||||
ts_type, field_name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -385,7 +385,6 @@ public:
|
|||
field_name_arg, table_arg, charset)
|
||||
{}
|
||||
|
||||
my_decimal *val_decimal(my_decimal *);
|
||||
int store_decimal(const my_decimal *d);
|
||||
};
|
||||
|
||||
|
@ -997,6 +996,7 @@ public:
|
|||
double val_real(void);
|
||||
longlong val_int(void);
|
||||
String *val_str(String*,String *);
|
||||
my_decimal *val_decimal(my_decimal *);
|
||||
int cmp(const char *,const char*);
|
||||
void sort_string(char *buff,uint length);
|
||||
void sql_type(String &str) const;
|
||||
|
@ -1055,6 +1055,7 @@ public:
|
|||
double val_real(void);
|
||||
longlong val_int(void);
|
||||
String *val_str(String*,String *);
|
||||
my_decimal *val_decimal(my_decimal *);
|
||||
int cmp(const char *,const char*);
|
||||
void sort_string(char *buff,uint length);
|
||||
void get_key_image(char *buff,uint length, imagetype type);
|
||||
|
@ -1110,6 +1111,7 @@ public:
|
|||
double val_real(void);
|
||||
longlong val_int(void);
|
||||
String *val_str(String*,String *);
|
||||
my_decimal *val_decimal(my_decimal *);
|
||||
int cmp(const char *,const char*);
|
||||
int cmp(const char *a, uint32 a_length, const char *b, uint32 b_length);
|
||||
int cmp_binary(const char *a,const char *b, uint32 max_length=~0L);
|
||||
|
|
|
@ -83,7 +83,7 @@ bool Gis_read_stream::get_next_number(double *d)
|
|||
}
|
||||
|
||||
*d = my_strntod(m_charset, (char *)m_cur,
|
||||
m_limit-m_cur, &endptr, &err);
|
||||
(uint) (m_limit-m_cur), &endptr, &err);
|
||||
if (err)
|
||||
return 1;
|
||||
if (endptr)
|
||||
|
@ -115,6 +115,6 @@ bool Gis_read_stream::check_next_symbol(char symbol)
|
|||
void Gis_read_stream::set_error_msg(const char *msg)
|
||||
{
|
||||
size_t len= strlen(msg); // ok in this context
|
||||
m_err_msg= (char *) my_realloc(m_err_msg, len + 1, MYF(MY_ALLOW_ZERO_PTR));
|
||||
m_err_msg= (char *) my_realloc(m_err_msg, (uint) len + 1, MYF(MY_ALLOW_ZERO_PTR));
|
||||
memcpy(m_err_msg, msg, len + 1);
|
||||
}
|
||||
|
|
|
@ -1068,7 +1068,7 @@ bool ha_myisam::check_and_repair(THD *thd)
|
|||
old_query_length= thd->query_length;
|
||||
pthread_mutex_lock(&LOCK_thread_count);
|
||||
thd->query= (char*) table->s->table_name;
|
||||
thd->query_length= strlen(table->s->table_name);
|
||||
thd->query_length= (uint32) strlen(table->s->table_name);
|
||||
pthread_mutex_unlock(&LOCK_thread_count);
|
||||
|
||||
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
|
||||
|
|
|
@ -466,7 +466,7 @@ void ha_myisammrg::append_create_info(String *packet)
|
|||
MYRG_TABLE *open_table,*first;
|
||||
|
||||
current_db= table->s->db;
|
||||
db_length= strlen(current_db);
|
||||
db_length= (uint) strlen(current_db);
|
||||
|
||||
for (first=open_table=file->open_tables ;
|
||||
open_table != file->end_table ;
|
||||
|
|
|
@ -6302,6 +6302,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
|
|||
case(REAL_RESULT):
|
||||
context->expect_only(Item::REAL_ITEM);
|
||||
context->expect(Item::DECIMAL_ITEM);
|
||||
context->expect(Item::INT_ITEM);
|
||||
break;
|
||||
case(INT_RESULT):
|
||||
context->expect_only(Item::INT_ITEM);
|
||||
|
@ -6310,6 +6311,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
|
|||
case(DECIMAL_RESULT):
|
||||
context->expect_only(Item::DECIMAL_ITEM);
|
||||
context->expect(Item::REAL_ITEM);
|
||||
context->expect(Item::INT_ITEM);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -6712,6 +6714,8 @@ void ndb_serialize_cond(const Item *item, void *arg)
|
|||
// We have not seen the field argument yet
|
||||
context->expect_only(Item::FIELD_ITEM);
|
||||
context->expect_only_field_result(INT_RESULT);
|
||||
context->expect_field_result(REAL_RESULT);
|
||||
context->expect_field_result(DECIMAL_RESULT);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
40
sql/item.cc
40
sql/item.cc
|
@ -307,7 +307,7 @@ void *Item::operator new(size_t size, Item *reuse, uint *rsize)
|
|||
return (void *)reuse;
|
||||
}
|
||||
if (rsize)
|
||||
(*rsize)= size;
|
||||
(*rsize)= (uint) size;
|
||||
return (void *)sql_alloc((uint)size);
|
||||
}
|
||||
|
||||
|
@ -382,7 +382,7 @@ void Item::print_item_w_name(String *str)
|
|||
{
|
||||
THD *thd= current_thd;
|
||||
str->append(" AS ", 4);
|
||||
append_identifier(thd, str, name, strlen(name));
|
||||
append_identifier(thd, str, name, (uint) strlen(name));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1132,27 +1132,27 @@ void Item_ident::print(String *str)
|
|||
if (!table_name || !field_name)
|
||||
{
|
||||
const char *nm= field_name ? field_name : name ? name : "tmp_field";
|
||||
append_identifier(thd, str, nm, strlen(nm));
|
||||
append_identifier(thd, str, nm, (uint) strlen(nm));
|
||||
return;
|
||||
}
|
||||
if (db_name && db_name[0] && !alias_name_used)
|
||||
{
|
||||
append_identifier(thd, str, d_name, strlen(d_name));
|
||||
append_identifier(thd, str, d_name, (uint) strlen(d_name));
|
||||
str->append('.');
|
||||
append_identifier(thd, str, t_name, strlen(t_name));
|
||||
append_identifier(thd, str, t_name, (uint) strlen(t_name));
|
||||
str->append('.');
|
||||
append_identifier(thd, str, field_name, strlen(field_name));
|
||||
append_identifier(thd, str, field_name, (uint) strlen(field_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (table_name[0])
|
||||
{
|
||||
append_identifier(thd, str, t_name, strlen(t_name));
|
||||
append_identifier(thd, str, t_name, (uint) strlen(t_name));
|
||||
str->append('.');
|
||||
append_identifier(thd, str, field_name, strlen(field_name));
|
||||
append_identifier(thd, str, field_name, (uint) strlen(field_name));
|
||||
}
|
||||
else
|
||||
append_identifier(thd, str, field_name, strlen(field_name));
|
||||
append_identifier(thd, str, field_name, (uint) strlen(field_name));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2179,7 +2179,7 @@ const String *Item_param::query_val_str(String* str) const
|
|||
ptr+= escape_string_for_mysql(str_value.charset(), ptr, 0,
|
||||
str_value.ptr(), str_value.length());
|
||||
*ptr++= '\'';
|
||||
str->length(ptr - buf);
|
||||
str->length((uint32) (ptr - buf));
|
||||
break;
|
||||
}
|
||||
case NULL_VALUE:
|
||||
|
@ -4448,6 +4448,7 @@ bool Item_default_value::fix_fields(THD *thd,
|
|||
struct st_table_list *table_list,
|
||||
Item **items)
|
||||
{
|
||||
Item *real_arg;
|
||||
Item_field *field_arg;
|
||||
Field *def_field;
|
||||
DBUG_ASSERT(fixed == 0);
|
||||
|
@ -4459,17 +4460,15 @@ bool Item_default_value::fix_fields(THD *thd,
|
|||
}
|
||||
if (!arg->fixed && arg->fix_fields(thd, table_list, &arg))
|
||||
return TRUE;
|
||||
|
||||
if (arg->type() == REF_ITEM)
|
||||
|
||||
real_arg= arg->real_item();
|
||||
if (real_arg->type() != FIELD_ITEM)
|
||||
{
|
||||
Item_ref *ref= (Item_ref *)arg;
|
||||
if (ref->ref[0]->type() != FIELD_ITEM)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
arg= ref->ref[0];
|
||||
my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), arg->name);
|
||||
return TRUE;
|
||||
}
|
||||
field_arg= (Item_field *)arg;
|
||||
|
||||
field_arg= (Item_field *)real_arg;
|
||||
if (field_arg->field->flags & NO_DEFAULT_VALUE_FLAG)
|
||||
{
|
||||
my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), field_arg->field->field_name);
|
||||
|
@ -4602,7 +4601,8 @@ void Item_trigger_field::setup_field(THD *thd, TABLE *table)
|
|||
Try to find field by its name and if it will be found
|
||||
set field_idx properly.
|
||||
*/
|
||||
(void)find_field_in_real_table(thd, table, field_name, strlen(field_name),
|
||||
(void)find_field_in_real_table(thd, table, field_name,
|
||||
(uint) strlen(field_name),
|
||||
0, 0, &field_idx);
|
||||
thd->set_query_id= save_set_query_id;
|
||||
triggers= table->triggers;
|
||||
|
|
|
@ -630,7 +630,7 @@ public:
|
|||
Item *it= this_item();
|
||||
|
||||
if (name)
|
||||
it->set_name(name, strlen(name), system_charset_info);
|
||||
it->set_name(name, (uint) strlen(name), system_charset_info);
|
||||
else
|
||||
it->set_name(m_name.str, m_name.length, system_charset_info);
|
||||
it->make_field(field);
|
||||
|
@ -1352,7 +1352,10 @@ public:
|
|||
{
|
||||
(*ref)->save_in_field(result_field, no_conversions);
|
||||
}
|
||||
Item *real_item() { return *ref; }
|
||||
Item *real_item()
|
||||
{
|
||||
return (*ref)->real_item();
|
||||
}
|
||||
bool walk(Item_processor processor, byte *arg)
|
||||
{ return (*ref)->walk(processor, arg); }
|
||||
void print(String *str);
|
||||
|
|
|
@ -2792,10 +2792,11 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref)
|
|||
if (canDoTurboBM)
|
||||
{
|
||||
pattern = first + 1;
|
||||
pattern_len = len - 2;
|
||||
pattern_len = (int) len - 2;
|
||||
DBUG_PRINT("info", ("Initializing pattern: '%s'", first));
|
||||
int *suff = (int*) thd->alloc(sizeof(int)*((pattern_len + 1)*2+
|
||||
alphabet_size));
|
||||
int *suff = (int*) thd->alloc((int) (sizeof(int)*
|
||||
((pattern_len + 1)*2+
|
||||
alphabet_size)));
|
||||
bmGs = suff + pattern_len + 1;
|
||||
bmBc = bmGs + pattern_len + 1;
|
||||
turboBM_compute_good_suffix_shifts(suff);
|
||||
|
|
|
@ -879,11 +879,11 @@ longlong Item_func_numhybrid::val_int()
|
|||
return (longlong)real_op();
|
||||
case STRING_RESULT:
|
||||
{
|
||||
char *end_not_used;
|
||||
int err_not_used;
|
||||
String *res= str_op(&str_value);
|
||||
char *end= (char*) res->ptr() + res->length();
|
||||
CHARSET_INFO *cs= str_value.charset();
|
||||
return (res ? (*(cs->cset->strtoll10))(cs, res->ptr(), &end_not_used,
|
||||
return (res ? (*(cs->cset->strtoll10))(cs, res->ptr(), &end,
|
||||
&err_not_used) : 0);
|
||||
}
|
||||
default:
|
||||
|
@ -1022,7 +1022,8 @@ longlong Item_func_unsigned::val_int()
|
|||
String *Item_decimal_typecast::val_str(String *str)
|
||||
{
|
||||
my_decimal tmp_buf, *tmp= val_decimal(&tmp_buf);
|
||||
my_decimal_round(E_DEC_FATAL_ERROR, tmp, decimals, FALSE, &tmp_buf);
|
||||
if (null_value)
|
||||
return NULL;
|
||||
my_decimal2string(E_DEC_FATAL_ERROR, &tmp_buf, 0, 0, 0, str);
|
||||
return str;
|
||||
}
|
||||
|
@ -1032,6 +1033,8 @@ double Item_decimal_typecast::val_real()
|
|||
{
|
||||
my_decimal tmp_buf, *tmp= val_decimal(&tmp_buf);
|
||||
double res;
|
||||
if (null_value)
|
||||
return 0.0;
|
||||
my_decimal2double(E_DEC_FATAL_ERROR, tmp, &res);
|
||||
return res;
|
||||
}
|
||||
|
@ -1041,6 +1044,8 @@ longlong Item_decimal_typecast::val_int()
|
|||
{
|
||||
my_decimal tmp_buf, *tmp= val_decimal(&tmp_buf);
|
||||
longlong res;
|
||||
if (null_value)
|
||||
return 0;
|
||||
my_decimal2int(E_DEC_FATAL_ERROR, tmp, unsigned_flag, &res);
|
||||
return res;
|
||||
}
|
||||
|
@ -1049,6 +1054,8 @@ longlong Item_decimal_typecast::val_int()
|
|||
my_decimal *Item_decimal_typecast::val_decimal(my_decimal *dec)
|
||||
{
|
||||
my_decimal tmp_buf, *tmp= args[0]->val_decimal(&tmp_buf);
|
||||
if ((null_value= args[0]->null_value))
|
||||
return NULL;
|
||||
my_decimal_round(E_DEC_FATAL_ERROR, tmp, decimals, FALSE, dec);
|
||||
return dec;
|
||||
}
|
||||
|
|
|
@ -1272,19 +1272,6 @@ static void server_init(void)
|
|||
int arg=1;
|
||||
DBUG_ENTER("server_init");
|
||||
|
||||
#ifdef __WIN__
|
||||
if (!opt_disable_networking)
|
||||
{
|
||||
WSADATA WsaData;
|
||||
if (SOCKET_ERROR == WSAStartup (0x0101, &WsaData))
|
||||
{
|
||||
/* errors are not read yet, so we use test here */
|
||||
my_message(ER_WSAS_FAILED, "WSAStartup Failed", MYF(0));
|
||||
unireg_abort(1);
|
||||
}
|
||||
}
|
||||
#endif /* __WIN__ */
|
||||
|
||||
set_ports();
|
||||
|
||||
if (mysqld_port != 0 && !opt_disable_networking && !opt_bootstrap)
|
||||
|
@ -3018,6 +3005,21 @@ int main(int argc, char **argv)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __WIN__
|
||||
/* Before performing any socket operation (like retrieving hostname */
|
||||
/* in init_common_variables we have to call WSAStartup */
|
||||
if (!opt_disable_networking)
|
||||
{
|
||||
WSADATA WsaData;
|
||||
if (SOCKET_ERROR == WSAStartup (0x0101, &WsaData))
|
||||
{
|
||||
/* errors are not read yet, so we use test here */
|
||||
my_message(ER_WSAS_FAILED, "WSAStartup Failed", MYF(0));
|
||||
unireg_abort(1);
|
||||
}
|
||||
}
|
||||
#endif /* __WIN__ */
|
||||
|
||||
if (init_common_variables(MYSQL_CONFIG_NAME,
|
||||
argc, argv, load_default_groups))
|
||||
unireg_abort(1); // Will do exit
|
||||
|
|
|
@ -7617,8 +7617,8 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
|
|||
*records= num_groups;
|
||||
|
||||
DBUG_PRINT("info",
|
||||
("records=%u, keys/block=%u, keys/group=%u, records=%u, blocks=%u",
|
||||
table_records, keys_per_block, keys_per_group, records,
|
||||
("table rows=%u, keys/block=%u, keys/group=%u, result rows=%u, blocks=%u",
|
||||
table_records, keys_per_block, keys_per_group, *records,
|
||||
num_blocks));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
@ -8125,6 +8125,15 @@ int QUICK_GROUP_MIN_MAX_SELECT::get_next()
|
|||
DBUG_ASSERT((have_max && !have_min) ||
|
||||
(have_max && have_min && (max_res == 0)));
|
||||
}
|
||||
/*
|
||||
If this is a just a GROUP BY or DISTINCT without MIN or MAX and there
|
||||
are equality predicates for the key parts after the group, find the
|
||||
first sub-group with the extended prefix.
|
||||
*/
|
||||
if (!have_min && !have_max && key_infix_len > 0)
|
||||
result= file->index_read(record, group_prefix, real_prefix_len,
|
||||
HA_READ_KEY_EXACT);
|
||||
|
||||
result= have_min ? min_res : have_max ? max_res : result;
|
||||
}
|
||||
while (result == HA_ERR_KEY_NOT_FOUND && is_last_prefix != 0);
|
||||
|
@ -8151,9 +8160,8 @@ int QUICK_GROUP_MIN_MAX_SELECT::get_next()
|
|||
QUICK_GROUP_MIN_MAX_SELECT::next_min()
|
||||
|
||||
DESCRIPTION
|
||||
Load the prefix of the next group into group_prefix and find the minimal
|
||||
key within this group such that the key satisfies the query conditions and
|
||||
NULL semantics. The found key is loaded into this->record.
|
||||
Find the minimal key within this group such that the key satisfies the query
|
||||
conditions and NULL semantics. The found key is loaded into this->record.
|
||||
|
||||
IMPLEMENTATION
|
||||
Depending on the values of min_max_ranges.elements, key_infix_len, and
|
||||
|
@ -8237,9 +8245,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min()
|
|||
QUICK_GROUP_MIN_MAX_SELECT::next_max()
|
||||
|
||||
DESCRIPTION
|
||||
If there was no previous next_min call to determine the next group prefix,
|
||||
then load the next prefix into group_prefix, then lookup the maximal key of
|
||||
the group, and store it into this->record.
|
||||
Lookup the maximal key of the group, and store it into this->record.
|
||||
|
||||
RETURN
|
||||
0 on success
|
||||
|
|
|
@ -146,7 +146,7 @@ void hash_password(ulong *result, const char *password, uint password_len)
|
|||
void make_scrambled_password_323(char *to, const char *password)
|
||||
{
|
||||
ulong hash_res[2];
|
||||
hash_password(hash_res, password, strlen(password));
|
||||
hash_password(hash_res, password, (uint) strlen(password));
|
||||
sprintf(to, "%08lx%08lx", hash_res[0], hash_res[1]);
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ void scramble_323(char *to, const char *message, const char *password)
|
|||
{
|
||||
char extra, *to_start=to;
|
||||
const char *message_end= message + SCRAMBLE_LENGTH_323;
|
||||
hash_password(hash_pass,password, strlen(password));
|
||||
hash_password(hash_pass,password, (uint) strlen(password));
|
||||
hash_password(hash_message, message, SCRAMBLE_LENGTH_323);
|
||||
randominit(&rand_st,hash_pass[0] ^ hash_message[0],
|
||||
hash_pass[1] ^ hash_message[1]);
|
||||
|
@ -394,7 +394,7 @@ make_scrambled_password(char *to, const char *password)
|
|||
|
||||
sha1_reset(&sha1_context);
|
||||
/* stage 1: hash password */
|
||||
sha1_input(&sha1_context, (uint8 *) password, strlen(password));
|
||||
sha1_input(&sha1_context, (uint8 *) password, (uint) strlen(password));
|
||||
sha1_result(&sha1_context, (uint8 *) to);
|
||||
/* stage 2: hash stage1 output */
|
||||
sha1_reset(&sha1_context);
|
||||
|
@ -433,7 +433,7 @@ scramble(char *to, const char *message, const char *password)
|
|||
|
||||
sha1_reset(&sha1_context);
|
||||
/* stage 1: hash password */
|
||||
sha1_input(&sha1_context, (uint8 *) password, strlen(password));
|
||||
sha1_input(&sha1_context, (uint8 *) password, (uint) strlen(password));
|
||||
sha1_result(&sha1_context, hash_stage1);
|
||||
/* stage 2: hash stage 1; note that hash_stage2 is stored in the database */
|
||||
sha1_reset(&sha1_context);
|
||||
|
|
|
@ -786,7 +786,8 @@ public:
|
|||
if (value_arg && value_arg->type() == Item::FIELD_ITEM)
|
||||
{
|
||||
Item_field *item= (Item_field*) value_arg;
|
||||
if (!(value=new Item_string(item->field_name, strlen(item->field_name),
|
||||
if (!(value=new Item_string(item->field_name,
|
||||
(uint) strlen(item->field_name),
|
||||
item->collation.collation)))
|
||||
value=value_arg; /* Give error message later */
|
||||
}
|
||||
|
|
|
@ -377,6 +377,10 @@ public:
|
|||
return (uint)m_lex->sql_command;
|
||||
}
|
||||
|
||||
void disable_query_cache()
|
||||
{
|
||||
m_lex->safe_to_cache_query= 0;
|
||||
}
|
||||
private:
|
||||
|
||||
LEX *m_lex;
|
||||
|
|
|
@ -169,6 +169,17 @@ sp_rcontext::pop_cursors(uint count)
|
|||
*
|
||||
*/
|
||||
|
||||
sp_cursor::sp_cursor(sp_lex_keeper *lex_keeper)
|
||||
:m_lex_keeper(lex_keeper), m_prot(NULL), m_isopen(0), m_current_row(NULL)
|
||||
{
|
||||
/*
|
||||
currsor can't be stored in QC, so we should prevent opening QC for
|
||||
try to write results which are absent.
|
||||
*/
|
||||
lex_keeper->disable_query_cache();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
pre_open cursor
|
||||
|
||||
|
|
|
@ -203,11 +203,7 @@ class sp_cursor : public Sql_alloc
|
|||
{
|
||||
public:
|
||||
|
||||
sp_cursor(sp_lex_keeper *lex_keeper)
|
||||
: m_lex_keeper(lex_keeper), m_prot(NULL), m_isopen(0), m_current_row(NULL)
|
||||
{
|
||||
/* Empty */
|
||||
}
|
||||
sp_cursor(sp_lex_keeper *lex_keeper);
|
||||
|
||||
virtual ~sp_cursor()
|
||||
{
|
||||
|
|
|
@ -2154,7 +2154,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
|
|||
if (*s->on_expr_ref)
|
||||
{
|
||||
/* s is the only inner table of an outer join */
|
||||
if (!table->file->records)
|
||||
if (!table->file->records && !embedding)
|
||||
{ // Empty table
|
||||
s->dependent= 0; // Ignore LEFT JOIN depend.
|
||||
set_position(join,const_count++,s,(KEYUSE*) 0);
|
||||
|
@ -7060,7 +7060,7 @@ static COND* substitute_for_best_equal_field(COND *cond,
|
|||
List_iterator_fast<Item_equal> it(cond_equal->current_level);
|
||||
while ((item_equal= it++))
|
||||
{
|
||||
eliminate_item_equal(cond, cond_equal->upper_levels, item_equal);
|
||||
cond= eliminate_item_equal(cond, cond_equal->upper_levels, item_equal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7953,6 +7953,19 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
|
|||
modify_item ? (Item_field*) item : NULL,
|
||||
convert_blob_length);
|
||||
}
|
||||
case Item::REF_ITEM:
|
||||
if ( item->real_item()->type() == Item::FIELD_ITEM)
|
||||
{
|
||||
Item_field *field= (Item_field*) *((Item_ref*)item)->ref;
|
||||
Field *new_field= create_tmp_field_from_field(thd,
|
||||
(*from_field= field->field),
|
||||
item->name, table,
|
||||
NULL,
|
||||
convert_blob_length);
|
||||
if (modify_item)
|
||||
item->set_result_field(new_field);
|
||||
return new_field;
|
||||
}
|
||||
case Item::FUNC_ITEM:
|
||||
case Item::COND_ITEM:
|
||||
case Item::FIELD_AVG_ITEM:
|
||||
|
@ -7964,7 +7977,6 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
|
|||
case Item::REAL_ITEM:
|
||||
case Item::DECIMAL_ITEM:
|
||||
case Item::STRING_ITEM:
|
||||
case Item::REF_ITEM:
|
||||
case Item::NULL_ITEM:
|
||||
case Item::VARBIN_ITEM:
|
||||
return create_tmp_field_from_item(thd, item, table, copy_func, modify_item,
|
||||
|
@ -11781,11 +11793,11 @@ cp_buffer_from_ref(THD *thd, TABLE_REF *ref)
|
|||
ref_pointer_array.
|
||||
|
||||
RETURN
|
||||
0 if OK
|
||||
1 if error occurred
|
||||
FALSE if OK
|
||||
TRUE if error occurred
|
||||
*/
|
||||
|
||||
static int
|
||||
static bool
|
||||
find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
|
||||
ORDER *order, List<Item> &fields, List<Item> &all_fields,
|
||||
bool is_group_field)
|
||||
|
@ -11802,13 +11814,13 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
|
|||
{
|
||||
my_error(ER_BAD_FIELD_ERROR, MYF(0),
|
||||
order_item->full_name(), thd->where);
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
order->item= ref_pointer_array + count - 1;
|
||||
order->in_field_list= 1;
|
||||
order->counter= count;
|
||||
order->counter_used= 1;
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
/* Lookup the current GROUP/ORDER field in the SELECT clause. */
|
||||
uint counter;
|
||||
|
@ -11816,7 +11828,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
|
|||
select_item= find_item_in_list(order_item, fields, &counter,
|
||||
REPORT_EXCEPT_NOT_FOUND, &unaliased);
|
||||
if (!select_item)
|
||||
return 1; /* Some error occured. */
|
||||
return TRUE; /* The item is not unique, or some other error occured. */
|
||||
|
||||
|
||||
/* Check whether the resolved field is not ambiguos. */
|
||||
|
@ -11830,7 +11842,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
|
|||
*/
|
||||
if (unaliased && !order_item->fixed && order_item->fix_fields(thd, tables,
|
||||
order->item))
|
||||
return 1;
|
||||
return TRUE;
|
||||
|
||||
/* Lookup the current GROUP field in the FROM clause. */
|
||||
order_item_type= order_item->type();
|
||||
|
@ -11870,27 +11882,42 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
|
|||
{
|
||||
order->item= ref_pointer_array + counter;
|
||||
order->in_field_list=1;
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
/*
|
||||
There is a field with the same name in the FROM clause. This is the field
|
||||
that will be chosen. In this case we issue a warning so the user knows
|
||||
that the field from the FROM clause overshadows the column reference from
|
||||
the SELECT list.
|
||||
*/
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_NON_UNIQ_ERROR,
|
||||
ER(ER_NON_UNIQ_ERROR), from_field->field_name,
|
||||
current_thd->where);
|
||||
}
|
||||
|
||||
order->in_field_list=0;
|
||||
/*
|
||||
The call to order_item->fix_fields() means that here we resolve 'order_item'
|
||||
to a column from a table in the list 'tables', or to a column in some outer
|
||||
query. Exactly because of the second case we come to this point even if
|
||||
(select_item == not_found_item), inspite of that fix_fields() calls
|
||||
find_item_in_list() one more time.
|
||||
|
||||
We check order_item->fixed because Item_func_group_concat can put
|
||||
arguments for which fix_fields already was called.
|
||||
|
||||
'it' reassigned in if condition because fix_field can change it.
|
||||
*/
|
||||
if (!order_item->fixed &&
|
||||
(order_item->fix_fields(thd, tables, order->item) ||
|
||||
(order_item= *order->item)->check_cols(1) ||
|
||||
thd->is_fatal_error))
|
||||
return 1; // Wrong field
|
||||
return TRUE; /* Wrong field. */
|
||||
|
||||
uint el= all_fields.elements;
|
||||
all_fields.push_front(order_item); // Add new field to field list
|
||||
all_fields.push_front(order_item); /* Add new field to field list. */
|
||||
ref_pointer_array[el]= order_item;
|
||||
order->item= ref_pointer_array + el;
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -348,7 +348,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
|
|||
table_list->table_name));
|
||||
|
||||
/* Only one table for now, but VIEW can involve several tables */
|
||||
if (open_and_lock_tables(thd, table_list))
|
||||
if (open_normal_and_derived_tables(thd, table_list))
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
@ -540,8 +540,7 @@ mysqld_list_fields(THD *thd, TABLE_LIST *table_list, const char *wild)
|
|||
DBUG_ENTER("mysqld_list_fields");
|
||||
DBUG_PRINT("enter",("table: %s",table_list->table_name));
|
||||
|
||||
table_list->lock_type= TL_UNLOCK;
|
||||
if (open_and_lock_tables(thd, table_list))
|
||||
if (open_normal_and_derived_tables(thd, table_list))
|
||||
DBUG_VOID_RETURN;
|
||||
table= table_list->table;
|
||||
|
||||
|
@ -1945,7 +1944,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
bool res;
|
||||
|
||||
lex->all_selects_list= lsel;
|
||||
res= open_and_lock_tables(thd, show_table_list);
|
||||
res= open_normal_and_derived_tables(thd, show_table_list);
|
||||
if (schema_table->process_table(thd, show_table_list,
|
||||
table, res, show_table_list->db,
|
||||
show_table_list->alias))
|
||||
|
@ -2050,7 +2049,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
show_table_list->lock_type= lock_type;
|
||||
lex->all_selects_list= &sel;
|
||||
lex->derived_tables= 0;
|
||||
res= open_and_lock_tables(thd, show_table_list);
|
||||
res= open_normal_and_derived_tables(thd, show_table_list);
|
||||
if (schema_table->process_table(thd, show_table_list, table,
|
||||
res, base_name,
|
||||
show_table_list->alias))
|
||||
|
|
|
@ -778,7 +778,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
|
|||
key+= seg->length;
|
||||
}
|
||||
memcpy(key, &recpos, sizeof(byte*));
|
||||
return key - start_key;
|
||||
return (uint) (key - start_key);
|
||||
}
|
||||
|
||||
|
||||
|
@ -844,7 +844,7 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
|
|||
key+= seg->length;
|
||||
k_len-= seg->length;
|
||||
}
|
||||
return key - start_key;
|
||||
return (uint) (key - start_key);
|
||||
}
|
||||
|
||||
|
||||
|
@ -866,7 +866,7 @@ uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key)
|
|||
continue;
|
||||
key+= seg->length;
|
||||
}
|
||||
return key - start_key;
|
||||
return (uint) (key - start_key);
|
||||
}
|
||||
|
||||
|
||||
|
@ -886,7 +886,7 @@ uint hp_rb_var_key_length(HP_KEYDEF *keydef, const byte *key)
|
|||
}
|
||||
key+= length;
|
||||
}
|
||||
return key - start_key;
|
||||
return (uint) (key - start_key);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ int heap_update(HP_INFO *info, const byte *old, const byte *heap_new)
|
|||
err:
|
||||
if (my_errno == HA_ERR_FOUND_DUPP_KEY)
|
||||
{
|
||||
info->errkey = keydef - share->keydef;
|
||||
info->errkey = (int) (keydef - share->keydef);
|
||||
if (keydef->algorithm == HA_KEY_ALG_BTREE)
|
||||
{
|
||||
/* we don't need to delete non-inserted key from rb-tree */
|
||||
|
|
|
@ -55,7 +55,7 @@ const Uint32 MAX_MESSAGE_SIZE = (12+4+4+(4*25)+(3*4)+4*4096);
|
|||
* information specific to a transporter type.
|
||||
*/
|
||||
struct TransporterConfiguration {
|
||||
Uint32 port;
|
||||
Int32 s_port; // negative port number implies dynamic port
|
||||
const char *remoteHostName;
|
||||
const char *localHostName;
|
||||
NodeId remoteNodeId;
|
||||
|
|
|
@ -271,14 +271,12 @@ IPCConfig::configureTransporters(Uint32 nodeId,
|
|||
|
||||
If we're not using dynamic ports, we don't do anything.
|
||||
*/
|
||||
if((int)server_port<0)
|
||||
server_port= -server_port;
|
||||
|
||||
conf.localNodeId = nodeId;
|
||||
conf.remoteNodeId = remoteNodeId;
|
||||
conf.checksum = checksum;
|
||||
conf.signalId = sendSignalId;
|
||||
conf.port = server_port;
|
||||
conf.s_port = server_port;
|
||||
conf.localHostName = localHostName;
|
||||
conf.remoteHostName = remoteHostName;
|
||||
|
||||
|
@ -350,7 +348,7 @@ IPCConfig::configureTransporters(Uint32 nodeId,
|
|||
if (!iter.get(CFG_TCP_PROXY, &proxy)) {
|
||||
if (strlen(proxy) > 0 && nodeId2 == nodeId) {
|
||||
// TODO handle host:port
|
||||
conf.port = atoi(proxy);
|
||||
conf.s_port = atoi(proxy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -290,7 +290,7 @@ TransporterRegistry::createTCPTransporter(TransporterConfiguration *config) {
|
|||
config->tcp.maxReceiveSize,
|
||||
config->localHostName,
|
||||
config->remoteHostName,
|
||||
config->port,
|
||||
config->s_port,
|
||||
config->isMgmConnection,
|
||||
localNodeId,
|
||||
config->remoteNodeId,
|
||||
|
@ -392,7 +392,7 @@ TransporterRegistry::createSCITransporter(TransporterConfiguration *config) {
|
|||
SCI_Transporter * t = new SCI_Transporter(*this,
|
||||
config->localHostName,
|
||||
config->remoteHostName,
|
||||
config->port,
|
||||
config->s_port,
|
||||
config->isMgmConnection,
|
||||
config->sci.sendLimit,
|
||||
config->sci.bufferSize,
|
||||
|
@ -458,7 +458,7 @@ TransporterRegistry::createSHMTransporter(TransporterConfiguration *config) {
|
|||
SHM_Transporter * t = new SHM_Transporter(*this,
|
||||
config->localHostName,
|
||||
config->remoteHostName,
|
||||
config->port,
|
||||
config->s_port,
|
||||
config->isMgmConnection,
|
||||
localNodeId,
|
||||
config->remoteNodeId,
|
||||
|
@ -1170,7 +1170,10 @@ TransporterRegistry::do_connect(NodeId node_id)
|
|||
case DISCONNECTING:
|
||||
break;
|
||||
}
|
||||
DBUG_ENTER("TransporterRegistry::do_connect");
|
||||
DBUG_PRINT("info",("performStates[%d]=CONNECTING",node_id));
|
||||
curr_state= CONNECTING;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
void
|
||||
TransporterRegistry::do_disconnect(NodeId node_id)
|
||||
|
@ -1186,21 +1189,30 @@ TransporterRegistry::do_disconnect(NodeId node_id)
|
|||
case DISCONNECTING:
|
||||
return;
|
||||
}
|
||||
DBUG_ENTER("TransporterRegistry::do_disconnect");
|
||||
DBUG_PRINT("info",("performStates[%d]=DISCONNECTING",node_id));
|
||||
curr_state= DISCONNECTING;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void
|
||||
TransporterRegistry::report_connect(NodeId node_id)
|
||||
{
|
||||
DBUG_ENTER("TransporterRegistry::report_connect");
|
||||
DBUG_PRINT("info",("performStates[%d]=CONNECTED",node_id));
|
||||
performStates[node_id] = CONNECTED;
|
||||
reportConnect(callbackObj, node_id);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void
|
||||
TransporterRegistry::report_disconnect(NodeId node_id, int errnum)
|
||||
{
|
||||
DBUG_ENTER("TransporterRegistry::report_connect");
|
||||
DBUG_PRINT("info",("performStates[%d]=DISCONNECTED",node_id));
|
||||
performStates[node_id] = DISCONNECTED;
|
||||
reportDisconnect(callbackObj, node_id, errnum);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -6320,7 +6320,7 @@ uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
|
|||
break;
|
||||
}
|
||||
}
|
||||
return b - b0;
|
||||
return (uint) (b - b0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -433,7 +433,7 @@ skip:
|
|||
if (nmatch > 0)
|
||||
{
|
||||
match[0].beg= 0;
|
||||
match[0].end= str- (const uchar*)b-1;
|
||||
match[0].end= (uint) (str- (const uchar*)b-1);
|
||||
match[0].mblen= match[0].end;
|
||||
|
||||
if (nmatch > 1)
|
||||
|
|
|
@ -5446,7 +5446,7 @@ uint my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)),
|
|||
break;
|
||||
}
|
||||
}
|
||||
return b - b0;
|
||||
return (uint) (b - b0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -8403,14 +8403,14 @@ uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
|
|||
|
||||
chbeg= (char *) b++;
|
||||
if (b >= (uchar *) end) /* need more bytes */
|
||||
return chbeg - beg; /* unexpected EOL */
|
||||
return (uint) (chbeg - beg); /* unexpected EOL */
|
||||
|
||||
if (ch == 0x8E) /* [x8E][xA0-xDF] */
|
||||
{
|
||||
if (*b >= 0xA0 && *b <= 0xDF)
|
||||
continue;
|
||||
*error=1;
|
||||
return chbeg - beg; /* invalid sequence */
|
||||
return (uint) (chbeg - beg); /* invalid sequence */
|
||||
}
|
||||
|
||||
if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */
|
||||
|
@ -8419,7 +8419,7 @@ uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
|
|||
if (b >= (uchar*) end)
|
||||
{
|
||||
*error= 1;
|
||||
return chbeg - beg; /* unexpected EOL */
|
||||
return (uint)(chbeg - beg); /* unexpected EOL */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8427,9 +8427,9 @@ uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
|
|||
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
|
||||
continue;
|
||||
*error=1;
|
||||
return chbeg - beg; /* invalid sequence */
|
||||
return (uint) (chbeg - beg); /* invalid sequence */
|
||||
}
|
||||
return b - (uchar *) beg;
|
||||
return (uint) (b - (uchar *) beg);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -268,7 +268,7 @@ uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
|
|||
pos+= (mblen= my_ismbchar(cs, pos, end)) ? mblen : 1;
|
||||
length--;
|
||||
}
|
||||
return length ? end+2-start : pos-start;
|
||||
return (uint) (length ? end+2-start : pos-start);
|
||||
}
|
||||
|
||||
|
||||
|
@ -290,7 +290,7 @@ uint my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e,
|
|||
b+= mblen;
|
||||
pos--;
|
||||
}
|
||||
return b - b_start;
|
||||
return (uint) (b - b_start);
|
||||
}
|
||||
|
||||
|
||||
|
@ -329,7 +329,7 @@ uint my_instr_mb(CHARSET_INFO *cs,
|
|||
if (nmatch)
|
||||
{
|
||||
match[0].beg= 0;
|
||||
match[0].end= b-b0;
|
||||
match[0].end= (uint) (b-b0);
|
||||
match[0].mblen= res;
|
||||
if (nmatch > 1)
|
||||
{
|
||||
|
|
|
@ -1084,7 +1084,7 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
|
|||
if (*str == '.')
|
||||
{
|
||||
for(str++ ; str != end && *str == '0' ; str++);
|
||||
return str-str0;
|
||||
return (ulong) (str-str0);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
@ -1094,7 +1094,7 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
|
|||
if (!my_isspace(cs,*str))
|
||||
break;
|
||||
}
|
||||
return str-str0;
|
||||
return (ulong) (str-str0);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -1111,14 +1111,14 @@ void my_fill_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
|||
uint my_numchars_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const char *b, const char *e)
|
||||
{
|
||||
return e-b;
|
||||
return (uint) (e-b);
|
||||
}
|
||||
|
||||
|
||||
uint my_numcells_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const char *b, const char *e)
|
||||
{
|
||||
return e-b;
|
||||
return (uint) (e-b);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1193,7 +1193,7 @@ skip:
|
|||
if (nmatch > 0)
|
||||
{
|
||||
match[0].beg= 0;
|
||||
match[0].end= str- (const uchar*)b-1;
|
||||
match[0].end= (uint) (str- (const uchar*)b-1);
|
||||
match[0].mblen= match[0].end;
|
||||
|
||||
if (nmatch > 1)
|
||||
|
|
|
@ -4615,7 +4615,7 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
|||
break;
|
||||
}
|
||||
}
|
||||
return b - b0;
|
||||
return (uint) (b - b0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7527,7 +7527,7 @@ static void my_coll_lexem_print_error(MY_COLL_LEXEM *lexem,
|
|||
{
|
||||
char tail[30];
|
||||
size_t len= lexem->end - lexem->prev;
|
||||
strmake (tail, lexem->prev, min(len, sizeof(tail)-1));
|
||||
strmake (tail, lexem->prev, (uint) min(len, sizeof(tail)-1));
|
||||
errstr[errsize-1]= '\0';
|
||||
my_snprintf(errstr,errsize-1,"%s at '%s'", txt, tail);
|
||||
}
|
||||
|
@ -7769,7 +7769,7 @@ static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems,
|
|||
continue;
|
||||
}
|
||||
}
|
||||
return (size_t) nitems;
|
||||
return (int) nitems;
|
||||
}
|
||||
|
||||
#define MY_MAX_COLL_RULE 128
|
||||
|
|
|
@ -229,7 +229,7 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs,
|
|||
s+=s_res;
|
||||
t+=t_res;
|
||||
}
|
||||
return t_is_prefix ? t-te : ((se-s) - (te-t));
|
||||
return (int) (t_is_prefix ? t-te : ((se-s) - (te-t)));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -344,14 +344,14 @@ static int my_strncasecmp_ucs2(CHARSET_INFO *cs,
|
|||
s+=s_res;
|
||||
t+=t_res;
|
||||
}
|
||||
return ( (se-s) - (te-t) );
|
||||
return (int) ( (se-s) - (te-t) );
|
||||
}
|
||||
|
||||
|
||||
static int my_strcasecmp_ucs2(CHARSET_INFO *cs, const char *s, const char *t)
|
||||
{
|
||||
uint s_len=strlen(s);
|
||||
uint t_len=strlen(t);
|
||||
uint s_len= (uint) strlen(s);
|
||||
uint t_len= (uint) strlen(t);
|
||||
uint len = (s_len > t_len) ? s_len : t_len;
|
||||
return my_strncasecmp_ucs2(cs, s, t, len);
|
||||
}
|
||||
|
@ -386,7 +386,7 @@ static int my_strnxfrm_ucs2(CHARSET_INFO *cs,
|
|||
dst+=res;
|
||||
}
|
||||
if (dst < de)
|
||||
cs->cset->fill(cs, (char*) dst, de - dst, ' ');
|
||||
cs->cset->fill(cs, (char*) dst, (uint) (de - dst), ' ');
|
||||
return dstlen;
|
||||
}
|
||||
|
||||
|
@ -1370,7 +1370,7 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
|
|||
s+=s_res;
|
||||
t+=t_res;
|
||||
}
|
||||
return t_is_prefix ? t-te : ((se-s) - (te-t));
|
||||
return (int) (t_is_prefix ? t-te : ((se-s) - (te-t)));
|
||||
}
|
||||
|
||||
static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs,
|
||||
|
@ -1387,8 +1387,8 @@ static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs,
|
|||
static
|
||||
int my_strcasecmp_ucs2_bin(CHARSET_INFO *cs, const char *s, const char *t)
|
||||
{
|
||||
uint s_len=strlen(s);
|
||||
uint t_len=strlen(t);
|
||||
uint s_len= (uint) strlen(s);
|
||||
uint t_len= (uint) strlen(t);
|
||||
uint len = (s_len > t_len) ? s_len : t_len;
|
||||
return my_strncasecmp_ucs2(cs, s, t, len);
|
||||
}
|
||||
|
@ -1525,7 +1525,7 @@ ulong my_scan_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
|||
if (str[0] != '\0' || str[1] != ' ')
|
||||
break;
|
||||
}
|
||||
return str - str0;
|
||||
return (ulong) (str - str0);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -8270,7 +8270,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
|||
if (b >= (uchar *) end) /* need more bytes */
|
||||
{
|
||||
*error= 1;
|
||||
return chbeg - beg; /* unexpected EOL */
|
||||
return (uint) (chbeg - beg); /* unexpected EOL */
|
||||
}
|
||||
|
||||
if (ch == 0x8E) /* [x8E][xA0-xDF] */
|
||||
|
@ -8278,7 +8278,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
|||
if (*b >= 0xA0 && *b <= 0xDF)
|
||||
continue;
|
||||
*error= 1;
|
||||
return chbeg - beg; /* invalid sequence */
|
||||
return (uint) (chbeg - beg); /* invalid sequence */
|
||||
}
|
||||
|
||||
if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */
|
||||
|
@ -8287,7 +8287,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
|||
if (b >= (uchar*) end)
|
||||
{
|
||||
*error= 1;
|
||||
return chbeg - beg; /* unexpected EOL */
|
||||
return (uint) (chbeg - beg); /* unexpected EOL */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8295,9 +8295,9 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
|||
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
|
||||
continue;
|
||||
*error= 1;
|
||||
return chbeg - beg; /* invalid sequence */
|
||||
return (uint) (chbeg - beg); /* invalid sequence */
|
||||
}
|
||||
return b - (uchar *) beg;
|
||||
return (uint) (b - (uchar *) beg);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1932,7 +1932,7 @@ static uchar to_upper_utf8[] = {
|
|||
static inline int bincmp(const uchar *s, const uchar *se,
|
||||
const uchar *t, const uchar *te)
|
||||
{
|
||||
int slen=se-s, tlen=te-t;
|
||||
int slen= (int) (se-s), tlen= (int) (te-t);
|
||||
int len=min(slen,tlen);
|
||||
int cmp= memcmp(s,t,len);
|
||||
return cmp ? cmp : slen-tlen;
|
||||
|
@ -2108,7 +2108,7 @@ static uint my_caseup_utf8(CHARSET_INFO *cs, char *src, uint srclen,
|
|||
src+= srcres;
|
||||
dst+= dstres;
|
||||
}
|
||||
return dst - dst0;
|
||||
return (uint) (dst - dst0);
|
||||
}
|
||||
|
||||
static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen,
|
||||
|
@ -2141,7 +2141,7 @@ static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen,
|
|||
|
||||
static void my_caseup_str_utf8(CHARSET_INFO * cs, char * s)
|
||||
{
|
||||
uint len= strlen(s);
|
||||
uint len= (uint) strlen(s);
|
||||
my_caseup_utf8(cs, s, len, s, len);
|
||||
}
|
||||
|
||||
|
@ -2165,12 +2165,12 @@ static uint my_casedn_utf8(CHARSET_INFO *cs, char *src, uint srclen,
|
|||
src+= srcres;
|
||||
dst+= dstres;
|
||||
}
|
||||
return dst - dst0;
|
||||
return (uint) (dst - dst0);
|
||||
}
|
||||
|
||||
static void my_casedn_str_utf8(CHARSET_INFO *cs, char * s)
|
||||
{
|
||||
uint len= strlen(s);
|
||||
uint len= (uint) strlen(s);
|
||||
my_casedn_utf8(cs, s, len, s, len);
|
||||
}
|
||||
|
||||
|
@ -2210,7 +2210,7 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs,
|
|||
s+=s_res;
|
||||
t+=t_res;
|
||||
}
|
||||
return t_is_prefix ? t-te : ((se-s) - (te-t));
|
||||
return (int) (t_is_prefix ? t-te : ((se-s) - (te-t)));
|
||||
}
|
||||
|
||||
|
||||
|
@ -2284,8 +2284,8 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs,
|
|||
t+=t_res;
|
||||
}
|
||||
|
||||
slen= se-s;
|
||||
tlen= te-t;
|
||||
slen= (uint) (se-s);
|
||||
tlen= (uint) (te-t);
|
||||
res= 0;
|
||||
|
||||
if (slen != tlen)
|
||||
|
|
|
@ -216,7 +216,7 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, uint len)
|
|||
{
|
||||
struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data;
|
||||
struct my_cs_file_section_st *s;
|
||||
int state= (s=cs_file_sec(st->attr,strlen(st->attr))) ? s->state : 0;
|
||||
int state= (int)((s=cs_file_sec(st->attr, (int) strlen(st->attr))) ? s->state : 0);
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
if(0){
|
||||
|
|
|
@ -472,7 +472,7 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result)
|
|||
else
|
||||
{
|
||||
i= DIG_PER_DEC1 - 1;
|
||||
start= (buf_beg - from->buf) * DIG_PER_DEC1;
|
||||
start= (int) ((buf_beg - from->buf) * DIG_PER_DEC1);
|
||||
}
|
||||
if (buf_beg < end)
|
||||
for (; *buf_beg < powers10[i--]; start++) ;
|
||||
|
@ -484,13 +484,13 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result)
|
|||
/* find non-zero decimal digit from the end */
|
||||
if (buf_end == end - 1 && from->frac)
|
||||
{
|
||||
stop= ((buf_end - from->buf) * DIG_PER_DEC1 +
|
||||
(i= ((from->frac - 1) % DIG_PER_DEC1 + 1)));
|
||||
stop= (int) (((buf_end - from->buf) * DIG_PER_DEC1 +
|
||||
(i= ((from->frac - 1) % DIG_PER_DEC1 + 1))));
|
||||
i= DIG_PER_DEC1 - i + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
stop= (buf_end - from->buf + 1) * DIG_PER_DEC1;
|
||||
stop= (int) ((buf_end - from->buf + 1) * DIG_PER_DEC1);
|
||||
i= 1;
|
||||
}
|
||||
for (; *buf_end % powers10[i++] == 0; stop--);
|
||||
|
@ -794,13 +794,13 @@ internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed)
|
|||
s1=s;
|
||||
while (s < end_of_string && my_isdigit(&my_charset_latin1, *s))
|
||||
s++;
|
||||
intg=s-s1;
|
||||
intg= (int) (s-s1);
|
||||
if (s < end_of_string && *s=='.')
|
||||
{
|
||||
endp= s+1;
|
||||
while (endp < end_of_string && my_isdigit(&my_charset_latin1, *endp))
|
||||
endp++;
|
||||
frac= endp - s - 1;
|
||||
frac= (int) (endp - s - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1490,11 +1490,31 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
|
|||
buf1+=intg0+frac0-1;
|
||||
if (scale == frac0*DIG_PER_DEC1)
|
||||
{
|
||||
int do_inc= FALSE;
|
||||
DBUG_ASSERT(frac0+intg0 >= 0);
|
||||
x=buf0[1]/DIG_MASK;
|
||||
if (x > round_digit ||
|
||||
(round_digit == 5 && x == 5 && (mode == HALF_UP ||
|
||||
(frac0+intg0 > 0 && *buf0 & 1))))
|
||||
switch (round_digit)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
dec1 *p0= buf0 + (frac1-frac0);
|
||||
for (; p0 > buf0; p0--)
|
||||
if (*p0)
|
||||
{
|
||||
do_inc= TRUE;
|
||||
break;
|
||||
};
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
x= buf0[1]/DIG_MASK;
|
||||
do_inc= (x>5) || ((x == 5) &&
|
||||
(mode == HALF_UP || (frac0+intg0 > 0 && *buf0 & 1)));
|
||||
break;
|
||||
};
|
||||
default:;
|
||||
};
|
||||
if (do_inc)
|
||||
{
|
||||
if (frac0+intg0>0)
|
||||
(*buf1)++;
|
||||
|
@ -1509,6 +1529,7 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
|
|||
}
|
||||
else
|
||||
{
|
||||
/* TODO - fix this code as it won't work for CEILING mode */
|
||||
int pos=frac0*DIG_PER_DEC1-scale-1;
|
||||
DBUG_ASSERT(frac0+intg0 > 0);
|
||||
x=*buf1 / powers10[pos];
|
||||
|
@ -1563,7 +1584,13 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
|
|||
break;
|
||||
if (buf1-- == to->buf)
|
||||
{
|
||||
decimal_make_zero(to);
|
||||
/* making 'zero' with the proper scale */
|
||||
dec1 *p0= to->buf + frac0 + 1;
|
||||
to->intg=1;
|
||||
to->frac= max(scale, 0);
|
||||
to->sign= 0;
|
||||
for (buf1= to->buf; buf1<p0; buf1++)
|
||||
*buf1= 0;
|
||||
return E_DEC_OK;
|
||||
}
|
||||
}
|
||||
|
@ -1715,14 +1742,14 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
|
|||
while (buf1 < stop1 && *buf1 == 0)
|
||||
buf1++;
|
||||
start1=buf1;
|
||||
intg1=stop1-buf1;
|
||||
intg1= (int) (stop1-buf1);
|
||||
}
|
||||
if (unlikely(*buf2 == 0))
|
||||
{
|
||||
while (buf2 < stop2 && *buf2 == 0)
|
||||
buf2++;
|
||||
start2=buf2;
|
||||
intg2=stop2-buf2;
|
||||
intg2= (int) (stop2-buf2);
|
||||
}
|
||||
if (intg2 > intg1)
|
||||
carry=1;
|
||||
|
@ -1734,8 +1761,8 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
|
|||
end1--;
|
||||
while (unlikely((buf2 <= end2) && (*end2 == 0)))
|
||||
end2--;
|
||||
frac1= (end1 - stop1) + 1;
|
||||
frac2= (end2 - stop2) + 1;
|
||||
frac1= (int) (end1 - stop1) + 1;
|
||||
frac2= (int) (end2 - stop2) + 1;
|
||||
while (buf1 <=end1 && buf2 <= end2 && *buf1 == *buf2)
|
||||
buf1++, buf2++;
|
||||
if (buf1 <= end1)
|
||||
|
@ -2086,7 +2113,7 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2,
|
|||
/* removing end zeroes */
|
||||
while (*stop2 == 0 && stop2 >= start2)
|
||||
stop2--;
|
||||
len2= stop2++ - start2;
|
||||
len2= (int) (stop2++ - start2);
|
||||
|
||||
/*
|
||||
calculating norm2 (normalized *start2) - we need *start2 to be large
|
||||
|
@ -2173,7 +2200,7 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2,
|
|||
if (dcarry)
|
||||
*--start1=dcarry;
|
||||
buf0=to->buf;
|
||||
intg0=ROUND_UP(prec1-frac1)-(start1-tmp1);
|
||||
intg0=(int) (ROUND_UP(prec1-frac1)-(start1-tmp1));
|
||||
frac0=ROUND_UP(to->frac);
|
||||
error=E_DEC_OK;
|
||||
if (unlikely(frac0==0 && intg0==0))
|
||||
|
|
|
@ -148,7 +148,7 @@ static int my_xml_enter(MY_XML_PARSER *st, const char *str, uint len)
|
|||
memcpy(st->attrend,str,len);
|
||||
st->attrend+=len;
|
||||
st->attrend[0]='\0';
|
||||
return st->enter ? st->enter(st,st->attr,st->attrend-st->attr) : MY_XML_OK;
|
||||
return st->enter ? st->enter(st,st->attr,st->attrend-st->attr) : MY_XML_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -170,7 +170,7 @@ static int my_xml_leave(MY_XML_PARSER *p, const char *str, uint slen)
|
|||
|
||||
/* Find previous '.' or beginning */
|
||||
for( e=p->attrend; (e>p->attr) && (e[0]!='.') ; e--);
|
||||
glen = (e[0]=='.') ? (p->attrend-e-1) : p->attrend-e;
|
||||
glen = (uint) ((e[0]=='.') ? (p->attrend-e-1) : p->attrend-e);
|
||||
|
||||
if (str && (slen != glen))
|
||||
{
|
||||
|
@ -180,7 +180,7 @@ static int my_xml_leave(MY_XML_PARSER *p, const char *str, uint slen)
|
|||
return MY_XML_ERROR;
|
||||
}
|
||||
|
||||
rc = p->leave_xml ? p->leave_xml(p,p->attr,p->attrend-p->attr) : MY_XML_OK;
|
||||
rc = p->leave_xml ? p->leave_xml(p,p->attr,p->attrend-p->attr) : MY_XML_OK;
|
||||
|
||||
*e='\0';
|
||||
p->attrend=e;
|
||||
|
@ -221,7 +221,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
|
|||
sprintf(p->errstr,"1: %s unexpected (ident wanted)",lex2str(lex));
|
||||
return MY_XML_ERROR;
|
||||
}
|
||||
if(MY_XML_OK!=my_xml_leave(p,a.beg,a.end-a.beg))
|
||||
if(MY_XML_OK!=my_xml_leave(p,a.beg,(uint) (a.end-a.beg)))
|
||||
return MY_XML_ERROR;
|
||||
lex=my_xml_scan(p,&a);
|
||||
goto gt;
|
||||
|
@ -240,7 +240,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
|
|||
|
||||
if (MY_XML_IDENT==lex)
|
||||
{
|
||||
if(MY_XML_OK!=my_xml_enter(p,a.beg,a.end-a.beg))
|
||||
if(MY_XML_OK!=my_xml_enter(p,a.beg,(uint) (a.end-a.beg)))
|
||||
return MY_XML_ERROR;
|
||||
}
|
||||
else
|
||||
|
@ -258,9 +258,9 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
|
|||
lex=my_xml_scan(p,&b);
|
||||
if ( (lex==MY_XML_IDENT) || (lex==MY_XML_STRING) )
|
||||
{
|
||||
if((MY_XML_OK!=my_xml_enter(p,a.beg,a.end-a.beg)) ||
|
||||
(MY_XML_OK!=my_xml_value(p,b.beg,b.end-b.beg)) ||
|
||||
(MY_XML_OK!=my_xml_leave(p,a.beg,a.end-a.beg)))
|
||||
if((MY_XML_OK!=my_xml_enter(p,a.beg,(uint) (a.end-a.beg))) ||
|
||||
(MY_XML_OK!=my_xml_value(p,b.beg,(uint) (b.end-b.beg))) ||
|
||||
(MY_XML_OK!=my_xml_leave(p,a.beg,(uint) (a.end-a.beg))))
|
||||
return MY_XML_ERROR;
|
||||
}
|
||||
else
|
||||
|
@ -272,8 +272,8 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
|
|||
}
|
||||
else if ( (MY_XML_STRING==lex) || (MY_XML_IDENT==lex) )
|
||||
{
|
||||
if((MY_XML_OK!=my_xml_enter(p,a.beg,a.end-a.beg)) ||
|
||||
(MY_XML_OK!=my_xml_leave(p,a.beg,a.end-a.beg)))
|
||||
if((MY_XML_OK!=my_xml_enter(p,a.beg,(uint) (a.end-a.beg))) ||
|
||||
(MY_XML_OK!=my_xml_leave(p,a.beg,(uint) (a.end-a.beg))))
|
||||
return MY_XML_ERROR;
|
||||
}
|
||||
else
|
||||
|
@ -321,7 +321,7 @@ gt:
|
|||
my_xml_norm_text(&a);
|
||||
if (a.beg!=a.end)
|
||||
{
|
||||
my_xml_value(p,a.beg,a.end-a.beg);
|
||||
my_xml_value(p,a.beg,(uint) (a.end-a.beg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ uint my_xml_error_pos(MY_XML_PARSER *p)
|
|||
if (s[0]=='\n')
|
||||
beg=s;
|
||||
}
|
||||
return p->cur-beg;
|
||||
return (uint) (p->cur-beg);
|
||||
}
|
||||
|
||||
uint my_xml_error_lineno(MY_XML_PARSER *p)
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
%define mysql_version @VERSION@
|
||||
%ifarch i386
|
||||
# use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x)
|
||||
# to enable static linking (off by default)
|
||||
%{?_with_static:%define STATIC_BUILD 1}
|
||||
%{!?_with_static:%define STATIC_BUILD 0}
|
||||
%if %{STATIC_BUILD}
|
||||
%define release 0
|
||||
%else
|
||||
%define release 0.glibc23
|
||||
|
@ -342,7 +346,7 @@ make clean
|
|||
# so don't link statically there
|
||||
#
|
||||
BuildMySQL "--disable-shared \
|
||||
%ifarch i386
|
||||
%if %{STATIC_BUILD}
|
||||
--with-mysqld-ldflags='-all-static' \
|
||||
--with-client-ldflags='-all-static' \
|
||||
$USE_OTHER_LIBC_DIR \
|
||||
|
@ -662,6 +666,13 @@ fi
|
|||
# itself - note that they must be ordered by date (important when
|
||||
# merging BK trees)
|
||||
%changelog
|
||||
* Tue Jun 14 2005 Lenz Grimmer <lenz@mysql.com>
|
||||
|
||||
- Do not build statically on i386 by default, only when adding either "--with
|
||||
static" or "--define '_with_static 1'" to the RPM build options. Static
|
||||
linking really only makes sense when linking against the specially patched
|
||||
glibc 2.2.5.
|
||||
|
||||
* Mon Jun 06 2005 Lenz Grimmer <lenz@mysql.com>
|
||||
|
||||
- added mysql_client_test to the "bench" subpackage (BUG 10676)
|
||||
|
|
|
@ -13145,6 +13145,62 @@ static void test_bug9643()
|
|||
myquery(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
Bug#11111: fetch from view returns wrong data
|
||||
*/
|
||||
|
||||
static void test_bug11111()
|
||||
{
|
||||
MYSQL_STMT *stmt;
|
||||
MYSQL_BIND bind[2];
|
||||
char buf[2][20];
|
||||
long len[2];
|
||||
int i;
|
||||
int rc;
|
||||
const char * query = "SELECT DISTINCT f1,ff2 FROM v1";
|
||||
myheader("test_bug11111");
|
||||
|
||||
rc= mysql_query(mysql, "drop table if exists t1, t2, v1");
|
||||
myquery(rc);
|
||||
rc= mysql_query(mysql, "drop view if exists t1, t2, v1");
|
||||
myquery(rc);
|
||||
rc= mysql_query(mysql, "create table t1 (f1 int, f2 int)");
|
||||
myquery(rc);
|
||||
rc= mysql_query(mysql, "create table t2 (ff1 int, ff2 int)");
|
||||
myquery(rc);
|
||||
rc= mysql_query(mysql, "create view v1 as select * from t1, t2 where f1=ff1");
|
||||
myquery(rc);
|
||||
rc= mysql_query(mysql, "insert into t1 values (1,1), (2,2), (3,3)");
|
||||
myquery(rc);
|
||||
rc= mysql_query(mysql, "insert into t2 values (1,1), (2,2), (3,3)");
|
||||
myquery(rc);
|
||||
|
||||
stmt = mysql_stmt_init(mysql);
|
||||
|
||||
mysql_stmt_prepare(stmt, query, strlen(query));
|
||||
mysql_stmt_execute(stmt);
|
||||
|
||||
for (i=0; i < 2; i++) {
|
||||
memset(&bind[i], '\0', sizeof(MYSQL_BIND));
|
||||
bind[i].buffer_type= MYSQL_TYPE_STRING;
|
||||
bind[i].buffer= (gptr *)&buf[i];
|
||||
bind[i].buffer_length= 20;
|
||||
bind[i].length= &len[i];
|
||||
}
|
||||
|
||||
if (mysql_stmt_bind_result(stmt, bind))
|
||||
printf("Error: %s\n", mysql_stmt_error(stmt));
|
||||
|
||||
mysql_stmt_fetch(stmt);
|
||||
printf("return: %s", buf[1]);
|
||||
DIE_UNLESS(!strcmp(buf[1],"1"));
|
||||
mysql_stmt_close(stmt);
|
||||
rc= mysql_query(mysql, "drop view v1");
|
||||
myquery(rc);
|
||||
rc= mysql_query(mysql, "drop table t1, t2");
|
||||
myquery(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
Check that proper cleanups are done for prepared statement when
|
||||
fetching thorugh a cursor.
|
||||
|
@ -13439,6 +13495,7 @@ static struct my_tests_st my_tests[]= {
|
|||
{ "test_bug9478", test_bug9478 },
|
||||
{ "test_bug9643", test_bug9643 },
|
||||
{ "test_bug10729", test_bug10729 },
|
||||
{ "test_bug11111", test_bug11111 },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
|
|
@ -15,13 +15,18 @@
|
|||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Process this file with automake to create Makefile.in
|
||||
|
||||
if HAVE_YASSL
|
||||
yassl_dummy_link_fix= $(top_srcdir)/extra/yassl/src/dummy.cpp
|
||||
else
|
||||
yassl_dummy_link_fix=
|
||||
endif
|
||||
INCLUDES=-I$(top_srcdir)/include $(openssl_includes) \
|
||||
-I$(top_builddir)/include
|
||||
LDADD= @CLIENT_EXTRA_LDFLAGS@ \
|
||||
$(top_builddir)/libmysql_r/libmysqlclient_r.la \
|
||||
@openssl_libs@ @ZLIB_LIBS@
|
||||
bin_PROGRAMS= mysqltestmanager
|
||||
mysqltestmanager_SOURCES= mysqlmanager.c
|
||||
mysqltestmanager_SOURCES= mysqlmanager.c $(yassl_dummy_link_fix)
|
||||
mysqltestmanager_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
|
||||
DEF= -DUNDEF_THREADS_HACK
|
||||
|
||||
|
|
Loading…
Reference in a new issue