Changeset unicode,4 for unicode/doc/notes.html
- Timestamp:
- 12/31/2007 02:17:16 PM (18 years ago)
- revision id:
- svn-v3-trunk1:1c22b0a8-4d0b-0410-a296-af6a2e6f35e3:plain-odbc%2Ftrunk:9
- File:
-
- 1 edited
-
unicode/doc/notes.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
unicode/doc/notes.html
r1 r4 140 140 At least we prevent the coredump of the Oracle driver.<br> 141 141 I am pretty sure that this is a driver bug, Microsoft Access coredumps as well in similar situations. 142 143 144 <h4>MYSQL</h4> 145 This is not one would expect! 146 <pre> 147 mysql> create view bla as select date_add('2007-8-1',interval 1 day) as a; 148 Query OK, 0 rows affected (0.01 sec) 149 150 mysql> desc bla 151 -> ; 152 +-------+---------------+------+-----+---------+-------+ 153 | Field | Type | Null | Key | Default | Extra | 154 +-------+---------------+------+-----+---------+-------+ 155 | a | varbinary(29) | YES | | NULL | | 156 +-------+---------------+------+-----+---------+-------+ 157 1 row in set (0.00 sec) 158 </pre> 159 how to do it right: 160 <pre> 161 mysql> create view bla2 as select date_add(cast('2007-8-1' as datetime),interval 1 day) as a; 162 Query OK, 0 rows affected (0.00 sec) 163 164 mysql> desc bla2; 165 +-------+----------+------+-----+---------+-------+ 166 | Field | Type | Null | Key | Default | Extra | 167 +-------+----------+------+-----+---------+-------+ 168 | a | datetime | YES | | NULL | | 169 +-------+----------+------+-----+---------+-------+ 170 1 row in set (0.00 sec) 171 </pre> 172 <p> 173 Be carefull with variables, declared with something like 174 <tt>set @a =1</tt>. The types are automatically determined, and a type for 175 dates does not exist. 176 </p> 177 <p> 178 Of course error handling in MySQL is not existent, maybe I should change the 179 server settings: 180 <pre> 181 mysql> select cast(cast('12345678901' as decimal) as char) as a, cast(cast('1234567890' as decimal) as char) as b; 182 +------------+------------+ 183 | a | b | 184 +------------+------------+ 185 | 9999999999 | 1234567890 | 186 +------------+------------+ 187 1 row in set, 1 warning (0.00 sec) 188 </pre> 189 <p>So there is no overflow error.</p> 190 <p> 191 Division by zero is handled, but only for an insert: 192 <pre> 193 mysql> set @a=1; 194 Query OK, 0 rows affected (0.00 sec) 195 196 mysql> set @b=0; 197 Query OK, 0 rows affected (0.00 sec) 198 199 mysql> select @a/@b; 200 +-------+ 201 | @a/@b | 202 +-------+ 203 | NULL | 204 +-------+ 205 1 row in set, 1 warning (0.00 sec) 206 207 mysql> insert into blu select @a/@b; 208 ERROR 1365 (22012): Division by 0 209 </pre> 210 142 211 </html>
Note: See TracChangeset
for help on using the changeset viewer.
