stark писал(а):
Tau писал(а):
stark писал(а):
Tau писал(а):
В исключении падает SQL-ошибка:
Код:
Unknown column 'input_octets' in 'field list'
Тут опять лучше ошибку со всем стеком.
Это всё, что вернул
getMessage().
В логах сервера ошибки не было ?
В логах ошибок не было.
Вот что идет в MySQL:
Код:
0x0030: d2d1 08ca cf00 0000 0353 454c 4543 5420 .........SELECT.
0x0040: 2043 4f55 4e54 2869 6429 2c20 5355 4d28 .COUNT(id),.SUM(
0x0050: 7365 7373 696f 6e5f 636f 7374 292c 2053 session_cost),.S
0x0060: 554d 2873 6573 7369 6f6e 5f74 696d 6529 UM(session_time)
0x0070: 2c20 5355 4d28 696e 7075 745f 6f63 7465 ,.SUM(input_octe
0x0080: 7473 292c 2053 554d 286f 7574 7075 745f ts),.SUM(output_
0x0090: 6f63 7465 7473 2920 4652 4f4d 206c 6f67 octets).FROM.log
0x00a0: 5f73 6573 7369 6f6e 5f33 5f32 3031 3530 _session_3_20150
0x00b0: 3620 5748 4552 4520 6c69 643d 3130 3920 6.WHERE.lid=109.
0x00c0: 414e 4420 4441 594f 464d 4f4e 5448 2820 AND.DAYOFMONTH(.
0x00d0: 7365 7373 696f 6e5f 7374 6172 7420 293e session_start.)>
0x00e0: 3d31 2020 414e 4420 4441 594f 464d 4f4e =1..AND.DAYOFMON
0x00f0: 5448 2820 7365 7373 696f 6e5f 7374 6172 TH(.session_star
0x0100: 7420 293c 3d31 20 t.)<=1.
Ответ:
Код:
0x0000: 4508 006e 607b 4000 4006 dc04 7f00 0001 E..n`{@.@.......
0x0010: 7f00 0001 0cea c77f 16d2 0b6f c4d7 4795 ...........o..G.
0x0020: 8018 0400 fe62 0000 0101 080a d2d1 08d6 .....b..........
0x0030: d2d1 08d6 3600 0001 ff1e 0423 3432 5332 ....6......#42S2
0x0040: 3255 6e6b 6e6f 776e 2063 6f6c 756d 6e20 2Unknown.column.
0x0050: 2769 6e70 7574 5f6f 6374 6574 7327 2069 'input_octets'.i
0x0060: 6e20 2766 6965 6c64 206c 6973 7427 n.'field.list'
Запрос получается такой:
Код:
select count(id), sum(session_cost), sum(session_time), sum(input_octets), sum(output_octets) from log_session_3_201506 where ...
Но таблица не имеет поля input_octets (и output_octets):
Код:
mysql> desc log_session_3_201506;
+-------------------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------------+---------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| type | int(11) | NO | | NULL | |
| nas_id | int(11) | NO | MUL | NULL | |
| lid | int(11) | NO | MUL | NULL | |
| cid | int(11) | NO | MUL | NULL | |
| session_start | datetime | NO | MUL | NULL | |
| session_time | int(11) | NO | | NULL | |
| round_session_time | int(11) | NO | | NULL | |
| from_number | char(16) | NO | | NULL | |
| to_number | char(16) | NO | | NULL | |
| dest_code | int(11) | NO | | NULL | |
| zone | int(11) | NO | MUL | NULL | |
| min_cost | float(10,5) | NO | | NULL | |
| session_cost | decimal(10,5) | NO | | NULL | |
| oper_id | int(11) | NO | MUL | 0 | |
| oper_round_session_time | int(11) | NO | | 0 | |
| oper_session_cost | decimal(10,5) | NO | | 0.00000 | |
| sid | int(11) | NO | | NULL | |
| h323_id | char(40) | NO | | NULL | |
| dc | char(4) | YES | | NULL | |
| lr | int(11) | NO | | NULL | |
+-------------------------+---------------+------+-----+---------+----------------+
21 rows in set (0.00 sec)