Project

General

Profile

« Previous | Next » 

Revision 9466

lib/sh/db.sh: added mysql_truncate() and use it instead of `mk_truncate|mysql_ANSI`

View differences:

lib/sh/db.sh
89 89
	(echo "SET sql_mode = 'ANSI';"; cat)|mysql "$@"
90 90
}
91 91

  
92
mysql_truncate() { echo_func; mk_truncate|mysql_ANSI; }
93

  
92 94
mysql_import() # usage: table=... [cols=...] [append=1] mysql_import <file
93 95
# without append=1, first ensures the table is empty
94 96
{
......
99 101
OPTIONALLY ENCLOSED BY '\"'
100 102
}"
101 103
	
102
	if test ! "$append"; then mk_truncate|mysql_ANSI; fi
104
	if test ! "$append"; then mysql_truncate; fi
103 105
	mysql_load_data_format="${mysql_load_data_format%
104 106
}"
105 107
	mysql_ANSI "$@" 10<&0 <<EOF

Also available in: Unified diff