mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
5ab92b1f85
- COLUMN_CREATE(column_nr, value, [column_nr,value]...) - COLUMN_ADD(blob,column_nr, value, column_nr,value]...) - COLUMN_DELETE(blob, column_nr, column_nr...) - COLUMN_EXISTS(blob, column_nr) - COLUMN_LIST(blob, column_nr) - COLUMN_GET(string, column_nr AS type) Added cast(X as DOUBLE) and cast(x as INT) Better warning and error messages for wrong cast's Created some sub functions to simplify and reuse code. Added a lot of conversation functions with error/warnings for what went wrong. Fixed some issues when casting time to datetime. Added functions to dynamic strings and Strings to allow one to move a string buffer from dynamic strings to String (to save malloc+ copy) Added dynamic columns library to libmysqlclient include/Makefile.am: Added ma_dyncol.h include/decimal.h: Added 'const' to arguments for some functions. include/my_sys.h: Added dynstr_reassociate() include/my_time.h: Added TIME_SUBSECOND_RANGE Added double_to_datetime() Added flag argument to str_to_time() libmysql/CMakeLists.txt: Added mysys/ma_dyncol.c libmysql/Makefile.shared: Added ma_dyncol libmysql/libmysql.c: Added argument to str_to_time() mysql-test/r/bigint.result: Better error messages mysql-test/r/cast.result: Better warning and error messages A lot of new cast() tests mysql-test/r/func_math.result: Better warning messages mysql-test/r/func_str.result: Better warning messages mysql-test/r/func_time.result: Better warning messages mysql-test/r/sp-vars.result: Better warning messages mysql-test/r/strict.result: Better warning messages New test result mysql-test/r/type_newdecimal.result: Better warning messages mysql-test/r/warnings.result: Better warning messages mysql-test/suite/funcs_1/r/innodb_func_view.result: Updated results after better cast warnings mysql-test/suite/funcs_1/r/memory_func_view.result: Updated results after better cast warnings mysql-test/suite/funcs_1/r/myisam_func_view.result: Updated results after better cast warnings mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test: Added begin...commit to speed up test. mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc: Added begin...commit to speed up test. mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc: Added begin...commit to speed up test. mysql-test/suite/parts/r/part_supported_sql_func_innodb.result: Added begin...commit to speed up test. mysql-test/suite/parts/r/part_supported_sql_func_myisam.result: Added begin...commit to speed up test. mysql-test/suite/parts/r/rpl_partition.result: Added begin...commit to speed up test. mysql-test/suite/parts/t/part_supported_sql_func_innodb.test: Removed duplicated --big_test mysql-test/suite/parts/t/rpl_partition.test: Added begin...commit to speed up test. mysql-test/suite/pbxt/r/cast.result: Updated results after better cast warnings mysql-test/suite/pbxt/r/func_str.result: Updated results after better cast warnings mysql-test/suite/pbxt/r/type_newdecimal.result: Updated results after better cast warnings mysql-test/suite/rpl/r/rpl_innodb_bug28430.result: Added begin...commit to speed up test. mysql-test/suite/rpl/t/rpl_innodb_bug28430.test: Added begin...commit to speed up test. mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result: More warnings mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result: More warnings mysql-test/t/cast.test: A lot of new cast() tests mysql-test/t/strict.test: Added new test mysys/CMakeLists.txt: Added ma_dyncol.c mysys/Makefile.am: Added ma_dyncol.c mysys/string.c: Added dynstr_reassociate() to move a buffer from dynamic_strings to some other allocator sql-common/my_time.c: Added 'fuzzydate' flag to str_to_time() Added support for microseconds to my_time_to_str() and my_datetime_to_str() Reset second_parts in number_to_datetime() Added double_to_datetime() sql/field.cc: Added double_to_longlong() and truncate_double() to simplify and reuse code sql/field.h: New prototypes sql/item.cc: Changed Item::get_date(MYSQL_TIME *ltime,uint fuzzydate) to be aware of type of argument. (Needed to make it microsecond safe and get better warnings). Updated call to str_to_time_with_warn() sql/item.h: Added struct st_dyncall_create_def used by dynamic columns Added virtual bool dynamic_result() to tell if type of argument may change over calls. sql/item_cmpfunc.cc: Added Item_func_dyncol_exists() sql/item_cmpfunc.h: Added class Item_func_dyncol_exists sql/item_create.cc: Added get_length_and_scale() to simplify other functions Simplified and extended create_func_cast() Added support for cast(X as double(X,Y)) Added functions to create dynamic column functions. sql/item_create.h: Added prototypes sql/item_func.cc: Extended cast functions Item_func_signed() and Item_func_unsigned() to work with dynamic types Added Item_double_typecast() sql/item_func.h: Added class Item_double_typecast() sql/item_strfunc.cc: Added functions for COLUMN_CREATE(), COLUMN_ADD(), COLUMN_GET() and COLUMN_LIST() sql/item_strfunc.h: Added classes for COLUMN_CREATE(), COLUMN_ADD(), COLUMN_GET() and COLUMN_LIST() sql/item_timefunc.cc: Added flag argument to str_to_time_with_warn() Updated Item_char_typecast() to handle result type that may change between calls (for dynamic columns) Added Item_time_typecast::get_date() to ensure that we cast a datetime to time properly. sql/item_timefunc.h: Added get_date() to Item_time_typecast() to allow proper results for casting time to datetime sql/lex.h: Added new SQL function names sql/my_decimal.cc: Added 'const' to some arguments. Better error message in case of errors (we now print out the wrong value) Added my_decimal2int() sql/my_decimal.h: Moved some constants to my_decimal_limits.h Updated prototypes. Made my_decimal2int() a function as it's rather long (no reason to have it inline) Added decimal2my_decimal() function. sql/mysql_priv.h: Prototypes for new functions sql/share/errmsg.txt: New error messages for wrong casts and dynamic columns sql/sql_acl.cc: Fixed indentation sql/sql_base.cc: Added dynamic_column_error_message() sql/sql_string.h: Added reassociate() to move a buffer to be owned by String object. sql/sql_yacc.yy: Added syntax for COLUMN_ functions. sql/time.cc: Updated str_to_datetime_with_warn() flag argument to same type as other functions Added conversion flag to str_to_time_with_warn() (Similar to all datetime functions) Added conversion functions with warnings: double_to_datetime_with_warn() and decimal_to_datetime_with_warn() strings/decimal.c: Added 'const' to arguments for some functions. unittest/mysys/Makefile.am: Added test for dynamic columns code |
||
---|---|---|
.. | ||
.cvsignore | ||
bchange.c | ||
bcmp.c | ||
bcopy-duff.c | ||
bfill.c | ||
bmove.c | ||
bmove512.c | ||
bmove_upp-sparc.s | ||
bmove_upp.c | ||
bzero.c | ||
ChangeLog | ||
CHARSET_INFO.txt | ||
CMakeLists.txt | ||
conf_to_src.c | ||
ctype-big5.c | ||
ctype-bin.c | ||
ctype-cp932.c | ||
ctype-czech.c | ||
ctype-euc_kr.c | ||
ctype-eucjpms.c | ||
ctype-extra.c | ||
ctype-gb2312.c | ||
ctype-gbk.c | ||
ctype-latin1.c | ||
ctype-mb.c | ||
ctype-simple.c | ||
ctype-sjis.c | ||
ctype-tis620.c | ||
ctype-uca.c | ||
ctype-ucs2.c | ||
ctype-ujis.c | ||
ctype-utf8.c | ||
ctype-win1250ch.c | ||
ctype.c | ||
decimal.c | ||
do_ctype.c | ||
dump_map.c | ||
int2str.c | ||
is_prefix.c | ||
latin2.def | ||
llstr.c | ||
longlong2str-x86.s | ||
longlong2str.c | ||
longlong2str_asm.c | ||
macros.asm | ||
make-ccc | ||
Makefile.am | ||
memcmp.c | ||
memcpy.c | ||
memset.c | ||
my_strchr.c | ||
my_strtoll10-x86.s | ||
my_strtoll10.c | ||
my_vsnprintf.c | ||
ptr_cmp.asm | ||
r_strinstr.c | ||
README | ||
str2int.c | ||
str_alloc.c | ||
str_test.c | ||
strappend-sparc.s | ||
strappend.c | ||
strcat.c | ||
strcend.c | ||
strchr.c | ||
strcmp.c | ||
strcont.c | ||
strend-sparc.s | ||
strend.c | ||
strfill.c | ||
string.doc | ||
strings-not-used.h | ||
strings-x86.s | ||
strings.asm | ||
strings_def.h | ||
strinstr-sparc.s | ||
strinstr.c | ||
strlen.c | ||
strmake-sparc.s | ||
strmake.c | ||
strmov-sparc.s | ||
strmov.c | ||
strmov_overlapp.c | ||
strnlen.c | ||
strnmov-sparc.s | ||
strnmov.c | ||
strrchr.c | ||
strstr-sparc.s | ||
strstr.c | ||
strto.c | ||
strtod.c | ||
strtol.c | ||
strtoll.c | ||
strtoul.c | ||
strtoull.c | ||
strxmov-sparc.s | ||
strxmov.asm | ||
strxmov.c | ||
strxnmov.c | ||
t_ctype.h | ||
uca-dump.c | ||
uctypedump.c | ||
udiv.c | ||
utr11-dump.c | ||
xml.c |
File : README Author : Richard A. O'Keefe. Updated: 30 April 1984 Purpose: Explain the new strings package. The UNIX string libraries (described in the string(3) manual page) differ from UNIX to UNIX (e.g. strtok is not in V7 or 4.1bsd). Worse, the sources are not in the public domain, so that if there is a string routine which is nearly what you want but not quite you can't take a copy and modify it. And of course C programmers on non-UNIX systems are at the mercy of their supplier. This package was designed to let me do reasonable things with C's strings whatever UNIX (V7, PaNiX, UX63, 4.1bsd) I happen to be using. Everything in the System III manual is here and does just what the S3 manual says it does. There are also lots of new goodies. I'm sorry about the names, but the routines do have to work on asphyxiated-at- birth systems which truncate identifiers. The convention is that a routine is called str [n] [c] <operation> If there is an "n", it means that the function takes an (int) "length" argument, which bounds the number of characters to be moved or looked at. If the function has a "set" argument, a "c" in the name indicates that the complement of the set is used. Functions or variables whose names start with _ are support routines which aren't really meant for general use. I don't know what the "p" is doing in "strpbrk", but it is there in the S3 manual so it's here too. "istrtok" does not follow this rule, but with 7 letters what can you do? I have included new versions of atoi(3) and atol(3) as well. They use a new primitive str2int, which takes a pair of bounds and a radix, and does much more thorough checking than the normal atoi and atol do. The result returned by atoi & atol is valid if and only if errno == 0. There is also an output conversion routine int2str, with itoa and ltoa as interface macros. Only after writing int2str did I notice that the str2int routine has no provision for unsigned numbers. On reflection, I don't greatly care. I'm afraid that int2str may depend on your "C" compiler in unexpected ways. Do check the code with -S. Several of these routines have "asm" inclusions conditional on the VaxAsm option. These insertions can make the routines which have them quite a bit faster, but there is a snag. The VAX architects, for some reason best known to themselves and their therapists, decided that all "strings" were shorter than 2^16 bytes. Even when the length operands are in 32-bit registers, only 16 bits count. So the "asm" versions do not work for long strings. If you can guarantee that all your strings will be short, define VaxAsm in the makefile, but in general, and when using other machines, do not define it. To use this library, you need the "strings.a" library file and the "strings.h" and "ctypes.h" header files. The other header files are for compiling the library itself, though if you are hacking extensions you may find them useful. General users really shouldn't see them. I've defined a few macros I find useful in "strings.h"; if you have no need for "index", "rindex", "streql", and "beql", just edit them out. On the 4.1bsd system I am using declaring all these functions 'extern' does not mean that they will all be loaded; but only the ones you use. When using lesser systems you may find it necessary to break strings.h up, or you could get by with just adding "extern" declarations for the functions you want as you need them. Many of these functions have the same names as functions in the "standard C library", by design as this is a replacement/reimplementation of part of that library. So you may have to talk the loader into loading this library first. Again, I've found no problems on 4.1bsd. You may wonder at my failure to provide manual pages for this code. For the things in V7, 4.?, or SIII, you should be able to use whichever manual page came with that system, and anything I might write would be so like it as to raise suspicions of violating AT&T copyrights. In the sources you will find comments which provide far more documentation for these routines than AT&T ever provided for their strings stuff, I just don't happen to have put it in nroff -man form. Had I done so, the .3 files would have outbulked the .c files! These files are in the public domain. This includes getopt.c, which is the work of Henry Spencer, University of Toronto Zoology, who says of it "None of this software is derived from Bell software. I had no access to the source for Bell's versions at the time I wrote it. This software is hereby explicitly placed in the public domain. It may be used for any purpose on any machine by anyone." I would greatly prefer it if *my* material received no military use.