 |
 |
Index ‹ mysql
|
- Previous
- 1
- bk commit into 5.0-fulltext tree (paul:1.2044)Below is the list of changes that have just been committed into a local
5.0-fulltext repository of paul. When paul does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2044 05/12/13 12:17:04 email***@***.com +3 -0
cnet_weight.c, cnet_parser.c:
Revision to comments.
plugin.h:
Revisions to comments.
plugin/fulltext/cnet_weight.c
1.12 05/12/13 12:16:05 email***@***.com +20 -11
Revision to comments.
plugin/fulltext/cnet_parser.c
1.15 05/12/13 12:16:00 email***@***.com +9 -7
Revision to comments.
include/plugin.h
1.14 05/12/13 12:15:10 email***@***.com +27 -16
Revisions to comments.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: paul
# Host: frost.snake.net
# Root: /Users/paul/bk/mysql-5.0-cnet
--- 1.13/include/plugin.h 2005-10-29 11:51:01 -05:00
+++ 1.14/include/plugin.h 2005-12-13 12:15:10 -06:00
@@ -65,33 +65,36 @@
/* Parsing modes. Set in MYSQL_FTPARSER_PARAM::mode */
/*
- The fast and simple mode. Parser is expected to return only those words that
- go into the index. Stopwords or too short/long words should not be returned.
- 'boolean_info' argument of mysql_add_word() does not have to be set.
+ Fast and simple mode. This mode is used for indexing, and natural
+ language queries.
- This mode is used for indexing, and natural language queries.
+ The parser is expected to return only those words that go into the
+ index. Stopwords or too short/long words should not be returned. The
+ 'boolean_info' argument of mysql_add_word() does not have to be set.
*/
#define MYSQL_FTPARSER_SIMPLE_MODE 0
/*
- The parser is not allowed to ignore words in this mode. Every word should
- be returned, including stopwords and words that are too short or long.
- 'boolean_info' argument of mysql_add_word() does not have to be set.
+ Parse with stopwords mode. This mode is used in boolean searches for
+ "phrase matching."
- This mode is used in boolean searches for "phrase matching."
+ The parser is not allowed to ignore words in this mode. Every word
+ should be returned, including stopwords and words that are too short
+ or long. The 'boolean_info' argument of mysql_add_word() does not
+ have to be set.
*/
#define MYSQL_FTPARSER_WITH_STOPWORDS 1
/*
- Parse in boolean mode. The parser should provide a valid
- MYSQL_FTPARSER_BOOLEAN_INFO structure in the 'boolean_info' argument
- to mysql_add_word(). Usually that means that the parser should
- recognize boolean operators in the parsing stream and set appropriate
- fields in MYSQL_FTPARSER_BOOLEAN_INFO structure accordingly. As
- for MYSQL_FTPARSER_WITH_STOPWORDS mode, no word should be ignored.
- Instead, use FT_TOKEN_STOPWORD for the token type of such a word.
+ Parse in boolean mode. This mode is used to parse a boolean query string.
- This mode is used to parse a boolean query string.
+ The parser should provide a valid MYSQL_FTPARSER_BOOLEAN_INFO
+ structure in the 'boolean_info' argument to mysql_add_word().
+ Usually that means that the parser should recognize boolean operators
+ in the parsing stream and set appropriate fields in
+ MYSQL_FTPARSER_BOOLEAN_INFO structure accordingly. As for
+ MYSQL_FTPARSER_WITH_STOPWORDS mode, no word should be ignored.
+ Instead, use FT_TOKEN_STOPWORD for the token type of such a word.
*/
#define MYSQL_FTPARSER_FULL_BOOLEAN_INFO 2
@@ -169,6 +172,14 @@
*/
int mode;
} MYSQL_FTPARSER_PARAM;
+
+/*
+ Full-text parser descriptor.
+
+ interface_version is, e.g., MYSQL_FTPARSER_INTERFACE_VERSION.
+ The parse, init, and deinit functions are invoked per SQL statement
+ for which the parser is used.
+*/
struct st_mysql_ftparser
{
--- 1.14/plugin/fulltext/cnet_parser.c 2005-11-01 03:43:55 -06:00
+++ 1.15/plugin/fulltext/cnet_parser.c 2005-12-13 12:16:00 -06:00
@@ -19,10 +19,11 @@
#include <plugin.h>
/*
- Define to a path to the always-index words file. Every line in this
+ Define a path to the always-index words file. Every line in this
file is treated as an always-index word. If the path is not
absolute, it is relative to the current working directory of the
- server (the value of --datadir)
+ server (the value of --datadir). The file must exist. To use no
+ always-index words, create this file as an empty file.
*/
#define CNET_WORD_CASES_PATH "ordinary-dict.txt"
@@ -40,7 +41,7 @@
/* The number of always-index words. */
static size_t nwords;
/*
- If the word is not an always-index word and is less than
+ If a word is not an always-index word and is less than
min_word_len, it's skipped during parsing and, consequently,
not added to the index.
*/
@@ -264,11 +265,12 @@
DESCRIPTION
This is the main plugin function which is called to parse
a document or a search query. The call mode is set in
- param->flags.
+ param->mode.
When parsing a document, it simply splits the text into words
- and passes every word to MySQL fultext indexing engine.
- When parsing a query, and if in boolean mode, it will also
- look up synonyms and add them to the search query.
+ and passes each word to add_word(), which passes the word to
+ the MySQL fultext indexing engine.
+ When parsing a query, and if in boolean mode, add_word() also
+ looks up synonyms and adds them to the search query.
*/
int cnet_parser_parse(MYSQL_FTPARSER_PARAM *param)
--- 1.11/plugin/fulltext/cnet_weight.c 2005-10-31 02:41:41 -06:00
+++ 1.12/plugin/fulltext/cnet_weight.c 2005-12-13 12:16:05 -06:00
@@ -20,7 +20,7 @@
#include <plugin.h>
/*
- This file defines a non-aggregate User Defined Function (UDF)
+ This file defines a non-aggregate User-Defined Function (UDF)
for relevance calculation.
An introduction to UDFs in MySQL.
@@ -107,20 +107,29 @@
is parsed on every invocation of cnet_weight().
For parsing purposes an external function is used; at the moment it
- is the parsing function from CNET parsing plugin, which provides the
- relevancy function with information about synonyms and allows to
+ is the parsing function from CNET parsing plugin. The plugin provides the
+ relevance function with information about synonyms and allows it to
achieve the best correlation between relevance values and table
- contents:
+ contents. To use the plugin, create a FULLTEXT index for the column that
+ is to be searched, and associate the parser plugin with it:
ALTER TABLE t1 ADD FULLTEXT KEY(a) WITH PARSER cnet_parser;
+ This causes the plugin to be used for parsing the column contents
+ when the index is created.
+
The signature of the plugin parser and its input buffers make it
- available to reuse this function in the UDF implementation.
+ available to be used in the UDF implementation. The UDF init function
+ invokes the parser to parse the search string. The UDF main function
+ invokes the parser once for row, to parse the document to be searched.
+
+ Because the UDF invokes the parser plugin, the plugin must be installed
+ before CNET_WEIGHT can be used.
The relevance calculation formula of CNET_WEIGHT.
-------------------------------------------------
- For conveninece, we'll refer to the search query and the document as to
- a list of words q_1 ... q_l and d_1 ... d_m respectively.
+ For convenience, we'll refer to the search query and to the document
+ as two lists of words, q_1 ... q_l and d_1 ... d_m, respectively.
We need to introduce a few simple auxiliary functions to define
the final formula:
@@ -192,7 +201,7 @@
boolean_info additional word information, currently only
boolean_info->weight_adjust is used.
DESCRIPTION
- This function adds a word from the query into
+ This function adds a word from the query to the
CNET_WEIGHT_PARAM->query structure. Also it sets initial
weight for current word as passed by the parser. Currently
parser passes following weight_adjust:
@@ -239,7 +248,7 @@
word and stores it in initid->ptr.
Detailed description of UDF is available in MySQL manual
- in `Adding a New User-defined Function` section.
+ in `Adding a New User-Defined Function` section.
RETURN VALUE
0 OK
@@ -340,7 +349,7 @@
for (idx= 0; idx < weight_param->nwords; idx++)
{
CNET_STRING *qwrd= &weight_param->query[idx];
- /* Skip this word if lengthes aren't equal */
+ /* Skip this word if lengths are unequal */
if (qwrd->length != word_len)
continue;
if (! strncmp(qwrd->str, word, word_len))
@@ -380,7 +389,7 @@
/*
- User Defined Function itself.
+ User-Defined Function itself.
SYNOPSIS
cnet_weight()
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 4
- peformance help: preventing 'using temporary; using filesort'Hello all. I'm looking for help with the query below. Is there anyway
to prevent the temporary and filesort? I've tried about as many
combinations as I could think of, but can't seem to prevent it. I'm
sure that's the reason, when run on a table of around 750k records, it
takes in excess of 20 seconds. There are indexes on sourceID in both
tables as well as the date field in the first table.
Thanks for any ideas.
SELECT
t1.sourceID as sourceID,
count(t1.sourceID) as clicks,
sum(t1.converted) as conversions,
(sum(t1.converted)/count(t1.sourceID)) * 100 as conv_rate,
count(t1.sourceID) * t2.cost as cost,
sum(t1.revenue) as revenue,
(sum(t1.revenue)) - (count(t1.sourceID) * ifnull(t2.cost,0)) as margin,
( ((sum(t1.revenue)) - (count(t1.sourceID) * t2.cost)) /
sum(t1.revenue) ) * 100 as gm,
(count(t1.sourceID) * t2.cost) / sum(t1.converted) as cpl,
(sum(t1.revenue)) / sum(t1.converted) as rpl,
t2.cost as cpc
FROM source_site_quality as t1
LEFT JOIN rpt_cpc as t2 ON (t1.sourceID = t2.sourceID)
WHERE t1.date >= '2007-06-26' AND t1.date <= '2007-06-28' GROUP BY
sourceID ORDER BY clicks desc, conversions desc;
When using EXPLAIN:
+----+-------------+-------+-------+---------------+----------+---------+------+------+----------------------------------------------+
| id | select_type | table | type | possible_keys | key |
key_len | ref | rows | Extra |
+----+-------------+-------+-------+---------------+----------+---------+------+------+----------------------------------------------+
| 1 | SIMPLE | t1 | range | idx_date | idx_date |
3 | NULL | 4612 | Using where; Using temporary; Using filesort |
| 1 | SIMPLE | t2 | ALL | NULL | NULL |
NULL | NULL | 1351 | |
+----+-------------+-------+-------+---------------+----------+---------+------+------+----------------------------------------------+
-- rich
- 7
- Mysql TriggersCan someone explain why this will not work, or how I can make it work?
I am trying to set a column name as a variable, but MYSQL will display:
ERROR 1054 (42S22): Unknown column 'Col' in 'field list'
So the variable Col is not being set somehow, is there another way to do
this?
Thanks everyone!
-Paul C
- 7
- aggregate in the HAVING clauseI get an error in the having clause. I cannot get the count of
duplicates. I want the number of records from INTERNAL_CLM where the
car_mark, car_number and sighting_date are the same.
tia,
select
car_mark,
car_number,
sighting_date
from
INTERNAL_CLM
group by
car_mark,
car_number,
sighting_date
having
count (*) > 1
- 8
- bk commit into 4.1 tree (kp:1.2387)Below is the list of changes that have just been committed into a local
4.1 repository of kp. When kp does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2387 05/08/19 20:18:43 email***@***.com +2 -0
Checked in to the local build from the main bk tree as these files are
missing in this build.
mysql-test/r/slave-stopped.result
1.1 05/08/19 20:18:23 email***@***.com +3 -0
Checked in to the local build from the main bk tree as these files are
missing in this build.
mysql-test/r/slave-stopped.result
1.0 05/08/19 20:18:23 email***@***.com +0 -0
BitKeeper file /home/kp/blr-engrlinux/bk/new/mysql-4.1/mysql-test/r/slave-stopped.result
mysql-test/r/slave-running.result
1.1 05/08/19 20:18:19 email***@***.com +3 -0
Checked in to the local build from the main bk tree as these files are
missing in this build.
mysql-test/r/slave-running.result
1.0 05/08/19 20:18:19 email***@***.com +0 -0
BitKeeper file /home/kp/blr-engrlinux/bk/new/mysql-4.1/mysql-test/r/slave-running.result
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: kp
# Host: blr-techserv.blr.novell.com
# Root: /home/kp/blr-engrlinux/bk/new/mysql-4.1
--- New file ---
+++ mysql-test/r/slave-running.result 05/08/19 20:18:19
show status like 'Slave_running';
Variable_name Value
Slave_running ON
--- New file ---
+++ mysql-test/r/slave-stopped.result 05/08/19 20:18:23
show status like 'Slave_running';
Variable_name Value
Slave_running OFF
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 8
- Is it possible to dump images into a database?Can anyone point me to a reference on how to insert images into a column
in a mySQL database -- or is that not possible?
Thanks in advance,
Dan Anderson
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=email***@***.com
- 8
- bk commit into 5.0 tree (igor:1.1895) BUG#11412Below is the list of changes that have just been committed into a local
5.0 repository of igor. When igor does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1895 05/07/25 12:57:23 email***@***.com +5 -0
sql_select.cc:
Fixed bug #11412.
Reversed the patch of cs 1.1934 for the function
create_tmp_table. Modified the function to support
tem_ref objects created for view fields.
item_buff.cc:
Fixed bug #11412.
Modified implementation of new_Cached_item to support
cacheing of view fields.
item.h:
Fixed bug #11412.
Changed implementation of Item_ref::get_tmp_table_field and
added Item_ref::get_tmp_table_item to support Item_ref objects
created for view fields.
view.test, view.result:
Added a test case for bug #11412.
sql/sql_select.cc
1.344 05/07/25 12:51:44 email***@***.com +23 -24
Fixed bug #11412.
Reversed the patch of cs 1.1934 for the function
create_tmp_table. Modified the function to support
tem_ref objects created for view fields.
sql/item_buff.cc
1.18 05/07/25 12:46:12 email***@***.com +3 -3
Fixed bug #11412.
Modified implementation of new_Cached_item to support
cacheing of view fields.
sql/item.h
1.156 05/07/25 12:41:50 email***@***.com +5 -2
Fixed bug #11412.
Changed implementation of Item_ref::get_tmp_table_field and
added Item_ref::get_tmp_table_item to support Item_ref objects
created for view fields.
mysql-test/t/view.test
1.90 05/07/25 09:07:39 email***@***.com +25 -1
Added a test case for bug #11412.
mysql-test/r/view.result
1.96 05/07/25 09:06:53 email***@***.com +23 -0
Added a test case for bug #11412.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: igor
# Host: rurik.mysql.com
# Root: /home/igor/dev/mysql-5.0-0
--- 1.155/sql/item.h Tue Jul 19 09:06:42 2005
+++ 1.156/sql/item.h Mon Jul 25 12:41:50 2005
@@ -1464,7 +1464,10 @@
void save_org_in_field(Field *field) { (*ref)->save_org_in_field(field); }
enum Item_result result_type () const { return (*ref)->result_type(); }
enum_field_types field_type() const { return (*ref)->field_type(); }
- Field *get_tmp_table_field() { return result_field; }
+ Field *get_tmp_table_field()
+ { return result_field ? result_field : (*ref)->get_tmp_table_field(); }
+ Item *get_tmp_table_item(THD *thd)
+ { return (*ref)->get_tmp_table_item(thd); }
table_map used_tables() const
{
return depended_from ? OUTER_REF_TABLE_BIT : (*ref)->used_tables();
@@ -1702,7 +1705,7 @@
public:
Cached_item_field(Item_field *item)
{
- field=item->field;
+ field= item->field;
buff= (char*) sql_calloc(length=field->pack_length());
}
bool cmp(void);
--- 1.17/sql/item_buff.cc Wed Jun 22 02:11:18 2005
+++ 1.18/sql/item_buff.cc Mon Jul 25 12:46:12 2005
@@ -25,9 +25,9 @@
Cached_item *new_Cached_item(THD *thd, Item *item)
{
- if (item->type() == Item::FIELD_ITEM &&
- !(((Item_field *) item)->field->flags & BLOB_FLAG))
- return new Cached_item_field((Item_field *) item);
+ if (item->real_item()->type() == Item::FIELD_ITEM &&
+ !(((Item_field *) (item->real_item()))->field->flags & BLOB_FLAG))
+ return new Cached_item_field((Item_field *) (item->real_item()));
switch (item->result_type()) {
case STRING_RESULT:
return new Cached_item_str(thd, (Item_field *) item);
--- 1.343/sql/sql_select.cc Wed Jul 20 09:02:26 2005
+++ 1.344/sql/sql_select.cc Mon Jul 25 12:51:44 2005
@@ -8026,6 +8026,12 @@
bool table_cant_handle_bit_fields,
uint convert_blob_length)
{
+ Item *org_item= item;
+ if (item->real_item()->type() == Item::FIELD_ITEM)
+ {
+ item= item->real_item();
+ type= item->type();
+ }
switch (type) {
case Item::SUM_FUNC_ITEM:
{
@@ -8038,30 +8044,22 @@
case Item::FIELD_ITEM:
case Item::DEFAULT_VALUE_ITEM:
{
- Item_field *field= (Item_field*) item;
- if (table_cant_handle_bit_fields && field->field->type() == FIELD_TYPE_BIT)
- return create_tmp_field_from_item(thd, item, table, copy_func,
- modify_item, convert_blob_length);
- return create_tmp_field_from_field(thd, (*from_field= field->field),
- item->name, table,
- modify_item ? (Item_field*) item : NULL,
- convert_blob_length);
- }
- case Item::REF_ITEM:
- {
- Item *tmp_item;
- if ((tmp_item= item->real_item())->type() == Item::FIELD_ITEM)
+ if (org_item->type() != Item::REF_ITEM ||
+ !((Item_ref *)org_item)->depended_from)
{
- Item_field *field= (Item_field*) tmp_item;
- Field *new_field= create_tmp_field_from_field(thd,
- (*from_field= field->field),
- item->name, table,
- NULL,
- convert_blob_length);
- if (modify_item)
- item->set_result_field(new_field);
- return new_field;
+ Item_field *field= (Item_field*) item;
+ if (table_cant_handle_bit_fields &&
+ field->field->type() == FIELD_TYPE_BIT)
+ return create_tmp_field_from_item(thd, item, table, copy_func,
+ modify_item, convert_blob_length);
+ return create_tmp_field_from_field(thd, (*from_field= field->field),
+ item->name, table,
+ modify_item ? (Item_field*) item :
+ NULL,
+ convert_blob_length);
}
+ else
+ item= org_item;
}
case Item::FUNC_ITEM:
case Item::COND_ITEM:
@@ -8074,6 +8072,7 @@
case Item::REAL_ITEM:
case Item::DECIMAL_ITEM:
case Item::STRING_ITEM:
+ case Item::REF_ITEM:
case Item::NULL_ITEM:
case Item::VARBIN_ITEM:
return create_tmp_field_from_item(thd, item, table, copy_func, modify_item,
@@ -10904,12 +10903,12 @@
usable_keys.set_all();
for (ORDER *tmp_order=order; tmp_order ; tmp_order=tmp_order->next)
{
- if ((*tmp_order->item)->type() != Item::FIELD_ITEM)
+ if ((*tmp_order->item)->real_item()->type() != Item::FIELD_ITEM)
{
usable_keys.clear_all();
DBUG_RETURN(0);
}
- usable_keys.intersect(((Item_field*) (*tmp_order->item))->
+ usable_keys.intersect(((Item_field*) (*tmp_order->item)->real_item())->
field->part_of_sortkey);
if (usable_keys.is_clear_all())
DBUG_RETURN(0); // No usable keys
--- 1.95/mysql-test/r/view.result Tue Jul 19 19:59:29 2005
+++ 1.96/mysql-test/r/view.result Mon Jul 25 09:06:53 2005
@@ -2024,3 +2024,26 @@
2005-01-01 12:00:00 2005-01-01 10:58:59
drop view v1;
drop table t1;
+CREATE TABLE t1 (
+aid int PRIMARY KEY,
+fn varchar(20) NOT NULL,
+ln varchar(20) NOT NULL
+);
+CREATE TABLE t2 (
+aid int NOT NULL,
+pid int NOT NULL
+);
+INSERT INTO t1 VALUES(1,'a','b'), (2,'c','d');
+INSERT INTO t2 values (1,1), (2,1), (2,2);
+CREATE VIEW v1 AS SELECT t1.*,t2.pid FROM t1,t2 WHERE t1.aid = t2.aid;
+SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2
+WHERE t1.aid = t2.aid GROUP BY pid;
+pid GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1)
+1 a b,c d
+2 c d
+SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM v1 GROUP BY pid;
+pid GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1)
+1 a b,c d
+2 c d
+DROP VIEW v1;
+DROP TABLE t1,t2;
--- 1.89/mysql-test/t/view.test Tue Jul 19 19:59:29 2005
+++ 1.90/mysql-test/t/view.test Mon Jul 25 09:07:39 2005
@@ -1862,4 +1862,28 @@
create view v1 as select f1, subtime(f1, '1:1:1') as sb from t1;
select * from v1;
drop view v1;
-drop table t1;
+drop table t1;
+
+#
+# Test for bug #11412: query over a multitable view with GROUP_CONCAT
+#
+CREATE TABLE t1 (
+ aid int PRIMARY KEY,
+ fn varchar(20) NOT NULL,
+ ln varchar(20) NOT NULL
+);
+CREATE TABLE t2 (
+ aid int NOT NULL,
+ pid int NOT NULL
+);
+INSERT INTO t1 VALUES(1,'a','b'), (2,'c','d');
+INSERT INTO t2 values (1,1), (2,1), (2,2);
+
+CREATE VIEW v1 AS SELECT t1.*,t2.pid FROM t1,t2 WHERE t1.aid = t2.aid;
+
+SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2
+ WHERE t1.aid = t2.aid GROUP BY pid;
+SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM v1 GROUP BY pid;
+
+DROP VIEW v1;
+DROP TABLE t1,t2;
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 8
- replication problemHi
I have 3 machines M1 M2 and M3, i need to setup the following :
M1 is the master
M2 is reading from M1
M2 is a master for M3
M3 is reading from M2
the problem i got, is when i run a command in M2, it's replicated in
M3, but when the command is being run in M1, it's replicated in M2 but
not in M3.
does anybody know how i can fix this problem ?
ThAnX a LoT
- 8
- String LocksI saw mention of something called string locks in an earlier thread,
yet I see nothing like it in the mysql documentation. Could somebody
please point me at a reference?
--
- michael dykman
- email***@***.com
- All models are wrong. Some models are useful.
- 9
- CSV to SQLHello,
I have a list of 73,000 cities in the US that is in CSV format and I
wanted to know the best method to convert the list to SQL. Is there
some way I can store the list in a huge array so I can interate through
each record and add the SQL before and after the values? Any help would
be greatly appreciated.
Thanks,
Aaron
- 9
- Error 1260 HY000Greetings, I am trying to combine multiple rows using the group_concat
function. If I tweak the LIMIT requirement, I can get the insert
statement to work. I can get 500 rows or so to combine, but not a
large set, say 50000.
What does the error message mean?
mysql> insert into combine (select examnumber, group_concat(distinct
rtrim(examtext) order by Linenumber separator ' ') from test group by
examnumber limit 10);
ERROR 1260 (HY000): %d line(s) were cut by GROUP_CONCAT()
- 11
- ANN: gtk2-gladexml_DBI_helper-0.1Hi all.
I'm pleased to announce the first public release of my first open-source
project: a Perl class to automate the synchronization of data from a
database server ( via DBI ) with fields on a Glade-generated form ( for
a Perl / Gtk2 app ). MS Access users take note: an alternative is on the
horizon ;)
The code is available here:
http://enthalpy.homelinux.org/code/gtk2-gladexml_DBI_helper-0.1.tar.bz2
I'm not sure on the naming I've used at present. If someone has a better
name, feel free to offer say so.
I've done a reasonable amount of testing with it, but there are a few
things which are incomplete ( marked in the code with *** TODO *** ).
Comments / suggestions welcome.
Keep in mind that I'm a Perl newbie :)
Dan
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=email***@***.com
- 11
- mysql_error questionI am accessing a Mysql database with php scripting
This first version works ok
$cykdag_collers='SELECT * FROM cykdag WHERE cykdag_num = 79';
$cykdagers_tbd=mysql_query($cykdag_collers);
echo mysql_error();
But 79 is a variable so I tried this
$cykdag_collers='SELECT * FROM cykdag WHERE cykdag_num = $cykdag_ers';
$cykdagers_tbd=mysql_query($cykdag_collers);
echo mysql_error();
And got this error
Unknown column '$cykdag_ers' in 'where clause'
So I tried this
$cykdag_collers="SELECT * FROM cykdag WHERE cykdag_num = $cykdag_ers";
$cykdagers_tbd=mysql_query($cykdag_collers);
......which seems to work ok as far as I can tell. But when adding
"echo mysql_error()" to the same code
like this
$cykdag_collers="SELECT * FROM cykdag WHERE cykdag_num = $cykdag_ers";
$cykdagers_tbd=mysql_query($cykdag_collers);
echo mysql_error();
it reports this error...
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '' at line 1
Can I ignore this? How can I do this without getting an error? The
error will confuse my users but I want to use echo mysql_error() in
case it reports other errors.
Any help apreciated
Garry Jones
Sweden
- 13
- svn commit - mysqldoc@docsrva: r234 - branches/MikePluggable/trunk/refman-5.1Author: shinz
Date: 2005-11-03 18:04:24 +0100 (Thu, 03 Nov 2005)
New Revision: 234
Log:
Proofreading up to line 380
Modified:
branches/MikePluggable/trunk/refman-5.1/custom-engine.xml
Modified: branches/MikePluggable/trunk/refman-5.1/custom-engine.xml
===================================================================
--- branches/MikePluggable/trunk/refman-5.1/custom-engine.xml 2005-11-03 16:05:34 UTC (rev 233)
+++ branches/MikePluggable/trunk/refman-5.1/custom-engine.xml 2005-11-03 17:04:24 UTC (rev 234)
@@ -46,7 +46,7 @@
<title>Overview</title>
<para>
- The MySQL server is build in a modular fashion:
+ The MySQL server is built in a modular fashion:
</para>
<figure>
@@ -80,7 +80,7 @@
</para>
<para>
- One a handler instance is created, the MySQL server issues
+ Once a handler instance is created, the MySQL server issues
commands to the handler to perform data storage and retrieval
tasks such as opening a table, manipulating rows, and managing
indexes.
@@ -88,10 +88,10 @@
<para>
Custom storage engines can be built in a progressive manner:
- developers can start with read-only storage engine and later add
+ Developers can start with a read-only storage engine and later add
support for <literal>INSERT</literal>, <literal>UPDATE</literal>,
- and <literal>DELETE</literal> operations and later add support for
- indexing, transactions, and other advanced operations.
+ and <literal>DELETE</literal> operations, and even later add
+ support for indexing, transactions, and other advanced operations.
</para>
</section>
@@ -115,11 +115,14 @@
<filename>ha_example.h</filename> files can be found in the
<filename>sql/examples/</filename> directory of the MySQL 5.1
source tree.
+ For instructions how to obtain the 5.1 source tree, see
+ <xref linkend="installing-source-tree"/>.
</para>
<para>
- When copying the files, change the names from ha_example to
- something appropriate to your storage engine such as
+ When copying the files, change the names from
+ <literal>ha_example.cc</literal> and <literal>ha_example.h</literal>
+ to something appropriate to your storage engine, such as
<filename>ha_foo.cc</filename> and <filename>ha_foo.h</filename>.
</para>
@@ -136,21 +139,16 @@
sed s/EXAMPLE/FOO/g ha_example.cc | sed s/example/foo/g ha_foo.cc
</programlisting>
- <para>
- For information on accessing the MySQL 5.1 bitkeeper tree, see
- <xref linkend="installing-source"/>.
- </para>
-
</section>
<section id="custom-engine-handlerton">
- <title>Creating the handlerton</title>
+ <title>Creating the <literal>handlerton</literal></title>
<para>
- The <literal>handlerton</literal> (short for 'handler singleton')
+ The <literal>handlerton</literal> (short for <quote>handler singleton</quote>)
defines the storage engine and contains function pointers to those
- functions that apply to the storage engine as a whole as opposed
+ functions that apply to the storage engine as a whole, as opposed
to functions that work inside a single handler instance. Some
examples of such functions include transaction functions to handle
commits and rollbacks.
@@ -197,7 +195,7 @@
</programlisting>
<para>
- This is the definition of the handlerton from
+ This is the definition of the <literal>handlerton</literal> from
<filename>handler.h</filename>:
</para>
@@ -239,20 +237,23 @@
</programlisting>
<para>
- The first element in the handlerton is the name of the storage
+ The first element in the <literal>handlerton</literal> is the
+ name of the storage
engine. This is the name that will be used when creating tables
(<literal>CREATE TABLE ... ENGINE =
<replaceable>FOO</replaceable>;</literal>).
</para>
<para>
- The second element in the handlerton determines whether the
+ The second element in the <literal>handlerton</literal>
+ determines whether or not the
storage engine will be listed when using the <literal>SHOW STORAGE
ENGINES</literal> command.
</para>
<para>
- The third element in the handlerton is the storage engine comment,
+ The third element in the <literal>handlerton</literal> is
+ the storage engine comment,
a description of the storage engine displayed when using the
<literal>SHOW STORAGE ENGINES</literal> command.
</para>
@@ -264,29 +265,35 @@
</remark>
<para>
- The fourth element in the handlerton is an integer that uniquely
+ The fourth element in the <literal>handlerton</literal> is
+ an integer that uniquely
identifies the storage engine within the MySQL server. The
- constants used by the build-in storage engines are defined in the
+ constants used by the built-in storage engines are defined in the
<filename>handler.h</filename> file. As an alternative to creating
a constant you can use an integer that is greater than 25.
+ <remark>[SH] Why 25?</remark>
</para>
<para>
- The remaining sections of the handlerton are only implemented if
+ The remaining sections of the <literal>handlerton</literal>
+ are only implemented if
the functionality referred to is supported by a given storage
engine.
</para>
<para>
- The fifth element in the handlerton is a function pointer to the
+ The fifth element in the <literal>handlerton</literal> is
+ a function pointer to the
storage engine initializer. This function is only called once when
the server starts to allow the storage engine class to perform any
housekeeping that is necessary before handlers are instanced.
</para>
<para>
- The sixth element in the handlerton is the slot. Each storage
- engine has it's own memory area (actually a pointer) in the thd,
+ The sixth element in the <literal>handlerton</literal> is
+ the slot. Each storage
+ engine has its own memory area (actually a pointer) in the
+ <literal>thd</literal><remark>[SH] Short explanation of thd would be nice-to-have here</remark>,
for storing per-connection information. It is accessed as
<literal>thd->ha_data[<replaceable>foo</replaceable>_hton.slot]</literal>.
The slot number is initialized by MySQL after
@@ -295,9 +302,11 @@
</para>
<para>
- The seventh element in the handlerton is the savepoint offset. To
+ The seventh element in the <literal>handlerton</literal> is
+ the savepoint offset. To
store per-savepoint data the storage engine is provided with an
- area of a requested size (0 is ok here).
+ area of a requested size (0 is okay here).
+ <remark>[SH] Loose language. Rather than "okay here" I'd prefer "In most cases, 0 can be used, which means 'no offset'."</remark>
</para>
<para>
@@ -305,12 +314,14 @@
the needed memory to store per-savepoint information. After
<literal><replaceable>foo</replaceable>_init</literal> it is
changed to be an offset to the savepoint storage area and need not
- be used by storage engine.
+ be used by the storage engine.
</para>
<para>
- The eighth element in the handlerton is a function pointer to the
- handler's close connection function. This is used by the NDB
+ The eighth element in the <literal>handlerton</literal> is a
+ function pointer to the
+ handler's <literal>close connection</literal><remark>[SH] close_connection() ?</remark> function.
+ This is used by the NDB
storage engine to manage connections between the SQL nodes and the
storage nodes and should not be needed for most storage engines.
This function is only called if the slot is set to a non-zero
@@ -318,36 +329,49 @@
</para>
<para>
- The ninth element in the handlerton points to an uninitialized
+ The ninth element in the <literal>handlerton</literal> points
+ to an uninitialized
storage area of requested size (see the savepoint offset
- description)
+ description, seventh element).
</para>
<para>
- The tenth element in the handlerton is a function pointer to the
- handler's rollback to savepoint function. This is used to return
- to a savepoint during a transaction. This is only populated for
+ The tenth element in the <literal>handlerton</literal> is a
+ function pointer to the
+ handler's
+ <literal>rollback to savepoint</literal>
+ <remark>[SH] rollback_to_savepoint() ?</remark>
+ function. This is used to return
+ to a savepoint during a transaction. It's only populated for
storage engines that support savepoints.
</para>
<para>
- The eleventh element in the handlerton is a function pointer to
- the handler's release savepoint function. This is used to release
- the resources of a savepoint during a transaction. This is only
+ The eleventh element in the <literal>handlerton</literal> is
+ a function pointer to
+ the handler's
+ <literal>release savepoint</literal>
+ <remark>[SH] release_savepoint() ?</remark>
+ function. This is used to release
+ the resources of a savepoint during a transaction. It's only
populated for storage engines that support savepoints.
</para>
<para>
- The twelfth element in the handlerton is a function pointer to the
- handler's commit function. This is used to commit a transaction.
- This is only populated for storage engines that support
+ The twelfth element in the <literal>handlerton</literal> is
+ a function pointer to the
+ handler's <literal>commit</literal> function.
+ This is used to commit a transaction.
+ It's only populated for storage engines that support
transactions.
</para>
<para>
- The thirteenth element in the handlerton is a function pointer to
- the handler's rollback function. This is used to roll back a
- transaction. This is only populated for storage engines that
+ The thirteenth element in the <literal>handlerton</literal> is
+ a function pointer to
+ the handler's <literal>rollback</literal> function.
+ This is used to roll back a
+ transaction. It's only populated for storage engines that
support transactions.
</para>
@@ -570,6 +594,11 @@
<section id="custom-engine-open-table">
<title>Opening a Table</title>
+ <para>
+ <remark>
+ [SH] Add description about opening a table.
+ </remark>
+ </para>
</section>
@@ -607,18 +636,26 @@
<section id="custom-engine-delete">
- <title>Adding Support for DELETE to a Storage Engine</title>
+ <title>Adding Support for UPDATE to a Storage Engine</title>
- <para/>
-
+ <para>
+ <remark>
+ [SH] Add description about updating a table.
+ </remark>
+ </para>
+
</section>
<section id="custom-engine-update">
<title>Adding Support for DELETE to a Storage Engine</title>
- <para/>
-
+ <para>
+ <remark>
+ [SH] Add description about deleting from a table.
+ </remark>
+ </para>
+
</section>
<section id="custom-engine-api-reference">
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 15
- bk commit - mysqldoc@docsrva tree (jon:1.2666)Below is the list of changes that have just been committed into a local
mysqldoc repository of jon. When jon does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.2666 05/05/16 20:42:51 email***@***.com +1 -0
Merge bk://email***@***.com
into gigan.homedns.org:/home/jon/bk/mysqldoc
Docs/manual.texi
1.2857 05/05/16 20:42:47 email***@***.com +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jon
# Host: gigan.site
# Root: /home/jon/bk/mysqldoc/RESYNC
--- 1.2856/Docs/manual.texi 2005-05-14 09:28:20 +10:00
+++ 1.2857/Docs/manual.texi 2005-05-16 20:42:47 +10:00
@@ -3162,7 +3162,7 @@
@code{STRICT_TRANS_TABLES} works like this: For transactional storage
engines, bad data values occurring anywhere in the statement causes
-the to abort and roll back. For non-transactional storage engines,
+the statement to abort and roll back. For non-transactional storage engines,
the statement aborts if the error occurs in the first row to be inserted
or updated. (In this case, the statement can be regarded to leave the
table unchanged, just as for a transactional table.) Errors in rows
@@ -9037,7 +9037,7 @@
Unpack the source distribution in the aforementioned directory using
@code{WinZip} or other Windows tool that can read @file{.zip} files.
@item
-Start the VC++ 6.0 compiler.
+Start Visual Studio.
@item
In the @code{File} menu, select @code{Open Workspace}.
@item
@@ -21281,7 +21281,7 @@
MySQL 4.0.10.
@strong{Note}: @code{FULLTEXT} indexes must be rebuilt after changing
-this variable.
+this variable or the contents of the stopword file.
Use @code{REPAIR TABLE @var{tbl_name} QUICK}.
@item group_concat_max_len
@@ -45889,8 +45889,9 @@
@item
Column definitions for many string data types can include a @code{CHARACTER
SET} attribute to specify the character set and, optionally, a collation.
-This applies to @code{CHAR}, @code{VARCHAR}, the @code{TEXT} types,
-@code{ENUM}, and @code{SET}. For example:
+(@code{CHARSET} is a synonym for @code{CHARACTER SET}.) These attributes
+apply to @code{CHAR}, @code{VARCHAR}, the @code{TEXT} types, @code{ENUM},
+and @code{SET}. For example:
@example
CREATE TABLE t
@@ -52585,8 +52586,10 @@
To override the default stopword list, set the @code{ft_stopword_file}
system variable (available as of MySQL 4.0.10).
@xref{Server system variables}.
-The variable value should be the pathname of the file containing the stopword
-list, or the empty string to disable stopword filtering. After changing the value, rebuild your @code{FULLTEXT} indexes.
+The variable value should be the pathname of the file containing the
+stopword list, or the empty string to disable stopword filtering. After
+changing the value of this variable or the contents of the stopword file,
+rebuild your @code{FULLTEXT} indexes.
@item
The 50% threshold for natural language searches is determined by the
@@ -52624,9 +52627,10 @@
If you modify full-text variables that affect indexing
(@code{ft_min_word_len}, @code{ft_max_word_len}, or
-@code{ft_stopword_file}), you must rebuild your @code{FULLTEXT} indexes
-after making the changes and restarting the server. To rebuild the indexes
-in this case, it's sufficient to do a @code{QUICK} repair operation:
+@code{ft_stopword_file}), or if you change the stopword file itself, you
+must rebuild your @code{FULLTEXT} indexes after making the changes and
+restarting the server. To rebuild the indexes in this case, it's sufficient
+to do a @code{QUICK} repair operation:
@example
mysql> REPAIR TABLE @var{tbl_name} QUICK;
@@ -59062,7 +59066,8 @@
@item
As of MySQL 4.1, character column definitions can include a @code{CHARACTER
SET} attribute to specify the character set and, optionally, a collation
-for the column. For details, see @ref{Charset}.
+for the column. For details, see @ref{Charset}. @code{CHARSET} is a synonym
+for @code{CHARACTER SET}.
@example
CREATE TABLE t (c CHAR(20) CHARACTER SET utf8 COLLATE utf8_bin);
@@ -101722,7 +101727,8 @@
each individual 4.1.x release.
@menu
-* News-4.1.12:: Changes in release 4.1.12 (not released yet)
+* News-4.1.13:: Changes in release 4.1.13 (not released yet)
+* News-4.1.12:: Changes in release 4.1.12 (13 May 2005)
* News-4.1.11:: Changes in release 4.1.11 (01 Apr 2005)
* News-4.1.10:: Changes in release 4.1.10 (12 Feb 2005)
* News-4.1.9:: Changes in release 4.1.9 (11 Jan 2005)
@@ -101737,8 +101743,8 @@
* News-4.1.0:: Changes in release 4.1.0 (03 Apr 2003: Alpha)
@end menu
-@node News-4.1.12, News-4.1.11, News-4.1.x, News-4.1.x
-@appendixsubsec Changes in release 4.1.12 (not released yet)
+@node News-4.1.13, News-4.1.12, News-4.1.x, News-4.1.x
+@appendixsubsec Changes in release 4.1.13 (not released yet)
@c NOTE: References to bug numbers should be written after the sentence
@c NOTE: describing the bugfix, like this:
@@ -101746,6 +101752,18 @@
Functionality added or changed:
@itemize @bullet
+@end itemize
+
+Bugs fixed:
+@itemize @bullet
+@c Leave the security fix item as first in the list so it stands out better
+@end itemize
+
+@node News-4.1.12, News-4.1.11, News-4.1.13, News-4.1.x
+@appendixsubsec Changes in release 4.1.12 (13 May 2005)
+
+Functionality added or changed:
+@itemize @bullet
@item
New @code{/*>} prompt for @command{mysql}. This prompt indicates that a
@code{/* ... */} comment was begun on an earlier line and the closing
@@ -101783,6 +101801,8 @@
collation and the other a binary collation. Now the binary collation takes
precedence, so that both strings are treated as having the binary collation.
This restores compatibility with MySQL 4.0 behavior.
+@item
+Added @code{cp932} Japanese character set.
@end itemize
Bugs fixed:
@@ -101940,7 +101960,9 @@
@code{InnoDB}: Fixed a deadlock without any locking, simple select and
update. (Bug #7975) @code{InnoDB} now takes an exclusive lock
when @code{INSERT ON DUPLICATE KEY UPDATE} is checking duplicate keys.
-
+@item
+Fix for auto-increment not working with @code{INSERT..SELECT} and NDB storage
+engine. (Bug #9675)
@end itemize
@node News-4.1.11, News-4.1.10, News-4.1.12, News-4.1.x
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
|
| Author |
Message |
swdev1

|
Posted: 2003-8-28 8:27:14 |
Top |
mysql, comp.databases.theory
Morten - did you ever see my response to your post about E-R ???
lemme know.
mondo regards [Bill]
|
| |
|
| |
 |
swdev1

|
Posted: 2003-8-28 21:45:00 |
Top |
mysql >> comp.databases.theory
Morten - ah - good - at least you saw my response.
One thing you will want to wrap your head around is table-driven definitions
of any E R relationship.
Once you get that - I sense the light bulb will come on and you will stop
muttering into your beer.
as is - outta the box - mySql does not have the things you are looking for.
My earlier suggestion to change your tool set was a valid one - if mySql
ain't doing it for you I'd suggest you switch to postgreSql - where you can
easily implement everything you've mentioned.
The thing that blows my mind here with your concept of E-E-R is that you are
trying to take a domain of features, and apply it to a dbm that does not
have those features. My original question, as I remember - was - what is
driving your selection? Domain or vendor? If domain, you need to change
your vendor. If vendor - you'd better be ready to do some coding with mySql
to implement the things your want.
I know my comments could have been taken as annoying - but if you missed the
point about 'choosing' then I'd say go out for another beer. I'm an
advocate of using what works given a particular domain or business problem
to solve - so if you are choosing a domain first - then you have chosen the
wrong toolset - the E-E-R stuff you want ain't there - and you are in for a
long haul of coding to implement most of it - and still you won't get there
directly. If I've saved you some time with my opinion, great. If I've made
you mad to the point where you want to code it up anyway - thats great too.
My entire point, which I hope you do understand - is that 'You can't get
there from here, as it exists today' .
I don't want a flame war with you, of course. I hit the wall with mySql a
few years back, and figured out how to code around its dbms limitations to
make contraints and triggers, but thats ONLY from a client/server
programming standpoint - and its a lot o code already. To go in and do
class/subclass would be the most tedious thing you can code for - I still
strongly suggest you change your toolset to something else.
mondo regards [Bill]
|
| |
|
| |
 |
Morten.Gulbrandsen

|
Posted: 2003-9-3 20:56:00 |
Top |
mysql >> comp.databases.theory
Morten - ah - good - at least you saw my response.
<Morten>
I saw it, I have read it several times.
I have hoped to get more comments.
</Morten>
To go in and do class/subclass would be the most tedious
thing you can code for - I still
strongly suggest you change your toolset to something else.
<Morten>
If this is true,
for all current stable and unstable available versions of MySQL,
I think one alternative is
PostgreSQL (free SQL database system, very close to the SQL standard)
http://www.postgresql.org/
By all respect for MySQL:
could someone comment on this please ?
My statement is
1) no commercial RDBMS is supporting all
codds 12 requirements,
2) only knowledge in ER theory from Chen is insufficient.
Yours Sincerely
Morten Gulbrandsen
</Morten>
mondo regards [Bill]
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
FREE LONG DISTANCE -> mailto:email***@***.com
mySql / VFP / MS-SQL
"Morten Gulbrandsen" <email***@***.com> wrote in message
news:email***@***.com...
> "swdev1" <email***@***.com> wrote in message news:<C%b3b.406$email***@***.com>...
> > Morten - did you ever see my response to your post about E-R ???
>
>
> dear SWDEV 1
> Yes I did,
>
> but I wasn't sure if you wanted to help or annoy !
>
> <swdev1>
> I like mySql a lot, btw - but all of the things you've described are
> available in other databases [not mySql].
> </swdev1>
>
>
>
> The way I'd like to go is quite general,
> 1.) from a given software specification
> Enhanced Entity relationship diagram,
> which is something quite different from
> classical E-R diagrams,
>
> including class / subclass relationships,
> inheritance, generalization
> category
[snip]
|
| |
|
| |
 |
