Héctor Villafuerte D. wrote:
> Hi all,
> Could you please tell me what can be causing this warnings? How can I
> see them?
> My Python script is dying because of this warnings :(
> Since I'm using 4.0.16, I can't use SHOW WARNINGS.
> Thanks in advance,
> Hector
>
>
> mysql> create table new_web select a.* from otr_new as a join internet
> as b on a.telefb = b.tel;
> Query OK, 25335 rows affected (46.98 sec)
> Records: 25335 Duplicates: 0 Warnings: 311
>
> mysql> explain select a.* from otr_new as a join internet as b on
> a.telefb = b.tel;
>
> +-------+-------+---------------+------+---------+----------+---------+--------------------------+
> | table | type | possible_keys | key | key_len | ref | rows
> | Extra |
>
> +-------+-------+---------------+------+---------+----------+---------+--------------------------+
> | a | index | NULL | tel | 47 | NULL | 3343166
> | Using index |
> | b | ref | tel | tel | 8 | a.telefb | 11
> | Using where; Using index |
>
> +-------+-------+---------------+------+---------+----------+---------+--------------------------+
> 2 rows in set (0.00 sec)
>
> mysql> select version();
> +-----------+
> | version() |
> +-----------+
> | 4.0.16-nt |
> +-----------+
> 1 row in set (0.02 sec)
>
> mysql> explain otr_new;
> +------------+----------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +------------+----------+------+-----+---------+-------+
> | tel | char(8) | YES | MUL | NULL | |
> | telefb | char(14) | YES | | NULL | |
> | rutaentran | char(8) | YES | | NULL | |
> | rutasalien | char(8) | YES | | NULL | |
> | minutos | int(7) | YES | | NULL | |
> +------------+----------+------+-----+---------+-------+
> 5 rows in set (0.00 sec)
>
> mysql> explain internet;
> +-------+----------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +-------+----------+------+-----+---------+-------+
> | tel | char(7) | YES | MUL | NULL | |
> | modem | char(30) | YES | | NULL | |
> +-------+----------+------+-----+---------+-------+
> 2 rows in set (0.00 sec)
>
> mysql> explain new_web;
> +------------+----------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +------------+----------+------+-----+---------+-------+
> | tel | char(8) | YES | | NULL | |
> | telefb | char(14) | YES | | NULL | |
> | rutaentran | char(8) | YES | | NULL | |
> | rutasalien | char(8) | YES | | NULL | |
> | minutos | int(7) | YES | | NULL | |
> +------------+----------+------+-----+---------+-------+
> 5 rows in set (0.00 sec)
>
>
>
hmmm, a pretty strange behaviour we have here....
Look what I did:
(1) Increase the length of 'internet.tel' field (so it matches
'otr_new.telefb')
mysql> explain internet;
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+----------+------+-----+---------+-------+
| tel | char(14) | YES | MUL | NULL | |
| modem | char(30) | YES | | NULL | |
+-------+----------+------+-----+---------+-------+
2 rows in set (0.00 sec)
(2) Run the query... and voila!
mysql> create table tmp_web3 select a.* from otr_new as a join internet
as b ON a.telefb = b.tel;
Query OK, 25335 rows affected (49.02 sec)
Records: 25335 Duplicates: 0 Warnings: 0
The number of records found are the same in both queries, but this one
has no warnings!
Am I missing something obvious here?
Thanks in advance.