@@ -4110,33 +4110,33 @@ call bug14376(4711)|
4110
4110
x
4111
4111
4711
4112
4112
drop procedure bug14376|
4113
- drop procedure if exists p1 |
4114
- drop table if exists t1 |
4115
- create table t1 (a varchar(255))|
4116
- insert into t1 (a) values ("a - table column")|
4117
- create procedure p1 (a varchar(255))
4113
+ drop procedure if exists bug5967 |
4114
+ drop table if exists t3 |
4115
+ create table t3 (a varchar(255))|
4116
+ insert into t3 (a) values ("a - table column")|
4117
+ create procedure bug5967 (a varchar(255))
4118
4118
begin
4119
4119
declare i varchar(255);
4120
- declare c cursor for select a from t1 ;
4120
+ declare c cursor for select a from t3 ;
4121
4121
select a;
4122
- select a from t1 into i;
4122
+ select a from t3 into i;
4123
4123
select i as 'Parameter takes precedence over table column'; open c;
4124
4124
fetch c into i;
4125
4125
close c;
4126
4126
select i as 'Parameter takes precedence over table column in cursors';
4127
4127
begin
4128
4128
declare a varchar(255) default 'a - local variable';
4129
- declare c1 cursor for select a from t1 ;
4129
+ declare c1 cursor for select a from t3 ;
4130
4130
select a as 'A local variable takes precedence over parameter';
4131
4131
open c1;
4132
4132
fetch c1 into i;
4133
4133
close c1;
4134
4134
select i as 'A local variable takes precedence over parameter in cursors';
4135
4135
begin
4136
4136
declare a varchar(255) default 'a - local variable in a nested compound statement';
4137
- declare c2 cursor for select a from t1 ;
4137
+ declare c2 cursor for select a from t3 ;
4138
4138
select a as 'A local variable in a nested compound statement takes precedence over a local variable in the outer statement';
4139
- select a from t1 into i;
4139
+ select a from t3 into i;
4140
4140
select i as 'A local variable in a nested compound statement takes precedence over table column';
4141
4141
open c2;
4142
4142
fetch c2 into i;
@@ -4145,7 +4145,7 @@ select i as 'A local variable in a nested compound statement takes precedence o
4145
4145
end;
4146
4146
end;
4147
4147
end|
4148
- call p1 ("a - stored procedure parameter")|
4148
+ call bug5967 ("a - stored procedure parameter")|
4149
4149
a
4150
4150
a - stored procedure parameter
4151
4151
Parameter takes precedence over table column
@@ -4162,7 +4162,7 @@ A local variable in a nested compound statement takes precedence over table colu
4162
4162
a - local variable in a nested compound statement
4163
4163
A local variable in a nested compound statement takes precedence over table column in cursors
4164
4164
a - local variable in a nested compound statement
4165
- drop procedure p1 |
4165
+ drop procedure bug5967 |
4166
4166
drop procedure if exists bug13012|
4167
4167
create procedure bug13012()
4168
4168
BEGIN
@@ -4190,17 +4190,17 @@ call bug13012()|
4190
4190
Table Op Msg_type Msg_text
4191
4191
test.t1 repair status OK
4192
4192
test.t2 repair status OK
4193
- test.t3 repair error Table 'test.t3' doesn't exist
4193
+ test.t3 repair status OK
4194
4194
test.v1 repair error 'test.v1' is not BASE TABLE
4195
4195
Table Op Msg_type Msg_text
4196
4196
test.t1 optimize status OK
4197
4197
test.t2 optimize status OK
4198
- test.t3 optimize error Table 'test.t3' doesn't exist
4198
+ test.t3 optimize status OK
4199
4199
test.v1 optimize error 'test.v1' is not BASE TABLE
4200
4200
Table Op Msg_type Msg_text
4201
4201
test.t1 analyze status Table is already up to date
4202
4202
test.t2 analyze status Table is already up to date
4203
- test.t3 analyze error Table 'test.t3' doesn't exist
4203
+ test.t3 analyze status Table is already up to date
4204
4204
test.v1 analyze error 'test.v1' is not BASE TABLE
4205
4205
Warnings:
4206
4206
Error 1146 Table 'test.t3' doesn't exist
@@ -4213,17 +4213,17 @@ call bug13012()|
4213
4213
Table Op Msg_type Msg_text
4214
4214
test.t1 repair status OK
4215
4215
test.t2 repair status OK
4216
- test.t3 repair error Table 'test.t3' doesn't exist
4216
+ test.t3 repair status OK
4217
4217
test.v1 repair error 'test.v1' is not BASE TABLE
4218
4218
Table Op Msg_type Msg_text
4219
4219
test.t1 optimize status OK
4220
4220
test.t2 optimize status OK
4221
- test.t3 optimize error Table 'test.t3' doesn't exist
4221
+ test.t3 optimize status OK
4222
4222
test.v1 optimize error 'test.v1' is not BASE TABLE
4223
4223
Table Op Msg_type Msg_text
4224
4224
test.t1 analyze status Table is already up to date
4225
4225
test.t2 analyze status Table is already up to date
4226
- test.t3 analyze error Table 'test.t3' doesn't exist
4226
+ test.t3 analyze status Table is already up to date
4227
4227
test.v1 analyze error 'test.v1' is not BASE TABLE
4228
4228
Warnings:
4229
4229
Error 1146 Table 'test.t3' doesn't exist
@@ -4236,17 +4236,17 @@ call bug13012()|
4236
4236
Table Op Msg_type Msg_text
4237
4237
test.t1 repair status OK
4238
4238
test.t2 repair status OK
4239
- test.t3 repair error Table 'test.t3' doesn't exist
4239
+ test.t3 repair status OK
4240
4240
test.v1 repair error 'test.v1' is not BASE TABLE
4241
4241
Table Op Msg_type Msg_text
4242
4242
test.t1 optimize status OK
4243
4243
test.t2 optimize status OK
4244
- test.t3 optimize error Table 'test.t3' doesn't exist
4244
+ test.t3 optimize status OK
4245
4245
test.v1 optimize error 'test.v1' is not BASE TABLE
4246
4246
Table Op Msg_type Msg_text
4247
4247
test.t1 analyze status Table is already up to date
4248
4248
test.t2 analyze status Table is already up to date
4249
- test.t3 analyze error Table 'test.t3' doesn't exist
4249
+ test.t3 analyze status Table is already up to date
4250
4250
test.v1 analyze error 'test.v1' is not BASE TABLE
4251
4251
Warnings:
4252
4252
Error 1146 Table 'test.t3' doesn't exist
@@ -4258,8 +4258,17 @@ Error 1347 'test.v1' is not BASE TABLE
4258
4258
drop procedure bug13012|
4259
4259
drop view v1;
4260
4260
select * from t1|
4261
- a
4262
- a - table column
4261
+ id data
4262
+ aa 0
4263
+ aa 1
4264
+ aa 2
4265
+ aa 3
4266
+ aa 4
4267
+ aa 5
4268
+ aa 6
4269
+ aa 7
4270
+ aa 8
4271
+ aa 9
4263
4272
drop schema if exists mysqltest1|
4264
4273
Warnings:
4265
4274
Note 1008 Can't drop database 'mysqltest1'; database doesn't exist
@@ -4299,4 +4308,31 @@ drop schema if exists mysqltest1|
4299
4308
drop schema if exists mysqltest2|
4300
4309
drop schema if exists mysqltest3|
4301
4310
use test|
4311
+ drop table if exists t3|
4312
+ drop procedure if exists bug15441|
4313
+ create table t3 (id int not null primary key, county varchar(25))|
4314
+ insert into t3 (id, county) values (1, 'York')|
4315
+ create procedure bug15441(c varchar(25))
4316
+ begin
4317
+ update t3 set id=2, county=values(c);
4318
+ end|
4319
+ call bug15441('county')|
4320
+ ERROR 42S22: Unknown column 'c' in 'field list'
4321
+ drop procedure bug15441|
4322
+ create procedure bug15441(county varchar(25))
4323
+ begin
4324
+ declare c varchar(25) default "hello";
4325
+ insert into t3 (id, county) values (1, county)
4326
+ on duplicate key update county= values(county);
4327
+ select * from t3;
4328
+ update t3 set id=2, county=values(id);
4329
+ select * from t3;
4330
+ end|
4331
+ call bug15441('Yale')|
4332
+ id county
4333
+ 1 Yale
4334
+ id county
4335
+ 2 NULL
4336
+ drop table t3|
4337
+ drop procedure bug15441|
4302
4338
drop table t1,t2;
0 commit comments