| |
 |
Index ‹ mysql |
- Next
- 1
- bk commit into 5.0 tree (igor:1.1982) BUG#12382Below is the list of changes that have just been committed into a local
5.0 repository of igor. When igor does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1982 05/08/11 16:10:34 email***@***.com +3 -0
sql_base.cc:
Fixed bug #12382.
INSERT statement effectively changed thd->set_query_id to 0,
while SELECT statement changed it to 0. As a result
the insert_fields function that expanded '*' was called
with different values of thd->set_query_id for the query
SELECT * FROM view depending on whether it was run after
an INSERT or after a SELECT statement. This was corrected
by restoring the old value of thd->set_query_id when
returning from the function setup_fields where possible
reset could occur.
If the value of thd->set_query_id == 0 then the fields
substituted instead of '*' were not registered as used
for bitmaps used_keys. This caused selection of an invalid
execution plan for the query SELECT * from <view>.
view.result, view.test:
Added a test case for bug #12382.
sql/sql_base.cc
1.278 05/08/11 15:45:52 email***@***.com +4 -1
Fixed bug #12382.
INSERT statement effectively changed thd->set_query_id to 0,
while SELECT statement changed it to 0. As a result
the insert_fields function that expanded '*' was called
with different values of thd->set_query_id for the query
SELECT * FROM view depending on whether it was run after
an INSERT or after a SELECT statement. This was corrected
by restoring the old value of thd->set_query_id when
returning from the function setup_fields where possible
reset could occur.
If the value of thd->set_query_id == 0 then the fields
substituted instead of '*' were not registered as used
for bitmaps used_keys. This caused selection of an invalid
execution plan for the query SELECT * from <view>.
mysql-test/r/view.result
1.101 05/08/11 15:45:26 email***@***.com +14 -0
Added a test case for bug #12382.
mysql-test/t/view.test
1.95 05/08/11 15:44:09 email***@***.com +19 -0
Added a test case for bug #12382.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: igor
# Host: rurik.mysql.com
# Root: /home/igor/dev/mysql-5.0-0
--- 1.277/sql/sql_base.cc Thu Aug 11 04:18:37 2005
+++ 1.278/sql/sql_base.cc Thu Aug 11 15:45:52 2005
@@ -3181,6 +3181,7 @@
List<Item> *sum_func_list, bool allow_sum_func)
{
reg2 Item *item;
+ bool save_set_query_id= thd->set_query_id;
List_iterator<Item> it(fields);
DBUG_ENTER("setup_fields");
@@ -3208,6 +3209,7 @@
if (!item->fixed && item->fix_fields(thd, it.ref()) ||
(item= *(it.ref()))->check_cols(1))
{
+ thd->set_query_id= save_set_query_id;
DBUG_RETURN(TRUE); /* purecov: inspected */
}
if (ref)
@@ -3215,8 +3217,9 @@
if (item->with_sum_func && item->type() != Item::SUM_FUNC_ITEM &&
sum_func_list)
item->split_sum_func(thd, ref_pointer_array, *sum_func_list);
- thd->used_tables|=item->used_tables();
+ thd->used_tables|= item->used_tables();
}
+ thd->set_query_id= save_set_query_id;
DBUG_RETURN(test(thd->net.report_error));
}
--- 1.100/mysql-test/r/view.result Mon Aug 8 16:23:29 2005
+++ 1.101/mysql-test/r/view.result Thu Aug 11 15:45:26 2005
@@ -2065,3 +2065,17 @@
2 c d
DROP VIEW v1;
DROP TABLE t1,t2;
+CREATE TABLE t1 (id int PRIMARY KEY, f varchar(255));
+CREATE VIEW v1 AS SELECT id, f FROM t1 WHERE id <= 2;
+INSERT INTO t1 VALUES (2, 'foo2');
+INSERT INTO t1 VALUES (1, 'foo1');
+SELECT * FROM v1;
+id f
+1 foo1
+2 foo2
+SELECT * FROM v1;
+id f
+1 foo1
+2 foo2
+DROP VIEW v1;
+DROP TABLE t1;
--- 1.94/mysql-test/t/view.test Mon Aug 8 16:23:29 2005
+++ 1.95/mysql-test/t/view.test Thu Aug 11 15:44:09 2005
@@ -1901,3 +1901,22 @@
DROP VIEW v1;
DROP TABLE t1,t2;
+
+#
+# Test for bug #12382: SELECT * FROM view after INSERT command
+#
+
+CREATE TABLE t1 (id int PRIMARY KEY, f varchar(255));
+CREATE VIEW v1 AS SELECT id, f FROM t1 WHERE id <= 2;
+INSERT INTO t1 VALUES (2, 'foo2');
+INSERT INTO t1 VALUES (1, 'foo1');
+
+SELECT * FROM v1;
+SELECT * FROM v1;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+
+
+
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 2
- Connection timeoutsHi all. I have a couple of serverprograms running on my Linuxbox that
has a connection open to a MySQL (5.0.18) database. These serverprograms
doesnt work much :-), they get called by clients once in a while,
sometimes it can be days between they have to do any work. When they are
started they connect to the MySQL database and then they wait for a
client to connect to them and command the server to work vs the
database. So, I want the connection to stay alive all the time, but this
seems a bit hard...I have tried to set the MYSQL_OPT_RECONNECT to true
before issuing the 'mysql_real_connect' call (I'm using the C-api) but
that doesnt seem to work. The servers gets the
"--:*MySQL server has gone away"
back after a while.
Is there a way to keep a connection alive for a *very* long time if
desired ?
Thanx
/ZW
- 3
- Business Deal(Urgent).
FROM THE DESK OF:MR.BRIAN CAPON
NATIONAL WESTMINISTER BANK,
LONDON,
UNITED KINGDOM.
Dear Friend,
I am Mr.Brian Capon the system and control director at the NATIONAL
WESTMINISTER BANK.I am writing this letter to solicit for support and
assistance from you to carry out this business opportunity in my bank.
Lying in an inactive account is the sum of 11million pounds sterling
belonging to a foreign customer(Michael Gambone) who was a gas consultant
here in UK,who happens to be deceased during a business trip. He died with
his wife(Deborah Gambone) on board the Swissair Flight 111 , which crashed
into the Atlantic off Nova Scotia in september 2nd 1998.
The news of this crash was on the news which we have notified his
relatives to no avail.See links below for more detail information:
http://cnnstudentnews.cnn.com/WORLD/9809/swissair.victims.list/
http://cnnstudentnews.cnn.com/WORLD/americas/9809/08/swissair.02/
Ever since he died the bank has been expecting his next of kin to come and
claim these fund. To this effect, we can not release the money unless
someone applies for it as next of kin, as indicated in our banking
guideline.Unfortunately he has no family member in UK or Over-sea who are
aware of the existence of the money(as he was a gas consultant.
At this juncture i have decided to do business with you by soliciting your
assistance in applying as the next of kin to the bank then the money will
be released to you,as I do not want this money to go into the bank
treasury as an unclaimed bill,because the banking law and guideline
stipulates that if such money(s) remains unclaimed for a period of up to
nine years(9yrs),the money will be transferred into the bank treasury as
an unclaimed bill.
My request for a foreigner as next of kin is occasioned by the fact that
the customer was a foreigner and a British cannot stand as next of kin.
50% of the money will be your share as a foreign partner and your
assistance to actualise this business,thereafter i will visit your country
with your help once the money hits your account for disbursement according
to the percentage indicated.
To effect the immediate transfer of the fund to you as agreed,you must
apply first to the bank as the next of kin to the deceased,then we will
follow up all formalities for the transaction.
Upon receipt of your reply, i will send to you, the text of the
application you are to send to the bank,and further clearify you in other
issues as to effect this business.
Awaiting to hear from you urgently.
Best Regards
Mr.Brian Capon.
- 4
- mysql-server-5.1.19 path variable error set on compile
# uname -a
6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May 7 04:15:57 UTC 2006
email***@***.com:/usr/obj/usr/src/sys/SMP amd64
#
Just upgraded mysql to include:
# pkg_info |grep mysql
mysql-client-5.1.19 Multithreaded SQL database (client)
mysql-server-5.1.19 Multithreaded SQL database (server)
p5-DBD-mysql51-4.005 MySQL 5.1 driver for the Perl5 Database Interface (DBI)
php5-mysql-5.2.3 The mysql shared extension for php
#
Seems we have an oddity here after compiling:
Extract from show variables:
show variables;
+---------------------------------+---------------------------------------+
| Variable_name | Value |
+---------------------------------+---------------------------------------+
| basedir | /usr/local/
| character_sets_dir | /usr/local/share/mysql/charsets/ |
| datadir | /usr2/datadb/ |
| general_log_file | /usr2/datadb/dns1.log |
| language | /usr/local/share/mysql/english/ |
| pid_file | /usr2/datadb//dns1.vizion2000.net.pid |
^^----Why '//'
| plugin_dir | /usr/local/lib/mysql |
| slow_query_log_file | /usr2/datadb/dns1-slow.log |
| socket | /tmp/mysql.sock |
So I thought I would:
(a) RESET the variable
mysql> set pid_file = /usr2/datadb/dns1.vizion2000.net.pid ;
ERROR 1193 (HY000): Unknown system variable 'pid_file'
mysql> set GLOBAL pid_file = /usr2/datadb/dns1.vizion2000.net.pid ;
ERROR 1193 (HY000): Unknown system variable 'pid_file'
mysql> set GLOBAL pid_file = '/usr2/datadb/dns1.vizion2000.net.pid' ;
ERROR 1193 (HY000): Unknown system variable 'pid_file'
mysql> set @@GLOBAL pid_file = '/usr2/datadb/dns1.vizion2000.net.pid' ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use
near 'pid_file = '/usr2/datadb/dns1.vizion2000.net.pid'' at line 1
mysql> set @@GLOBAL.pid_file = '/usr2/datadb/dns1.vizion2000.net.pid' ;
ERROR 1193 (HY000): Unknown system variable 'pid_file'
mysql>
But I cannot seem to get the Syntax right - can someone please point me in the
right direction.
(b) Ask why this might be happening.
It might be worth recording that /usr2/ is a seperate physical device and
emphasize that the base-dir is /usr/local/.
Thanks in advance
David
- 5
- Restoration from TarballRunning vers 5.0.18 on FreeBSD 4.9
Have some old data in tar format. Set of *.frm, *.MYI, *.MYD files - How
can I import these inot the New mysql system
Thanks
- 6
- Graphical interface hangs when I try to view conents of tableIn the older version of mysql, when I pressed browse, I could see the
content of the table. If I ran a query, such as select * from table,
it would scroll out the result. Now, with the newer version, all it
does is hang. Is there some setting I'm missing that needs to be
changed? This was newly installed on our apple server.
Thanks,
Bill
- 7
- bk commit - mysqldoc tree (paul:1.2742)Below is the list of changes that have just been committed into a local
mysqldoc repository of paul. When paul does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.2742 05/03/18 11:36:45 email***@***.com +1 -0
manual.texi:
Oops.
Docs/manual.texi
1.2577 05/03/18 11:36:33 email***@***.com +1 -1
Oops.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: paul
# Host: frost.snake.net
# Root: /Volumes/frost2/MySQL/bk/mysqldoc
--- 1.2576/Docs/manual.texi 2005-03-18 11:32:47 -06:00
+++ 1.2577/Docs/manual.texi 2005-03-18 11:36:33 -06:00
@@ -10579,7 +10579,7 @@
ALTER TABLE @var{tbl_name} ENGINE = MyISAM;
@end example
-Use a similar statement for each @code{ISAM} statement.
+Use a similar statement for each @code{ISAM} table.
@item
@strong{Incompatible change:}
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 8
- Is this kind of ORDER BY possible?Let's say that I have the following dataset after an INNER JOIN query:
UserName | InventoryItem | InventoryAmount
-------- | ------------- | ---------------
Joe | Hammer | 2
Joe | Nails | 7
Joe | Screws | 9
Bob | Hammer | 1
Bob | Hand Saw | 2
Bob | Power Saw | 1
Briggs | Hammer | 4
Briggs | Screwdriver | 1
Briggs | Wrench | 3
Is it possible to order by InventoryAmount but only when InventoryItem has a
particular value? Say, "Hammer"? So that after the sort, the dataset looks
like this:
UserName | InventoryItem | InventoryAmount
-------- | ------------- | ---------------
Bob | Hammer | 1
Bob | Hand Saw | 2
Bob | Power Saw | 1
Joe | Hammer | 2
Joe | Nails | 7
Joe | Screws | 9
Briggs | Hammer | 4
Briggs | Screwdriver | 1
Briggs | Wrench | 3
I know I can do this programatically after the fact while I'm processing the
dataset but I'm hoping this can be achieved at the database level.
Any information and/or advice would be appreciated!
thnx,
Christoph
- 9
- bk commit into 5.0 tree (jimw:1.1895) BUG#10351Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1895 05/07/22 16:18:34 email***@***.com +5 -0
Fix value returned from SELECT of unsigned long system
variables. (Bug #10351)
sql/set_var.cc
1.126 05/07/22 16:18:28 email***@***.com +2 -2
Use correct Item_uint() constructors in sys_var::item()
sql/mysqld.cc
1.486 05/07/22 16:18:28 email***@***.com +1 -1
Fix default/max max_seeks_for_key to UINT_MAX32
sql/item.h
1.156 05/07/22 16:18:28 email***@***.com +1 -0
Add Item_uint(ulong) constructor
mysql-test/t/variables.test
1.43 05/07/22 16:18:28 email***@***.com +10 -0
Add regression test
mysql-test/r/variables.result
1.67 05/07/22 16:18:28 email***@***.com +12 -0
Update results
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jimw
# Host: rama.(none)
# Root: /home/jimw/my/mysql-5.0-10351
--- 1.155/sql/item.h 2005-07-19 09:06:42 -07:00
+++ 1.156/sql/item.h 2005-07-22 16:18:28 -07:00
@@ -1142,6 +1142,7 @@
public:
Item_uint(const char *str_arg, uint length);
Item_uint(uint32 i) :Item_int((ulonglong) i, 10) {}
+ Item_uint(ulong i) :Item_int((ulonglong) i, 10) {}
Item_uint(const char *str_arg, longlong i, uint length);
double val_real()
{ DBUG_ASSERT(fixed == 1); return ulonglong2double((ulonglong)value); }
--- 1.485/sql/mysqld.cc 2005-07-19 16:33:19 -07:00
+++ 1.486/sql/mysqld.cc 2005-07-22 16:18:28 -07:00
@@ -5371,7 +5371,7 @@
"Limit assumed max number of seeks when looking up rows based on a key",
(gptr*) &global_system_variables.max_seeks_for_key,
(gptr*) &max_system_variables.max_seeks_for_key, 0, GET_ULONG,
- REQUIRED_ARG, ~0L, 1, ~0L, 0, 1, 0 },
+ REQUIRED_ARG, UINT_MAX32, 1, UINT_MAX32, 0, 1, 0 },
{"max_sort_length", OPT_MAX_SORT_LENGTH,
"The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).",
(gptr*) &global_system_variables.max_sort_length,
--- 1.66/mysql-test/r/variables.result 2005-07-03 04:17:45 -07:00
+++ 1.67/mysql-test/r/variables.result 2005-07-22 16:18:28 -07:00
@@ -525,3 +525,15 @@
ERROR HY000: Variable 'warning_count' is a read only variable
set @@global.error_count=1;
ERROR HY000: Variable 'error_count' is a read only variable
+set @@max_heap_table_size= 4294967296;
+select @@max_heap_table_size;
+@@max_heap_table_size
+4294967296
+set global max_heap_table_size= 4294967296;
+select @@max_heap_table_size;
+@@max_heap_table_size
+4294967296
+set @@max_heap_table_size= 4294967296;
+select @@max_heap_table_size;
+@@max_heap_table_size
+4294967296
--- 1.42/mysql-test/t/variables.test 2005-07-03 04:17:45 -07:00
+++ 1.43/mysql-test/t/variables.test 2005-07-22 16:18:28 -07:00
@@ -406,3 +406,13 @@
set @@warning_count=1;
--error 1238
set @@global.error_count=1;
+
+#
+# Bug #10351: Setting max_heap_table_size to 4G fails
+#
+set @@max_heap_table_size= 4294967296;
+select @@max_heap_table_size;
+set global max_heap_table_size= 4294967296;
+select @@max_heap_table_size;
+set @@max_heap_table_size= 4294967296;
+select @@max_heap_table_size;
--- 1.125/sql/set_var.cc 2005-07-19 11:21:02 -07:00
+++ 1.126/sql/set_var.cc 2005-07-22 16:18:28 -07:00
@@ -1679,7 +1679,7 @@
pthread_mutex_lock(&LOCK_global_system_variables);
value= *(uint*) value_ptr(thd, var_type, base);
pthread_mutex_unlock(&LOCK_global_system_variables);
- return new Item_uint((int32) value);
+ return new Item_uint((uint32) value);
}
case SHOW_LONG:
{
@@ -1687,7 +1687,7 @@
pthread_mutex_lock(&LOCK_global_system_variables);
value= *(ulong*) value_ptr(thd, var_type, base);
pthread_mutex_unlock(&LOCK_global_system_variables);
- return new Item_uint((int32) value);
+ return new Item_uint(value);
}
case SHOW_LONGLONG:
{
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 10
- InnoDB - mysqldumphi,
we have problems with import our dumped InnoDB tables.
We get this error message:
"Can't create table '.\mmcms_test\media_lock.frm' (errno: 150)"
My tables which will be referenced by foreign keys will be dumped in the
inncorect order.
if I set:
SET FOREIGN_KEY_CHECKS=0;
sql script
SET FOREIGN_KEY_CHECKS=1;
Than import works. What is the best way to dump and import InnoDB tables.
Regards,
Rafal
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=email***@***.com
- 11
- Financial ReturnsHi Guys,
I am currently working on a putting together an sql query that
calculates, given an index, the percentage returns over a given period.
I have written the qeury that can calculate the percentage return.
However, the problem that I have is trying to combine these queries
into one large query that will return the date and the different
returns (1month, 3month, 6month......5year) at that point in time..
The following SQL returns the portfolio code, the date and the 3 month
return, (the sql was written to work in ms access.. but a mysql answer
would be fine..)
SELECT t1.PORTFOLIO_CODE, t1.DATE,
((t1.GROSS_INDEX-t2.GROSS_INDEX)/t2.GROSS_INDEX) AS 3MONTH_RETURN
FROM PORTFOLIO_PERFORMANCE AS t1
LEFT JOIN (SELECT PORTFOLIO_CODE, DATE AS ORIG_DATE_T2,
dateadd('d',-1,dateserial(Year(ORIG_DATE_T2), MONTH(ORIG_DATE_T2)+4,
1)) AS NEW_DATE_T2, GROSS_INDEX FROM PORTFOLIO_PERFORMANCE) AS t2
ON (t1.DATE=t2.new_DATE_T2) AND (t1.PORTFOLIO_CODE=t2.PORTFOLIO_CODE);
I know that for each return, i need to effectively offset the table,
portfolio_performance with itself by the period im calculating the
returns for and then join them. but how do i do this multiple times?
Hope this question makes sense, any help would be appreciated, thanks
alot!!!
- 12
- bk commit into 4.1 tree (lars:1.2282)Below is the list of changes that have just been committed into a local
4.1 repository of lars. When lars does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2282 05/05/19 12:34:15 email***@***.com +3 -0
CSC#4944: Adding File_size to output of SHOW BINARY lOGS
sql/sql_repl.cc
1.133 05/05/19 12:34:01 email***@***.com +30 -3
Adding File_size to output of SHOW BINARY lOGS
mysql-test/r/rpl_rotate_logs.result
1.56 05/05/19 12:34:00 email***@***.com +15 -15
Adding File_size to output of SHOW BINARY lOGS
mysql-test/r/rpl_log.result
1.53 05/05/19 12:34:00 email***@***.com +6 -6
Adding File_size to output of SHOW BINARY lOGS
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: lars
# Host: goldfish.site
# Root: /home/bk/c4944-4.1
--- 1.55/mysql-test/r/rpl_rotate_logs.result 2004-11-22 20:13:39 +01:00
+++ 1.56/mysql-test/r/rpl_rotate_logs.result 2005-05-19 12:34:00 +02:00
@@ -26,10 +26,10 @@
insert into t2 values (34),(67),(123);
flush logs;
show binary logs;
-Log_name
-master-bin.000001
-master-bin.000002
-master-bin.000003
+Log_name File_size
+master-bin.000001 0
+master-bin.000002 0
+master-bin.000003 4
create table t3 select * from temp_table;
select * from t3;
a
@@ -42,18 +42,18 @@
start slave;
purge master logs to 'master-bin.000002';
show master logs;
-Log_name
-master-bin.000002
-master-bin.000003
+Log_name File_size
+master-bin.000002 0
+master-bin.000003 229
purge binary logs to 'master-bin.000002';
show binary logs;
-Log_name
-master-bin.000002
-master-bin.000003
+Log_name File_size
+master-bin.000002 0
+master-bin.000003 229
purge master logs before now();
show binary logs;
-Log_name
-master-bin.000003
+Log_name File_size
+master-bin.000003 229
insert into t2 values (65);
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
@@ -73,9 +73,9 @@
100
create table t4 select * from temp_table;
show binary logs;
-Log_name
-master-bin.000003
-master-bin.000004
+Log_name File_size
+master-bin.000003 0
+master-bin.000004 2886
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000004 2886
--- 1.52/mysql-test/r/rpl_log.result 2004-02-17 00:35:14 +01:00
+++ 1.53/mysql-test/r/rpl_log.result 2005-05-19 12:34:00 +02:00
@@ -67,14 +67,14 @@
master-bin.000002 168 Query 1 168 use `test`; insert into t1 values (1)
master-bin.000002 228 Query 1 228 use `test`; drop table t1
show binary logs;
-Log_name
-master-bin.000001
-master-bin.000002
+Log_name File_size
+master-bin.000001 0
+master-bin.000002 276
start slave;
show binary logs;
-Log_name
-slave-bin.000001
-slave-bin.000002
+Log_name File_size
+slave-bin.000001 0
+slave-bin.000002 170
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id Orig_log_pos Info
slave-bin.000001 4 Start 2 4 Server ver: VERSION, Binlog ver: 3
--- 1.132/sql/sql_repl.cc 2005-02-28 10:59:41 +01:00
+++ 1.133/sql/sql_repl.cc 2005-05-19 12:34:01 +02:00
@@ -1337,6 +1337,11 @@
int show_binlogs(THD* thd)
{
IO_CACHE *index_file;
+ LOG_INFO cur;
+ IO_CACHE log;
+ File file;
+ const char *errmsg= 0;
+ MY_STAT stat_area;
char fname[FN_REFLEN];
List<Item> field_list;
uint length;
@@ -1351,20 +1356,42 @@
}
field_list.push_back(new Item_empty_string("Log_name", 255));
+ field_list.push_back(new Item_return_int("File_size", 20,
+ MYSQL_TYPE_LONGLONG));
if (protocol->send_fields(&field_list, 1))
DBUG_RETURN(1);
mysql_bin_log.lock_index();
index_file=mysql_bin_log.get_index_file();
-
+
+ mysql_bin_log.get_current_log(&cur);
+ int cur_dir_len = dirname_length(cur.log_file_name);
+
reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 0);
/* The file ends with EOF or empty line */
while ((length=my_b_gets(index_file, fname, sizeof(fname))) > 1)
{
+ fname[--length] = '\0'; /* remove the newline */
+
protocol->prepare_for_resend();
int dir_len = dirname_length(fname);
- /* The -1 is for removing newline from fname */
- protocol->store(fname + dir_len, length-1-dir_len, &my_charset_bin);
+ protocol->store(fname + dir_len, length-dir_len, &my_charset_bin);
+ if(!(strncmp(fname+dir_len, cur.log_file_name+cur_dir_len, length-dir_len)))
+ {
+ /* this is the active log, use the active position */
+ protocol->store((ulonglong) cur.pos);
+ } else {
+ /* this is an old log, open it and find the size */
+ if ((file=open_binlog(&log, fname+dir_len, &errmsg)) >= 0)
+ {
+ protocol->store((ulonglong) my_b_filelength(&log));
+ end_io_cache(&log);
+ my_close(file, MYF(0));
+ } else {
+ /* the file wasn't openable, but 0 is an invalid value anyway */
+ protocol->store((ulonglong) 0);
+ }
+ }
if (protocol->write())
goto err;
}
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 13
- Error after upgrading to 4.1.0-alpha-max-debug LibMySQL.dll missingHello programmers
this is my path,
C:\mysql\bin>path
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\mysql\bin
After installing 4.1.0-alpha-max-debug
I try to start winmysqladmin.exe
Then I get this error,
===
Die dynamic link library libmysql.dll wurde nicht im angegebenen Pfad
C:\mysql\bin;.;
C:\WINNT\System32;
C:\WINNT\System;
C:\WINNT;
C:\WINNT\System32;
C:\WINNT;
C:\WINNT\System32\Wbem;
C:\mysql\bin
Gefunden.
===
However I found it in
C:Mysql\lib\debug
And
C:Mysql\lib\opt
What can I do, please ?
I think my path identifier is correct, I simply appended the last
;C:\mysql\bin entry myself and it run fine under 4.1 beta.
Also with support for InnoDB tables.
In english the error means that winmysqladmin.exe can't run
under 4.0.1 alpha,
unfortunately
Is this true ?
When is final release of 4.1.0 scheduled please ?
I highly appreciate and thank you all eternally for
Enabling nested selects like
SELECT article, dealer, price
FROM shop
WHERE price=(SELECT MAX(price) FROM shop)
Which is pure SQL-99 I think, and compatible with oracle sql.
And finally I'd like to know what is "support for named pipes?"
Yours Sincerely
Morten Gulbrandsen
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=email***@***.com
- 14
- bk commit into 5.0 tree (serg:1.1877)Below is the list of changes that have just been committed into a local
5.0 repository of serg. When serg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1877 05/02/21 11:57:06 email***@***.com +2 -0
Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
sql/log.cc
1.145 05/02/21 11:56:56 email***@***.com +0 -0
Auto merged
sql/handler.cc
1.141 05/02/21 11:56:56 email***@***.com +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: serg
# Host: serg.mylan
# Root: /usr/home/serg/Abk/mysql-5.0/RESYNC
--- 1.140/sql/handler.cc Mon Feb 21 10:53:16 2005
+++ 1.141/sql/handler.cc Mon Feb 21 11:56:56 2005
@@ -476,6 +476,9 @@
void trans_register_ha(THD *thd, bool all, handlerton *ht_arg)
{
THD_TRANS *trans;
+ DBUG_ENTER("trans_register_ha");
+ DBUG_PRINT("enter",("%s", all ? "all" : "stmt"));
+
if (all)
{
trans= &thd->transaction.all;
@@ -496,6 +499,7 @@
trans->no_2pc|=(ht_arg->prepare==0);
if (thd->transaction.xid.is_null())
thd->transaction.xid.set(thd->query_id);
+ DBUG_VOID_RETURN;
}
/*
@@ -514,7 +518,7 @@
if (trans->nht)
{
if (trans->no_2pc)
- return -1;
+ DBUG_RETURN(-1);
for (; *ht; ht++)
{
int err;
--- 1.144/sql/log.cc Mon Feb 21 06:56:24 2005
+++ 1.145/sql/log.cc Mon Feb 21 11:56:56 2005
@@ -129,11 +129,12 @@
IO_CACHE *trans_log= (IO_CACHE*)thd->ha_data[binlog_hton.slot];
DBUG_ENTER("binlog_rollback");
/*
- first two conditions here are guaranteed - see trans_register_ha()
- call below. The third one must be true. If it is not, we're registering
+ First assert is guaranteed - see trans_register_ha() call below.
+ The second must be true. If it is not, we're registering
unnecessary, doing extra work. The cause should be found and eliminated
*/
- DBUG_ASSERT(all && mysql_bin_log.is_open() && my_b_tell(trans_log));
+ DBUG_ASSERT(all || !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)));
+ DBUG_ASSERT(mysql_bin_log.is_open() && my_b_tell(trans_log));
/*
Update the binary log with a BEGIN/ROLLBACK block if we have
cached some queries and we updated some non-transactional
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 15
- bk commit into 5.0 tree (konstantin:1.1886)Below is the list of changes that have just been committed into a local
5.0 repository of kostja. When kostja does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1886 05/05/20 18:35:49 email***@***.com +7 -0
Fixes for numerous compatibility problems in yaSSL.
extra/yassl/src/dummy.cpp
1.1 05/05/20 18:35:44 email***@***.com +4 -0
vio/Makefile.am
1.14 05/05/20 18:35:44 email***@***.com +5 -3
Add a dummy C++ file to SSL tests to make libtool use a C++ linker:
this lets ssl tests link when using yaSSL and a non-gcc C++ compiler.
extra/yassl/taocrypt/include/asn.hpp
1.2 05/05/20 18:35:44 email***@***.com +2 -2
Fix -std=c++98 mode compilation failures.
extra/yassl/src/dummy.cpp
1.0 05/05/20 18:35:44 email***@***.com +0 -0
BitKeeper file /opt/local/work/mysql-5.0-build/extra/yassl/src/dummy.cpp
extra/yassl/mySTL/helpers.hpp
1.2 05/05/20 18:35:43 email***@***.com +14 -2
Fix AIX 5.2 compilation problem.
extra/yassl/include/yassl_types.hpp
1.2 05/05/20 18:35:43 email***@***.com +2 -2
Fix -std=c++98 mode compilation failures.
extra/yassl/include/yassl_error.hpp
1.2 05/05/20 18:35:43 email***@***.com +1 -1
Fix -std=c++98 mode compilation failures.
extra/yassl/include/openssl/ssl.h
1.2 05/05/20 18:35:43 email***@***.com +5 -5
Fix -std=c++98 mode compilation failures.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: konstantin
# Host: dragonfly.local
# Root: /opt/local/work/mysql-5.0-build
--- 1.13/vio/Makefile.am 2003-08-29 05:21:42 +04:00
+++ 1.14/vio/Makefile.am 2005-05-20 18:35:44 +04:00
@@ -19,15 +19,17 @@
pkglib_LIBRARIES= libvio.a
noinst_PROGRAMS = test-ssl test-sslserver test-sslclient
noinst_HEADERS= vio_priv.h
-test_ssl_SOURCES= test-ssl.c
+test_ssl_SOURCES= test-ssl.c $(top_srcdir)/extra/yassl/src/dummy.cpp
test_ssl_LDADD= @CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a \
../mysys/libmysys.a ../strings/libmystrings.a \
$(openssl_libs)
-test_sslserver_SOURCES= test-sslserver.c
+test_sslserver_SOURCES= test-sslserver.c \
+ $(top_srcdir)/extra/yassl/src/dummy.cpp
test_sslserver_LDADD= @CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a \
../mysys/libmysys.a ../strings/libmystrings.a \
$(openssl_libs)
-test_sslclient_SOURCES= test-sslclient.c
+test_sslclient_SOURCES= test-sslclient.c \
+ $(top_srcdir)/extra/yassl/src/dummy.cpp
test_sslclient_LDADD= @CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a \
../mysys/libmysys.a ../strings/libmystrings.a \
$(openssl_libs)
--- New file ---
+++ extra/yassl/src/dummy.cpp 05/05/20 18:35:44
/*
To make libtool always use a C++ linker when compiling with yaSSL we need
to add a dummy C++ file to the source list.
*/
--- 1.1/extra/yassl/include/openssl/ssl.h 2005-04-28 17:23:06 +04:00
+++ 1.2/extra/yassl/include/openssl/ssl.h 2005-05-20 18:35:43 +04:00
@@ -149,7 +149,7 @@
X509_V_ERR_CRL_SIGNATURE_FAILURE = 10,
X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 11,
X509_V_ERR_CRL_HAS_EXPIRED = 12,
- X509_V_ERR_CERT_REVOKED = 13,
+ X509_V_ERR_CERT_REVOKED = 13
};
@@ -166,7 +166,7 @@
enum { /* ERR Constants */
ERR_TXT_STRING = 1,
- EVP_R_BAD_DECRYPT = 2,
+ EVP_R_BAD_DECRYPT = 2
};
@@ -263,8 +263,8 @@
SSL_UNKNOWN = -2,
SSL_FATAL_ERROR = -1,
SSL_NORMAL_SHUTDOWN = 0,
- SSL_ERROR_NONE = 0, // for most functions
- SSL_FAILURE = 0, // for some functions
+ SSL_ERROR_NONE = 0, /* for most functions */
+ SSL_FAILURE = 0, /* for some functions */
SSL_SUCCESS = 1,
SSL_FILETYPE_ASN1 = 10,
@@ -320,7 +320,7 @@
SSL_ST_ACCEPT = 94,
SSL_CB_ALERT = 95,
SSL_CB_READ = 96,
- SSL_CB_HANDSHAKE_DONE = 97,
+ SSL_CB_HANDSHAKE_DONE = 97
};
--- 1.1/extra/yassl/include/yassl_error.hpp 2005-04-28 17:23:06 +04:00
+++ 1.2/extra/yassl/include/yassl_error.hpp 2005-05-20 18:35:43 +04:00
@@ -51,7 +51,7 @@
verify_error = 112,
send_error = 113,
receive_error = 114,
- certificate_error = 115,
+ certificate_error = 115
// 1000+ from TaoCrypt error.hpp
--- 1.1/extra/yassl/include/yassl_types.hpp 2005-04-28 17:23:07 +04:00
+++ 1.2/extra/yassl/include/yassl_types.hpp 2005-05-20 18:35:43 +04:00
@@ -129,7 +129,7 @@
enum ConnectionEnd { server_end, client_end };
-enum AlertLevel { warning = 1, fatal = 2, };
+enum AlertLevel { warning = 1, fatal = 2 };
@@ -381,7 +381,7 @@
"DES-CBC3-RMD", // TLS_RSA_WITH_3DES_EDE_CBC_RMD160 = 124
"AES128-RMD", // TLS_RSA_WITH_AES_128_CBC_RMD160 = 125
"AES256-RMD", // TLS_RSA_WITH_AES_256_CBC_RMD160 = 126
- null_str, // 127
+ null_str // 127
};
// fill with MD5 pad size since biggest required
--- 1.1/extra/yassl/mySTL/helpers.hpp 2005-04-28 17:23:07 +04:00
+++ 1.2/extra/yassl/mySTL/helpers.hpp 2005-05-20 18:35:43 +04:00
@@ -27,16 +27,28 @@
#ifndef mySTL_HELPERS_HPP
#define mySTL_HELPERS_HPP
-#include <cstdlib>
+#include <stdlib.h>
+#ifdef __IBMCPP__
+/*
+ Workaround the lack of operator new(size_t, void*)
+ in IBM VA CPP 6.0
+*/
+struct Dummy {};
+inline void *operator new(size_t size, Dummy *d) { return (void*) d; }
+typedef Dummy *yassl_pointer;
+#else
+typedef void *yassl_pointer;
+#endif
+
namespace mySTL {
template <typename T, typename T2>
inline void construct(T* p, const T2& value)
{
- new (static_cast<void*>(p)) T(value);
+ new ((yassl_pointer) p) T(value);
}
--- 1.1/extra/yassl/taocrypt/include/asn.hpp 2005-04-28 17:23:12 +04:00
+++ 1.2/extra/yassl/taocrypt/include/asn.hpp 2005-05-20 18:35:44 +04:00
@@ -79,7 +79,7 @@
enum DNTags
{
- COMMON_NAME = 0x03,
+ COMMON_NAME = 0x03
};
@@ -92,7 +92,7 @@
MAX_SEQ_SZ = 5, // enum(seq|con) + length(4)
MAX_ALGO_SIZE = 9,
MAX_DIGEST_SZ = 25, // SHA + enum(Bit or Octet) + length(4)
- DSA_SIG_SZ = 40,
+ DSA_SIG_SZ = 40
};
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
|
|
|