Ensure that we use unix file format (no \r\n) for all new files
Portability fixes
This commit is contained in:
parent
82c79134b0
commit
b6e5c23c26
@ -71,3 +71,4 @@ hours:
|
||||
[arjen:]checkout:get
|
||||
[nick:]checkout:get
|
||||
checkout:edit
|
||||
eoln:unix
|
||||
|
@ -1662,16 +1662,16 @@ int do_while(struct st_query* q)
|
||||
happen for any tests in the test suite.
|
||||
*/
|
||||
|
||||
char my_getc(FILE *file)
|
||||
int my_getc(FILE *file)
|
||||
{
|
||||
if (line_buffer_pos == line_buffer)
|
||||
return fgetc(file);
|
||||
return line_buffer[--line_buffer_pos];
|
||||
return *--line_buffer_pos;
|
||||
}
|
||||
|
||||
void my_ungetc(int c)
|
||||
{
|
||||
line_buffer[line_buffer_pos++]= c;
|
||||
*line_buffer_pos++= (char) c;
|
||||
}
|
||||
|
||||
|
||||
@ -1692,8 +1692,9 @@ my_bool end_of_query(int c)
|
||||
return 1; /* Found delimiter */
|
||||
|
||||
/* didn't find delimiter, push back things that we read */
|
||||
for (j = 1 ; j <= i ; j++)
|
||||
my_ungetc(tmp[j]);
|
||||
my_ungetc(c);
|
||||
while (i > 1)
|
||||
my_ungetc(tmp[--i]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2396,9 +2397,6 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
if (glob_replace)
|
||||
free_replace();
|
||||
|
||||
if (record)
|
||||
{
|
||||
if (!q->record_file[0] && !result_file)
|
||||
@ -2419,6 +2417,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
|
||||
mysql_error(mysql);
|
||||
|
||||
end:
|
||||
free_replace();
|
||||
last_result=0;
|
||||
if (ds == &ds_tmp)
|
||||
dynstr_free(&ds_tmp);
|
||||
|
@ -271,8 +271,8 @@ delete P1.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Cou
|
||||
select * from t1;
|
||||
N M
|
||||
3 0
|
||||
delete P1.*,P2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
|
||||
ERROR HY000: The target table P2 of the DELETE is not updatable
|
||||
delete P1.*,p2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS p2 ON P1.N = p2.N;
|
||||
ERROR HY000: The target table p2 of the DELETE is not updatable
|
||||
delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
|
||||
ERROR 42S22: Unknown column 'aaa' in 'field list'
|
||||
drop table t1;
|
||||
|
@ -112,6 +112,18 @@ n s
|
||||
2 two test
|
||||
3 three test
|
||||
4 four test
|
||||
stop slave;
|
||||
reset slave;
|
||||
load data from master;
|
||||
start slave;
|
||||
insert into mysqltest.t1 values (5, 'five bar');
|
||||
select * from mysqltest.t1;
|
||||
n s
|
||||
1 one test
|
||||
2 two test
|
||||
3 three test
|
||||
4 four test
|
||||
5 five bar
|
||||
load table mysqltest.t1 from master;
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
drop table mysqltest.t1;
|
||||
|
@ -157,8 +157,8 @@ UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1)
|
||||
UPDATE `t1` AS P1 INNER JOIN (SELECT aaaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
|
||||
delete P1.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
|
||||
select * from t1;
|
||||
--error 1288
|
||||
--replace_result P2 p2
|
||||
--error 1288
|
||||
delete P1.*,P2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
|
||||
-- error 1054
|
||||
delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
|
||||
|
@ -127,11 +127,11 @@ load data from master;
|
||||
start slave;
|
||||
# see if replication coordinates were restored fine
|
||||
connection master;
|
||||
insert into bar.t1 values (5, 'five bar');
|
||||
insert into mysqltest.t1 values (5, 'five bar');
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
select * from bar.t1;
|
||||
select * from mysqltest.t1;
|
||||
|
||||
# Check that LOAD DATA FROM MASTER reports the error if it can't drop a
|
||||
# table to be overwritten.
|
||||
|
Loading…
x
Reference in New Issue
Block a user