| Newline character in TEXT field. |
|
 |
Index ‹ mysql
|
- Previous
- 1
- bk commit into 5.1 tree (joreland:1.1951)Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas 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.1951 05/07/26 15:15:51 email***@***.com +3 -0
ndb - varsize fix type of NDB$PK
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
1.90 05/07/26 15:15:46 email***@***.com +30 -28
Fix type ndb$PK
storage/ndb/src/kernel/blocks/backup/Backup.cpp
1.47 05/07/26 15:15:46 email***@***.com +2 -2
dont lock LCP backup tables
storage/ndb/tools/config.cpp
1.3 05/07/25 16:02:58 email***@***.com +0 -0
Rename: ndb/tools/config.cpp -> storage/ndb/tools/config.cpp
# 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: joreland
# Host: eel.(none)
# Root: /home/jonas/src/mysql-5.1-ndb-dd
--- 1.46/storage/ndb/src/kernel/blocks/backup/Backup.cpp 2005-07-25 10:30:27 +02:00
+++ 1.47/storage/ndb/src/kernel/blocks/backup/Backup.cpp 2005-07-26 15:15:46 +02:00
@@ -2874,14 +2874,14 @@
jam();
ptr.p->tables.release(tmp);
}
- else
+ else if(!ptr.p->is_lcp())
{
jam();
signal->theData[0] = tmp.p->tableId;
signal->theData[1] = 1; // lock
EXECUTE_DIRECT(DBDICT, GSN_BACKUP_FRAGMENT_REQ, signal, 2);
}
-
+
if(tabPtr.i == RNIL) {
jam();
--- 1.89/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2005-07-25 10:30:27 +02:00
+++ 1.90/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2005-07-26 15:15:46 +02:00
@@ -6835,6 +6835,9 @@
case TableRecord::DEFINED:
conf->setTableState(pos, DictTabInfo::StateOnline);
break;
+ case TableRecord::BACKUP_ONGOING:
+ conf->setTableState(pos, DictTabInfo::StateBackup);
+ break;
default:
conf->setTableState(pos, DictTabInfo::StateBroken);
break;
@@ -7185,6 +7188,7 @@
char attributeName[MAX_ATTR_NAME_SIZE];
};
Uint32 k;
+ Uint32 attrid_map[MAX_ATTRIBUTES_IN_INDEX];
jam();
const CreateIndxReq* const req = &opPtr.p->m_request;
@@ -7255,25 +7259,6 @@
indexPtr.p->tupKeyLength = MAX_TTREE_NODE_SIZE;
}
- if (indexPtr.p->isHashIndex()) {
- // put index columns in table order i.e. ascending order
- bool disorder = true;
- while (disorder) {
- disorder = false;
- for (Uint32 i = 1; i < opPtr.p->m_attrList.sz; i++) {
- Uint32 & y = opPtr.p->m_attrList.id[i-1];
- Uint32 & x = opPtr.p->m_attrList.id[i];
- if (y > x) {
- Uint32 z = x;
- x = y;
- y = z;
- disorder = true;
- }
- }
- }
- }
-
- bool hash_index_var_key = false;
AttributeMask mask;
mask.clear();
for (k = 0; k < opPtr.p->m_attrList.sz; k++) {
@@ -7316,15 +7301,16 @@
}
mask.set(current_id);
-
+ unsigned kk= k;
if (indexPtr.p->isHashIndex()) {
const Uint32 s1 = AttributeDescriptor::getSize(a);
const Uint32 s2 = AttributeDescriptor::getArraySize(a);
indexPtr.p->tupKeyLength += ((1 << s1) * s2 + 31) >> 5;
- if (AttributeDescriptor::getArrayType != NDB_ARRAYTYPE_FIXED)
- hash_index_var_key = true;
+ for (; kk > 0 && current_id < attrid_map[kk-1]>>16; kk--)
+ attrid_map[kk]= attrid_map[kk-1];
}
+ attrid_map[kk]= k | (current_id << 16);
}
indexPtr.p->noOfPrimkey = indexPtr.p->noOfAttributes;
@@ -7345,11 +7331,12 @@
w.add(DictTabInfo::NoOfNullable, indexPtr.p->noOfNullAttr);
w.add(DictTabInfo::KeyLength, indexPtr.p->tupKeyLength);
// write index key attributes
- AttributeRecordPtr aRecPtr;
- c_attributeRecordPool.getPtr(aRecPtr, tablePtr.p->m_attributes.firstItem);
for (k = 0; k < opPtr.p->m_attrList.sz; k++) {
- // insert the attributes in column number order
- unsigned current_id= opPtr.p->m_attrList.id[k];
+ // insert the attributes in the order decided above in attrid_map
+ // k is new order, current_id is in previous order
+ // ToDo: make sure "current_id" is stored with the table and
+ // passed up to NdbDictionary
+ unsigned current_id= opPtr.p->m_attrList.id[attrid_map[k] & 0xffff];
jam();
for (Uint32 tAttr = tablePtr.p->m_attributes.firstItem; tAttr != RNIL; ) {
AttributeRecord* aRec = c_attributeRecordPool.getPtr(tAttr);
@@ -7384,11 +7371,26 @@
}
if (indexPtr.p->isHashIndex()) {
jam();
+
+ Uint32 key_type = NDB_ARRAYTYPE_FIXED;
+ AttributeRecordPtr attrPtr;
+ LocalDLFifoList<AttributeRecord> alist(c_attributeRecordPool,
+ tablePtr.p->m_attributes);
+ for (alist.first(attrPtr); !attrPtr.isNull(); alist.next(attrPtr))
+ {
+ const Uint32 desc = attrPtr.p->attributeDescriptor;
+ if (AttributeDescriptor::getPrimaryKey(desc) &&
+ AttributeDescriptor::getArrayType(desc) != NDB_ARRAYTYPE_FIXED)
+ {
+ key_type = NDB_ARRAYTYPE_MEDIUM_VAR;
+ break;
+ }
+ }
+
// write concatenated primary table key attribute i.e. keyinfo
w.add(DictTabInfo::AttributeName, "NDB$PK");
w.add(DictTabInfo::AttributeId, opPtr.p->m_attrList.sz);
- // make it sort last (ice getting thin here)
- w.add(DictTabInfo::AttributeArrayType, (Uint32)NDB_ARRAYTYPE_MEDIUM_VAR);
+ w.add(DictTabInfo::AttributeArrayType, key_type);
w.add(DictTabInfo::AttributeKeyFlag, (Uint32)false);
w.add(DictTabInfo::AttributeNullableFlag, (Uint32)false);
w.add(DictTabInfo::AttributeExtType, (Uint32)DictTabInfo::ExtUnsigned);
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 1
- bk commit - mysqldoc tree (mskold:1.2834)Below is the list of changes that have just been committed into a local
mysqldoc repository of marty. When marty 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.2834 05/04/07 11:47:50 email***@***.com +1 -0
Added change history for cluster, 4.1.11, add comments for more open ones to be fixed in 5.0
Docs/manual.texi
1.2671 05/04/07 11:47:42 email***@***.com +4 -0
Added change history for cluster, 4.1.11, add comments for more open ones to be fixed in 5.0
# 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: mskold
# Host: blowfish.ndb.mysql.com
# Root: /usr/local/home/marty/MySQL/mysqldoc
--- 1.2670/Docs/manual.texi Thu Apr 7 11:14:28 2005
+++ 1.2671/Docs/manual.texi Thu Apr 7 11:47:42 2005
@@ -114867,6 +114867,10 @@
@c closed bugs 5.0.4
@c Bug #9517 Condition pushdown to storage engine does not work for update/delete
+@c open
+@c Bug #9675 Auto-increment not working with INSERT..SELECT and NDB storage
+@c Bug #9282 API Node Crashes/Reloads on 'DELETE FROM'
+@c Bug #9280 Memory leak in cluster when dependent sub-queries are used
@c closed bugs 5.0.3
@c Bug #8315 NdbScanFilter cmp method only works for strings of exact word boundry length
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 5
- Urgent from Thomas Winkler
Urgent from Thomas Winkler
UBS AG Postfach
8098 Zurich
Switzerland
www.ubs.com
Hello,
I am an investment consultant working with Bank Of Swtizerland, UBS AG. at
their offshore department Zurich Switzerland.I will be happy to work this
deal out with you if you have a coporate or personal Bank Account and if you
are capable to keep TOP SECRET.I need strong Assurance that you will never
let me down,if I transter this money to your account.
During one of our periodic auditing I discorved a dormant accounts with
holding balance of 18,000.000.00 {Eighteen million Euros} this account has
not been operated for the past years. As at this moment,I am constrained to
issue more
details about this business until your response is received.
If you are not familiar with my Bank profile,please take a moment of your
very busy schedules to read about my Bank website;uwww.ubs.com and I look
forward to hearing from you as soon as possible. on replying send me the
followings.
YOUR NAME:
YOUR BANK DETAILS TO RECIEVE IN COMING FUNDS:
YOUR TEL NOS.:
Thank you for your time and attention.
Warmest regards,
Mr. Thomas Winkler
Chief investment Consultant.
<p>Urgent from Thomas Winkler<br> <br>UBS AG Postfach<br>8098 Zurich<br>Switzerland<br><a href="http://www.ubs.com/">www.ubs.com</a><br> <br>Hello,<br> <br>I am an investment consultant working with Bank Of Swtizerland, UBS AG. at their offshore department Zurich Switzerland.I will be happy to work this deal out with you if you have a coporate or personal Bank Account and if you are capable to keep TOP SECRET.I need strong Assurance that you will never let me down,if I transter this money to your account.</p>
<p>During one of our periodic auditing I discorved a dormant accounts with holding balance of 18,000.000.00 {Eighteen million Euros} this account has not been operated for the past years. As at this moment,I am constrained to issue more <br>
details about this business until your response is received. <br> <br>If you are not familiar with my Bank profile,please take a moment of your very busy schedules to read about my Bank website;<a href="http://uwww.ubs.com">uwww.ubs.com</a> and I look forward to hearing from you as soon as possible. on replying send me the followings. <br>
<br>YOUR NAME: <br>YOUR BANK DETAILS TO RECIEVE IN COMING FUNDS:<br>YOUR TEL NOS.: <br> <br>Thank you for your time and attention. <br>Warmest regards,<br> <br>Mr. Thomas Winkler<br>Chief investment Consultant.<br> </p>
<p><br> </p>
- 8
- FulltextHi,
I would have thought that if I tried to search for "seat" using fulltext it
would return results with the word "seats" in as well. Seems like it doesn't
though.
I then tried it with WITH QUERY EXTENSION but this doesn't add anything
either. What's the best way of achieving this, bearing in mind that the
search term is taken from a php script and therefore any number of words
could be added?
Thanks,
Mark
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.747 / Virus Database: 499 - Release Date: 01/09/2004
- 8
- bk commit into 5.1 tree (pekka:1.1915)Below is the list of changes that have just been committed into a local
5.1 repository of pekka. When pekka 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
storage/ndb/src/kernel/blocks/backup/Backup.cpp
1.39 05/06/20 16:45:47 email***@***.com +3 -1
missing attr iterator when null from scan
storage/ndb/src/kernel/blocks/suma/Suma.cpp
1.21 05/06/20 16:44:47 email***@***.com +1 -0
XXX to fix
storage/ndb/src/common/debugger/signaldata/SignalNames.cpp
1.12 05/06/20 16:44:12 email***@***.com +4 -0
add names LCP_PREPARE
ChangeSet
1.1915 05/06/20 16:32:41 email***@***.com +3 -0
ndb - wl#1751 fix null in lcp/backup (5.1)
# 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: pekka
# Host: tuna.ndb.mysql.com
# Root: /orca/space/pekka/ndb/version/my51-vs
--- 1.11/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp 2005-04-29 16:30:22 +02:00
+++ 1.12/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp 2005-06-20 16:44:12 +02:00
@@ -641,5 +641,9 @@
,{ GSN_DROP_OBJ_REQ, "DROP_OBJ_REQ" }
,{ GSN_DROP_OBJ_REF, "DROP_OBJ_REF" }
,{ GSN_DROP_OBJ_CONF, "DROP_OBJ_CONF" }
+
+ ,{ GSN_LCP_PREPARE_REQ, "LCP_PREPARE_REQ" }
+ ,{ GSN_LCP_PREPARE_REF, "LCP_PREPARE_REF" }
+ ,{ GSN_LCP_PREPARE_CONF, "LCP_PREPARE_CONF" }
};
const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName);
--- 1.38/storage/ndb/src/kernel/blocks/backup/Backup.cpp 2005-06-13 15:24:48 +02:00
+++ 1.39/storage/ndb/src/kernel/blocks/backup/Backup.cpp 2005-06-20 16:45:47 +02:00
@@ -67,6 +67,7 @@
#endif
//#define DEBUG_ABORT
+//#define dbg globalSignalLoggers.log
static Uint32 g_TypeOfStart = NodeState::ST_ILLEGAL_TYPE;
@@ -2961,6 +2962,7 @@
attrPtr.p->data.m_flags = 0;
attrPtr.p->data.attrId = tmp.AttributeId;
+
attrPtr.p->data.m_flags |=
(tmp.AttributeNullableFlag ? Attribute::COL_NULLABLE : 0);
attrPtr.p->data.m_flags |= (tmp.AttributeArrayType == NDB_ARRAYTYPE_FIXED)?
@@ -3426,7 +3428,6 @@
const Uint32 attrId = attrHead.getAttributeId();
const bool null = attrHead.isNULL();
const Attribute::Data attr = attrPtr.p->data;
-
ndbrequire(attrId == attr.attrId);
usedSz += attrHead.getHeaderSize();
@@ -3439,6 +3440,7 @@
op.nullAttribute(attr.offsetNull);
else
op.nullVariable();
+ table.attributes.next(attrPtr);
continue;
}//if
--- 1.20/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2005-04-08 02:44:06 +02:00
+++ 1.21/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2005-06-20 16:44:47 +02:00
@@ -1099,6 +1099,7 @@
ndbrequire(false);
}
}
+ // XXX missing releaseSections ?
sendSubCreateConf(signal, sender, subPtr);
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 9
- bk commit into 4.1 tree (serg:1.2094)Below is the list of changes that have just been committed into a local
4.1 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.2094 05/03/09 12:59:20 email***@***.com +1 -0
myisam/myisam_ftdump.c
recalculate stats/gws for the last word in the index too
remove unused code
myisam/myisam_ftdump.c
1.36 05/03/09 12:59:13 email***@***.com +89 -99
recalculate stats/gws for the last word in the index too
remove unused code
# 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-4.1
--- 1.35/myisam/myisam_ftdump.c Wed Oct 20 00:28:34 2004
+++ 1.36/myisam/myisam_ftdump.c Wed Mar 9 12:59:13 2005
@@ -44,10 +44,6 @@
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"length", 'l', "Report length distribution.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef DISABLED
- {"execute", 'e', "Execute given query.", (gptr*) &query, (gptr*) &query, 0,
- GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#endif
{"help", 'h', "Display help and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Synonym for -h.",
@@ -108,122 +104,119 @@
mi_lock_database(info, F_EXTRA_LCK);
- if (query)
- {
-#if 0
- FT_DOCLIST *result;
- int i;
-
- ft_init_stopwords(ft_precompiled_stopwords);
-
- result=ft_nlq_init_search(info,inx,query,strlen(query),1);
- if(!result)
- goto err;
+ info->lastpos= HA_OFFSET_ERROR;
+ info->update|= HA_STATE_PREV_FOUND;
- if (verbose)
- printf("%d rows matched\n",result->ndocs);
-
- for(i=0 ; i<result->ndocs ; i++)
- printf("%9lx %20.7f\n",(ulong)result->doc[i].dpos,result->doc[i].weight);
-
- ft_nlq_close_search(result);
-#else
- printf("-e option is disabled\n");
-#endif
- }
- else
+ while (!(error=mi_rnext(info,NULL,inx)))
{
- info->lastpos= HA_OFFSET_ERROR;
- info->update|= HA_STATE_PREV_FOUND;
-
- while (!(error=mi_rnext(info,NULL,inx)))
- {
- keylen=*(info->lastkey);
+ keylen=*(info->lastkey);
- subkeys=ft_sintXkorr(info->lastkey+keylen+1);
- if (subkeys >= 0)
- weight=*(float*)&subkeys;
+ subkeys=ft_sintXkorr(info->lastkey+keylen+1);
+ if (subkeys >= 0)
+ weight=*(float*)&subkeys;
#ifdef HAVE_SNPRINTF
- snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey+1);
+ snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey+1);
#else
- sprintf(buf,"%.*s",(int) keylen,info->lastkey+1);
+ sprintf(buf,"%.*s",(int) keylen,info->lastkey+1);
#endif
- my_casedn_str(default_charset_info,buf);
- total++;
- lengths[keylen]++;
+ my_casedn_str(default_charset_info,buf);
+ total++;
+ lengths[keylen]++;
- if (count || stats)
+ if (count || stats)
+ {
+ doc_cnt++;
+ if (strcmp(buf, buf2))
{
- doc_cnt++;
- if (strcmp(buf, buf2))
+ if (*buf2)
{
- if (*buf2)
+ uniq++;
+ avg_gws+=gws=GWS_IN_USE;
+ if (count)
+ printf("%9u %20.7f %s\n",doc_cnt,gws,buf2);
+ if (maxlen<keylen2)
{
- uniq++;
- avg_gws+=gws=GWS_IN_USE;
- if (count)
- printf("%9u %20.7f %s\n",doc_cnt,gws,buf2);
- if (maxlen<keylen2)
- {
- maxlen=keylen2;
- strmov(buf_maxlen, buf2);
- }
- if (max_doc_cnt < doc_cnt)
- {
- max_doc_cnt=doc_cnt;
- strmov(buf_min_gws, buf2);
- min_gws=gws;
- }
+ maxlen=keylen2;
+ strmov(buf_maxlen, buf2);
+ }
+ if (max_doc_cnt < doc_cnt)
+ {
+ max_doc_cnt=doc_cnt;
+ strmov(buf_min_gws, buf2);
+ min_gws=gws;
}
- strmov(buf2, buf);
- keylen2=keylen;
- doc_cnt=0;
}
+ strmov(buf2, buf);
+ keylen2=keylen;
+ doc_cnt=0;
}
- if (dump)
- {
- if (subkeys>=0)
- printf("%9lx %20.7f %s\n", (long) info->lastpos,weight,buf);
- else
- printf("%9lx => %17d %s\n",(long) info->lastpos,-subkeys,buf);
- }
- if (verbose && (total%HOW_OFTEN_TO_WRITE)==0)
- printf("%10ld\r",total);
}
- mi_lock_database(info, F_UNLCK);
+ if (dump)
+ {
+ if (subkeys>=0)
+ printf("%9lx %20.7f %s\n", (long) info->lastpos,weight,buf);
+ else
+ printf("%9lx => %17d %s\n",(long) info->lastpos,-subkeys,buf);
+ }
+ if (verbose && (total%HOW_OFTEN_TO_WRITE)==0)
+ printf("%10ld\r",total);
+ }
+ mi_lock_database(info, F_UNLCK);
- if (stats)
+ if (count || stats)
+ {
+ doc_cnt++;
+ if (*buf2)
{
- count=0;
- for (inx=0;inx<256;inx++)
+ uniq++;
+ avg_gws+=gws=GWS_IN_USE;
+ if (count)
+ printf("%9u %20.7f %s\n",doc_cnt,gws,buf2);
+ if (maxlen<keylen2)
{
- count+=lengths[inx];
- if ((ulong) count >= total/2)
- break;
+ maxlen=keylen2;
+ strmov(buf_maxlen, buf2);
}
- printf("Total rows: %lu\nTotal words: %lu\n"
- "Unique words: %lu\nLongest word: %lu chars (%s)\n"
- "Median length: %u\n"
- "Average global weight: %f\n"
- "Most common word: %lu times, weight: %f (%s)\n",
- (long) info->state->records, total, uniq, maxlen, buf_maxlen,
- inx, avg_gws/uniq, max_doc_cnt, min_gws, buf_min_gws);
- }
- if (lstats)
- {
- count=0;
- for (inx=0; inx<256; inx++)
+ if (max_doc_cnt < doc_cnt)
{
- count+=lengths[inx];
- if (count && lengths[inx])
- printf("%3u: %10lu %5.2f%% %20lu %4.1f%%\n", inx,
- (ulong) lengths[inx],100.0*lengths[inx]/total,(ulong) count,
- 100.0*count/total);
+ max_doc_cnt=doc_cnt;
+ strmov(buf_min_gws, buf2);
+ min_gws=gws;
}
}
}
+ if (stats)
+ {
+ count=0;
+ for (inx=0;inx<256;inx++)
+ {
+ count+=lengths[inx];
+ if ((ulong) count >= total/2)
+ break;
+ }
+ printf("Total rows: %lu\nTotal words: %lu\n"
+ "Unique words: %lu\nLongest word: %lu chars (%s)\n"
+ "Median length: %u\n"
+ "Average global weight: %f\n"
+ "Most common word: %lu times, weight: %f (%s)\n",
+ (long) info->state->records, total, uniq, maxlen, buf_maxlen,
+ inx, avg_gws/uniq, max_doc_cnt, min_gws, buf_min_gws);
+ }
+ if (lstats)
+ {
+ count=0;
+ for (inx=0; inx<256; inx++)
+ {
+ count+=lengths[inx];
+ if (count && lengths[inx])
+ printf("%3u: %10lu %5.2f%% %20lu %4.1f%%\n", inx,
+ (ulong) lengths[inx],100.0*lengths[inx]/total,(ulong) count,
+ 100.0*count/total);
+ }
+ }
+
err:
if (error && error != HA_ERR_END_OF_FILE)
printf("got error %d\n",my_errno);
@@ -253,9 +246,6 @@
case 'l':
lstats=1;
complain(query!=0);
- break;
- case 'e':
- complain(dump || count || stats);
break;
case '?':
case 'h':
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 9
- IsNumericI am converting an ms access query to work with mysql, however I cant
seem to find a replacement for IsNumeric()
Anyone help?
Thanks
- 11
- INSERT .. SELECT syntax-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'll try to keep this short and sweet.
I'm having an issue with the insert ... select syntax. I know I
can do the following:
insert into db1.table(column) select column from
db2.table.column2 where db2.table.column1 = 'x';
which works fine. But what I also need to do is add additional
values to the INSERT portion of the statement. These values are not a
part of the select portion of the statement. I've tried the following,
to no avail:
insert into db.table1(a,b,c,d) values ('w','x', select j
from db2.table.column2 where db2.table.column1 = 'k','z');
I just want to keep it all in one insert .. select statement
instead of doing one insert .. select statement and one insert
statement for the same line of data. Any ideas?
BL.
- - --
Brad Littlejohn | Email: email***@***.com
Unix Systems Administrator, | email***@***.com
Web + NewsMaster, BOFH.. Smeghead! :) | http://www.wizard.com/~tyketto
PGP: 1024D/E319F0BF 6980 AAD6 7329 E9E6 D569 F620 C819 199A E319 F0BF
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFFscSQyBkZmuMZ8L8RAgWGAJ4rh7+Ycxo2FJEVcCb0Q9MWW0v2BACfY8x8
c+qoQacwTAD9OZ4mSkd9Gbo=
=+1fG
-----END PGP SIGNATURE-----
- 13
- Scribe Report Generator for MySQL and other RDBMS - beta testers neededHello everyone,
We are looking for beta-testers for our new product - Scribe Report
Generator. At this moment, Scribe supports 6 relational databases, including
Oracle, MS SQL Server 2000, and Sybase.
Very briefly: Scribe is written in Java, is based on visual programming and
can be extended by adding user-written Java classes; it comes with the API
library to let other Java-based apps run Scribe reports programmatically.
The details are on our website: www.gestalt.com/Scribe (temporary location).
User: guest
Password: star
We offer a free license to everyone who provides us with a feedback on bugs,
inconsistencies, or constructive criticism that helps us refine Scribe.
Please respond to: scribe<at>gestalt<dot>com
Regards,
Alex Molochnikov
Gestalt Corporation
- 13
- mysql query modificationSELECT table1.url FROM table1, table2 WHERE table1.linkid=table2.id AND
table1.type='xyz' AND table2.status IN( 'Yellow') AND
table2.request='"&test&"' ORDER BY table2.time DESC"
I am getting data from 2 tables by using a join
that works but the problem is the the column in table 1 "url" has links
in it as enteries
which are actually urls to different pages.
Now this url can be of 3 types- All urls are of type 1 ,2 or 3
1) http://host1/Report/report1.htm.gz
2)http://host2/Enviroinments/2007/Reports/report7856/index.html
3)http://host1/Report/report1.html.gz
My old query returns results with all the urls
I want to modify it to return only the htm.gz or html.gz urls
Any idea how this can be done
Thanks in advance
- 16
- Amount of records in table and the idHi,
I have two tables, event and photo. Event holds all the information
for an event whilst photo holds all photos uploaded for that event.
Now I have a problem. I want to get a list of all the event.ids but I
want them ordered by the amount of photos uploaded in the other table.
The trouble here is that some events do not have photos uploaded and
though should be bottom but still be there. I have tried over and
over again but I think I have got my selfed confused. If anyone has
any ideas I would be very grateful.
Thanks
Iain
- 16
- Retrieving Specific RecordsHi,
Hopefully someone can help.
I am trying to establish (using a straight MySQL query in version 4.0.18)
the level of qualifications someone has, i.e. degree, postgraduate degree or
other.
To simplify things, I need to use only two tables, namely:
master table, containing:
staffno (Primary Key);
forename;
surname;
psnquals table, containing:
psnqualid (Primary Key);
staffno (Foreign Key);
levelid (where 1 = degree, 2 = postgraduate degree, 3 = other)
In the followning query, staffno 1 has three qualification levels, 1, 2, 3.
The query finds the first matching record (where cdelevelid = 1) and then
stops, making it appear as if the employee had no postgraduate
qualification.
One person can have one or all of the above qualifications. I need to write
a query that shows if a person has one, two or all of the above. I tried
using the following query, but it seems only to look at the first psnqualid
record it finds and then stops:
SELECT m1.staffno, m1.forename, m1.surname,
CASE WHEN p1.cdelevelid = 1 THEN "D" WHEN p1.cdelevelid = 2 THEN "P" ELSE
"O"
FROM `master` m1
INNER JOIN psnquals p1 ON m1.staffno = p1.staffno
I also tried using an IF statement, but this also seemed to stop after
finding the first matching record in the psnquals table.
Any suggestions wouls be most welcome.
Thanks,
Mark H
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.684 / Virus Database: 446 - Release Date: 13/05/2004
- 16
- Cant connect with -hlocalhostHi All
Apologies for a seriously newbie quesion, but I've been doing so many
installations and all have the same problem.
When i try to connect using mysql command line:
mysql --user=cde --password=cde --database=CDE --host=192.168.10.52
It works fine.
However, when I try to use localhost as the host name I receive an
error:
mysql --user=cde --password=cde --database=CDE --host=localhost
The user I have created is cde@% - surely this should catch all hosts?
I've also tried creating a cde@localhost user, no luck.
I dont want to hardcode the IP address in my code, so PLEASE help.
Thanks in advance!
Hein
- 16
- INSERT IMAGES INTO MYSQLHi to everyone! I'm trying to insert images into mysql but I don't
know what to do... is there anyone who can help me? Thank you!
- 16
- bk commit into 5.1 tree (tomas:1.1864)Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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.1864 05/04/13 02:26:48 email***@***.com +2 -0
added correct handling of get(Pre)Value w.r.t mysql type and hidden key
make use of record[1]
added missing handling of binlog_index and injector trans after loop exit
more share checking
sql/ha_ndbcluster.h
1.89 05/04/13 02:26:43 email***@***.com +1 -0
more share_checking
sql/ha_ndbcluster.cc
1.209 05/04/13 02:26:43 email***@***.com +138 -76
added correct handling of get(Pre)Value w.r.t mysql type and hidden key
make use of record[1]
added missing handling of binlog_index and injector trans after loop exit
more share checking
# 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: tomas
# Host: poseidon.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-wl2325
--- 1.208/sql/ha_ndbcluster.cc 2005-04-12 21:13:57 +02:00
+++ 1.209/sql/ha_ndbcluster.cc 2005-04-13 02:26:43 +02:00
@@ -103,7 +103,7 @@
static NDB_SHARE *get_share(const char *table_name,
bool create_if_not_exists= 1,
TABLE *table= 0);
-static void free_share(NDB_SHARE *share);
+static void free_share(NDB_SHARE **share);
static int packfrm(const void *data, uint len, const void **pack_data, uint *pack_len);
static int unpackfrm(const void **data, uint *len,
@@ -137,7 +137,8 @@
const char* event_name, NdbError &ndb_error);
static int ndbcluster_create_event_ops(Ndb *ndb, NDB_SHARE *share, const NDBTAB* ndbtab,
const char* event_name);
-static int replication_handle_drop_table(Ndb *ndb, const char* event_name, NDB_SHARE *share);
+static int replication_handle_drop_table(Ndb *ndb, const char* event_name,
+ NDB_SHARE **share);
inline void ndb_rep_event_name(String *event_name, const char* db, const char* tbl);
extern "C" pthread_handler_decl(ndb_injector_thread_func, arg);
@@ -3881,7 +3882,7 @@
share->use_count > 2))
{
// we have a share since before, no need for us to keep it open
- free_share(share);
+ free_share(&share);
}
}
#endif
@@ -4178,8 +4179,8 @@
if (wait_for_drop == 0)
{
DBUG_ASSERT(old_share->no_use_count_check || old_share->use_count == 2);
- free_share(old_share);
- free_share(old_share);
+ free_share(&old_share);
+ free_share(&old_share);
old_share=0;
}
}
@@ -4230,7 +4231,7 @@
String event_name(INJECTOR_EVENT_LEN);
ndb_rep_event_name(&event_name,old_share_key+sizeof(share_prefix)-1,0);
- replication_handle_drop_table(ndb, event_name.c_ptr(), old_share);
+ replication_handle_drop_table(ndb, event_name.c_ptr(), &old_share);
}
#endif
@@ -4270,7 +4271,6 @@
{
DBUG_ENTER("ha_ndbcluster::delete_table");
DBUG_PRINT("enter", ("name: %s", name));
- NDB_SHARE *share= 0;
set_dbname(name);
set_tabname(name);
@@ -4281,6 +4281,7 @@
handler::delete_table(name);
#ifdef HAVE_REPLICATION
+ NDB_SHARE *share= 0;
if (ndb_injector_thread_running > 0)
{
share= get_share(name,false);
@@ -4293,7 +4294,7 @@
{
#ifdef HAVE_REPLICATION
if (share)
- free_share(share);
+ free_share(&share);
#endif
DBUG_RETURN(r);
}
@@ -4302,8 +4303,8 @@
if ( share && !share->op )
{
DBUG_ASSERT(share->no_use_count_check || share->use_count == 2);
- free_share(share);
- free_share(share);
+ free_share(&share);
+ free_share(&share);
share= 0;
}
@@ -4316,18 +4317,24 @@
{
ndb->getDictionary()->forceGCPWait();
}
- replication_handle_drop_table(ndb,event_name.c_ptr(),share);
- share= 0;
+ replication_handle_drop_table(ndb,event_name.c_ptr(),&share);
}
- DBUG_ASSERT(share == 0);
-#endif
-
// make sure we don't have a share left
- while (share= get_share(name,false))
+ if (share != 0)
{
- sql_print_error("NDB: removing trailing share for %s.", name);
- free_share(share);
+ pthread_mutex_lock(&ndbcluster_mutex);
+ if (share->use_count > 1 || !share->util_lock)
+ {
+ sql_print_error("NDB: removing trailing share (use_count: %d) for %s.",
+ share->use_count-(share->util_lock != 0), name);
+ share->use_count= share->util_lock ? 2 : 1;
+ pthread_mutex_unlock(&ndbcluster_mutex);
+ free_share(&share);
+ }
+ else
+ pthread_mutex_unlock(&ndbcluster_mutex);
}
+#endif
DBUG_RETURN(0);
}
@@ -4459,7 +4466,7 @@
DBUG_ENTER("~ha_ndbcluster");
if (m_share)
- free_share(m_share);
+ free_share(&m_share);
release_metadata();
my_free(m_blobs_buffer, MYF(MY_ALLOW_ZERO_PTR));
m_blobs_buffer= 0;
@@ -4520,7 +4527,7 @@
set_tabname(name);
if (check_ndb_connection()) {
- free_share(m_share); m_share= 0;
+ free_share(&m_share); m_share= 0;
DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
@@ -4540,7 +4547,7 @@
int ha_ndbcluster::close(void)
{
DBUG_ENTER("close");
- free_share(m_share); m_share= 0;
+ free_share(&m_share); m_share= 0;
release_metadata();
DBUG_RETURN(0);
}
@@ -5236,7 +5243,7 @@
DBUG_PRINT("info", ("Getting commit_count: %llu from share",
share->commit_count));
pthread_mutex_unlock(&share->mutex);
- free_share(share);
+ free_share(&share);
DBUG_RETURN(0);
}
}
@@ -5251,7 +5258,7 @@
struct Ndb_statistics stat;
if (ndb_get_table_statistics(ndb, tabname, &stat))
{
- free_share(share);
+ free_share(&share);
DBUG_RETURN(1);
}
@@ -5268,7 +5275,7 @@
*commit_count= 0;
}
pthread_mutex_unlock(&share->mutex);
- free_share(share);
+ free_share(&share);
DBUG_RETURN(0);
}
@@ -5564,21 +5571,25 @@
}
-static void free_share(NDB_SHARE *share)
+static void free_share(NDB_SHARE **share)
{
pthread_mutex_lock(&ndbcluster_mutex);
DBUG_PRINT("free_share",
("key: %s, key_length: %d, db: %s, table_name: %s, "
"use_count: %d, commit_count: %d",
- share->key, share->key_length, share->db, share->table_name,
- share->use_count-1, share->commit_count));
- if (!--share->use_count)
- {
- hash_delete(&ndbcluster_open_tables, (byte*) share);
- thr_lock_delete(&share->lock);
- pthread_mutex_destroy(&share->mutex);
- free_root(&share->mem_root, MYF(0));
- my_free((gptr) share, MYF(0));
+ (*share)->key, (*share)->key_length, (*share)->db, (*share)->table_name,
+ (*share)->use_count-1, (*share)->commit_count));
+ if ((*share)->util_lock == current_thd)
+ (*share)->util_lock= 0;
+
+ if (!--(*share)->use_count)
+ {
+ hash_delete(&ndbcluster_open_tables, (byte*) *share);
+ thr_lock_delete(&(*share)->lock);
+ pthread_mutex_destroy(&(*share)->mutex);
+ free_root(&(*share)->mem_root, MYF(0));
+ my_free((gptr) *share, MYF(0));
+ *share= 0;
}
pthread_mutex_unlock(&ndbcluster_mutex);
}
@@ -6235,10 +6246,14 @@
for (uint i= 0; i < ndbcluster_open_tables.records; i++)
{
share= (NDB_SHARE *)hash_element(&ndbcluster_open_tables, i);
+ share->util_lock=current_thd; /* Mark that util thread has lock */
+#ifndef DBUG_OFF
+ share->no_use_count_check= 1;
+#endif
share->use_count++; /* Make sure the table can't be closed */
DBUG_PRINT("ndb_util_thread",
- ("Found open table[%d]: %s, use_count: %d",
- i, share->key, share->use_count));
+ ("Found open table[%d]: %s, use_count: %d",
+ i, share->key, share->use_count));
/* Store pointer to table */
util_open_tables.push_back(share);
@@ -6282,7 +6297,7 @@
pthread_mutex_unlock(&share->mutex);
/* Decrease the use count and possibly free share */
- free_share(share);
+ free_share(&share);
}
/* Clear the list of open tables */
@@ -7604,6 +7619,14 @@
DBUG_RETURN(0);
}
+inline int is_ndb_compatible_type(Field *field)
+{
+ return
+ !(field->flags & BLOB_FLAG) &&
+ field->type() != MYSQL_TYPE_BIT &&
+ field->pack_length() != 0;
+}
+
static int
ndbcluster_create_event_ops(Ndb *ndb, NDB_SHARE *share, const NDBTAB *ndbtab,
const char* event_name)
@@ -7647,8 +7670,29 @@
for (int j= 0; j < n_columns; j++)
{
const char *col_name= ndbtab->getColumn(j)->getName();
- op->getValue(col_name,share->table->field[j]->ptr);
- op->getPreValue(col_name);
+ if ( j < n_fields )
+ {
+ Field *f= share->table->field[j];
+ if (is_ndb_compatible_type(f))
+ {
+ DBUG_PRINT("info",("%s compatible",col_name));
+ op->getValue(col_name,f->ptr);
+ op->getPreValue(col_name,(f->ptr-share->table->record[0])+
+ share->table->record[1]);
+ }
+ else
+ {
+ DBUG_PRINT("info",("%s non compatible",col_name));
+ op->getValue(col_name);
+ op->getPreValue(col_name);
+ }
+ }
+ else
+ {
+ DBUG_PRINT("info",("%s hidden key",col_name));
+ op->getValue(col_name);
+ op->getPreValue(col_name);
+ }
}
if (op->execute())
@@ -7667,7 +7711,8 @@
DBUG_ASSERT(share->no_use_count_check || share->use_count == 1);
share->op= op; // assign op in NDB_SHARE
- DBUG_PRINT("info",("%s share->op: %x, share->use_count: %u", share->key, share->op, share->use_count));
+ DBUG_PRINT("info",("%s share->op: %x, share->use_count: %u",
+ share->key, share->op, share->use_count));
sql_print_information("NDB Replication: replicating %s.", event_name);
DBUG_RETURN(0);
@@ -7679,21 +7724,22 @@
* (unless it has already dropped... then share->op == 0)
*/
static int
-replication_handle_drop_table(Ndb *ndb, const char *event_name, NDB_SHARE *share)
+replication_handle_drop_table(Ndb *ndb, const char *event_name, NDB_SHARE **share)
{
DBUG_ENTER("replication_handle_drop_table");
- if ( ndb_injector_thread_running > 0 && share == 0)
+ if ( ndb_injector_thread_running > 0 && *share == 0)
{
- sql_print_error("NDB delete table: share does not exist for %s. Ignoring...", event_name);
+ sql_print_error("NDB delete table: share does not exist for %s. Ignoring...",
+ event_name);
}
NdbError ndb_error;
if ( ndbcluster_drop_event(ndb,0/* ToDo */,event_name, ndb_error) < 0 )
{
/* ToDo; handle error? */
- if (share && share->op &&
- share->op->getState() == NdbEventOperation::EO_EXECUTING &&
+ if (*share && (*share)->op &&
+ (*share)->op->getState() == NdbEventOperation::EO_EXECUTING &&
ndb_error.code != 4009)
{
DBUG_ASSERT(false);
@@ -7702,26 +7748,26 @@
DBUG_RETURN(0);
}
- if (share == 0)
+ if (*share == 0)
{
DBUG_RETURN(0);
}
int max_timeout= 10;
- (void) pthread_mutex_lock(&share->mutex);
- while (share->op && max_timeout)
+ (void) pthread_mutex_lock(&(*share)->mutex);
+ while ((*share)->op && max_timeout)
{
- DBUG_ASSERT(share->no_use_count_check || share->use_count == 2);
+ DBUG_ASSERT((*share)->no_use_count_check || (*share)->use_count == 2);
struct timespec abstime;
set_timespec(abstime, 1);
sql_print_information("NDB delete table: waiting max %u sec for drop table %s.",
- max_timeout, share->key);
+ max_timeout, (*share)->key);
(void) pthread_cond_timedwait(&injector_cond,
- &share->mutex,
+ &(*share)->mutex,
&abstime);
max_timeout--;
}
- (void) pthread_mutex_unlock(&share->mutex);
+ (void) pthread_mutex_unlock(&(*share)->mutex);
free_share(share);
if (max_timeout == 0)
{
@@ -7769,7 +7815,7 @@
(void) pthread_cond_signal(&injector_cond);
// release previous lock
- free_share(share);
+ free_share(&share);
}
else
{
@@ -7791,14 +7837,15 @@
share->op= 0;
// either just us or drop table handling as well
- DBUG_ASSERT(share->no_use_count_check || share->use_count == 1 || share->use_count == 2);
+ DBUG_ASSERT(share->no_use_count_check ||
+ share->use_count == 1 || share->use_count == 2);
// Signal ha_ndbcluster::delete_table that drop is done
(void) pthread_mutex_unlock(&share->mutex);
(void) pthread_cond_signal(&injector_cond);
// release previous lock
- free_share(share);
+ free_share(&share);
}
else
{
@@ -7824,6 +7871,7 @@
* Injector thread main loop
*/
+//#define DISABLE_INJECTOR
extern "C" pthread_handler_decl(ndb_injector_thread_func,
arg __attribute__((unused)))
{
@@ -7832,9 +7880,7 @@
Ndb *ndb= 0;
Uint64 gci= 0;
Uint64 last_gci_in_binlog_index= 0;
-#ifndef DISABLE_INJECTOR
injector *inj= injector::instance();
-#endif
pthread_mutex_lock(&injector_startup_mutex);
/*
@@ -7930,9 +7976,7 @@
{
Binlog_index_row row;
bzero((char*) &row,sizeof(row));
-#ifndef DISABLE_INJECTOR
injector::transaction trans= inj->new_trans(thd);
-#endif
error= 0;
NdbEventOperation *pOp;
@@ -7968,27 +8012,27 @@
#endif
}
- if (gci == 0)
- gci= pOp->getGCI();
-
DBUG_PRINT("info",("CURRENT GCI: %llu %llu",gci, pOp->getGCI()));
if (gci != pOp->getGCI())
{
- row.gci= gci;
- row.master_log_file= trans.start_pos().file_name();
- row.master_log_pos= trans.start_pos().file_pos();
+ if (row.n_inserts || row.n_updates || row.n_deletes || row.n_schemaops)
+ {
+ row.gci= gci;
+ row.master_log_file= trans.start_pos().file_name();
+ row.master_log_pos= trans.start_pos().file_pos();
- /**
- * Commit transaction, start a new one
- * FIXME: HANDLE ERRORS! Commit can fail!
- */
- int r= trans.commit();
- DBUG_PRINT("info",("COMMIT gci %lld r: %d",gci,r));
- add_binlog_index(thd, &row);
- bzero((char*) &row,sizeof(row));
- last_gci_in_binlog_index= gci;
+ /**
+ * Commit transaction, start a new one
+ * FIXME: HANDLE ERRORS! Commit can fail!
+ */
+ int r= trans.commit();
+ DBUG_PRINT("info",("COMMIT gci %lld r: %d",gci,r));
+ add_binlog_index(thd, &row);
+ bzero((char*) &row,sizeof(row));
+ last_gci_in_binlog_index= gci;
- trans= inj->new_trans(thd);
+ trans= inj->new_trans(thd);
+ }
gci= pOp->getGCI();
}
@@ -8042,7 +8086,25 @@
// We should REALLY never get here.
break;
}
- } // while
+ } // while nextEvent
+ if (row.n_inserts || row.n_updates || row.n_deletes || row.n_schemaops)
+ {
+ row.gci= gci;
+ row.master_log_file= trans.start_pos().file_name();
+ row.master_log_pos= trans.start_pos().file_pos();
+
+ /**
+ * Commit transaction, start a new one
+ * FIXME: HANDLE ERRORS! Commit can fail!
+ */
+ int r= trans.commit();
+ DBUG_PRINT("info",("COMMIT gci %lld r: %d",gci,r));
+ add_binlog_index(thd, &row);
+ bzero((char*) &row,sizeof(row));
+ last_gci_in_binlog_index= gci;
+ }
+ else
+ trans.commit();
} // if
} // for(;;)
}
--- 1.88/sql/ha_ndbcluster.h 2005-04-12 21:08:32 +02:00
+++ 1.89/sql/ha_ndbcluster.h 2005-04-13 02:26:43 +02:00
@@ -64,6 +64,7 @@
pthread_mutex_t mutex;
char *key;
uint key_length;
+ THD *util_lock;
uint use_count;
uint commit_count_lock;
ulonglong commit_count;
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
|
| Author |
Message |
KPenner

|
Posted: 2004-12-3 5:33:56 |
Top |
mysql, Newline character in TEXT field.
I am trying to read in a text file and save it to a TEXT field in a MySQL database using perl 5.8. (DBI::MySQL). The file has CRLFs in it but when it is saved to the database is only has LFs.
I read in the file like this:
# Open input file of data
open( FILEIN, "$directory\\$fname" ) || die "can't open $fname $!";
undef $/;
$text = <FILEIN>;
close FILEIN;
My SQL statement is:
my $sth2 = $dbh->prepare( "Insert into reports
(type, ext, date, text, name, clientspec)
Values ( ?, ?, ?, ?, ?, ? )" );
and my execute statement is:
$sth3->execute( $type, $ext, $date, $text, $name, $clientspec, $name );
Is there some way to control what the newline character is when doing this?
ps. My co-worker is doing the same thing in PHP and is getting the full CRLF in the field.
Thanks,
Kevin M. Penner
Programmer
Call_Solutions
701-774-4021
"There are 10 types of people in the world,
those who know binary and those who don't."
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=email***@***.com
|
| |
|
| |
 |
| |
 |
Index ‹ mysql |
- Next
- 1
- no version information available...Hi Everyone,
I've made great progress so far.. I've been able to get my simple
programs to compile thanks to Mr. Povilaitis. Now the problem is runtime:
$ ./testmysql
./testmysql: /usr/lib/libmysqlclient.so.14: no version information
available (required by ./testmysql)
./testmysql: symbol lookup error: /usr/lib/libmysqlpp.so.2: undefined
symbol: _ZNSt24__default_alloc_templateILb1ELi0EE12_S_free_listE
I have no idea what that means, beyond the obvious... I'm on CentOS
4.1. Here's my output from rpm -qa | grep -i mysql:
mysqlclient10-3.23.58-4.RHEL4.1
MySQL-python-1.0.0-1.RHEL4.1
MySQL-shared-standard-4.1.16-1.rhel4
MySQL-shared-4.1.16-1
MySQL-server-standard-4.1.16-1.rhel4
MySQL-devel-standard-4.1.16-1.rhel4
mysql++-2.0.7-1
libdbi-dbd-mysql-0.6.5-10.RHEL4.1
perl-DBD-MySQL-2.9004-3.1
MySQL-client-standard-4.1.16-1.rhel4
I hope that's enough information to find a solution. If not, I'll be
happy to provide any further info necessary.
Cheers,
~Brian
--
----------------
Brian A. Henning
strutmasters.com
336.597.2397x238
----------------
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsub=email***@***.com
- 2
- Cannot convert value '2004-08-13 13:21:17.' from column 3 tois the format something I can control? The InnoDB engine stores
timestamps incorrectly from versions 4.1 - 4.1.3; I'm wondering if this
is the problem.
Nevertheless, the fact that Statements and PreparedStatements work just
fine indicate to me that perhaps there is a bug with
ServerPreparedStatements.
jeff
Rhino wrote:
> ----- Original Message -----
> From: "Jeff Mathis" <email***@***.com>
> To: <email***@***.com>
> Sent: Tuesday, September 21, 2004 4:10 PM
> Subject: Cannot convert value '2004-08-13 13:21:17.' from column 3 to
> TIMESTAMP.
>
>
>
>>Hello All,
>>
>>I was doing some performance comparisons, and was trying to use the
>>ServerPreparedStatements. However, I immediately got this exception:
>>.
>>.
>>.
>>Caused by: java.sql.SQLException: Cannot convert value '2004-08-13
>>13:21:17.' from column 3 to TIMESTAMP.
>> at
>>com.mysql.jdbc.ResultSet.getTimestampFromString(ResultSet.java:6034)
>> at
>>com.mysql.jdbc.ResultSet.getTimestampInternal(ResultSet.java:6059)
>> at com.mysql.jdbc.ResultSet.getTimestamp(ResultSet.java:2199)
>>.
>>.
>>.
>>
>>If I use Stements or PreparedStatements, there is no such error. anyone
>>else seen this problem?
>>
>>using Connector/J 3.1.4 with mysql server 4.1.3 on Solaris.
>>
>
> I believe that the separator between the hour components in a timestamp must
> be a period, not a colon, i.e. the String representation of your timestamp
> needs to be '2004-08-13 13.21.17' *not* '2004-08-13 13:21:17'.
>
> Rhino
>
>
--
Jeff Mathis, Ph.D. 505-955-1434
Prediction Company email***@***.com
525 Camino de los Marquez, Ste 6 http://www.predict.com
Santa Fe, NM 87505
--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/java?unsub=email***@***.com
- 3
- bk commit into 4.1 tree (kent:1.2474)Below is the list of changes that have just been committed into a local
4.1 repository of kent. When kent 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.2474 05/10/06 15:42:50 email***@***.com +1 -0
Merge
client/mysql.cc
1.214 05/10/06 15:42:45 email***@***.com +0 -1
# 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: kent
# Host: c-554072d5.010-2112-6f72651.cust.bredbandsbolaget.se
# Root: /Users/kent/mysql/bk/mysql-4.1/RESYNC
--- 1.213/client/mysql.cc 2005-09-30 13:56:13 +02:00
+++ 1.214/client/mysql.cc 2005-10-06 15:42:45 +02:00
@@ -993,7 +993,7 @@
unsigned long clen;
do
{
- line= my_cgets((char*)tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen);
+ line= my_cgets((char *) tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen);
buffer.append(line, clen);
/*
if we got buffer fully filled than there is a chance that
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 4
- Advantages in combining DB's ?
Hello All,
I am running 4 different databases each has different functionality in Linux box. If i combine all four databases into one (moving the tables into anyone of the database), will it increase the performance? will it be give any advantages?. MySQL version i am using is 4.1.1 standard. Each database has the size of around 100M.
Thanks,
Prem
- 5
- bk commit into 5.0 tree (lars:1.2030)Below is the list of changes that have just been committed into a local
5.0 repository of lthalmann. When lthalmann 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.2030 05/10/24 23:09:14 email***@***.com +1 -0
Fixed enum numbering, patch 2
sql/log_event.h
1.119 05/10/24 23:08:51 email***@***.com +21 -11
One enum value per line
Fixed a mistake
Added values to every line for strange compilers
# 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: dl145h.mysql.com
# Root: /users/lthalmann/bk/mysql-5.0-enum-logtype
--- 1.118/sql/log_event.h 2005-10-24 19:06:05 +02:00
+++ 1.119/sql/log_event.h 2005-10-24 23:08:51 +02:00
@@ -403,9 +403,17 @@
Every time you update this enum (when you add a type), you have to
fix Format_description_log_event::Format_description_log_event().
*/
- UNKNOWN_EVENT= 0, START_EVENT_V3= 1, QUERY_EVENT= 2, STOP_EVENT= 3,
- ROTATE_EVENT= 4, INTVAR_EVENT= 5, LOAD_EVENT= 6, SLAVE_EVENT= 7,
- CREATE_FILE_EVENT= 8, APPEND_BLOCK_EVENT= 9, EXEC_LOAD_EVENT= 10,
+ UNKNOWN_EVENT= 0,
+ START_EVENT_V3= 1,
+ QUERY_EVENT= 2,
+ STOP_EVENT= 3,
+ ROTATE_EVENT= 4,
+ INTVAR_EVENT= 5,
+ LOAD_EVENT= 6,
+ SLAVE_EVENT= 7,
+ CREATE_FILE_EVENT= 8,
+ APPEND_BLOCK_EVENT= 9,
+ EXEC_LOAD_EVENT= 10,
DELETE_FILE_EVENT= 11,
/*
NEW_LOAD_EVENT is like LOAD_EVENT except that it has a longer
@@ -413,18 +421,20 @@
same class (Load_log_event)
*/
NEW_LOAD_EVENT= 12,
- RAND_EVENT, USER_VAR_EVENT= 13,
- FORMAT_DESCRIPTION_EVENT= 14,
- XID_EVENT= 15,
- BEGIN_LOAD_QUERY_EVENT= 16,
- EXECUTE_LOAD_QUERY_EVENT= 17,
+ RAND_EVENT= 13,
+ USER_VAR_EVENT= 14,
+ FORMAT_DESCRIPTION_EVENT= 15,
+ XID_EVENT= 16,
+ BEGIN_LOAD_QUERY_EVENT= 17,
+ EXECUTE_LOAD_QUERY_EVENT= 18,
/*
- add new events here - right above this comment!
- existing events should never change their numbers
+ Add new events here - right above this comment!
+ And change the ENUM_END_EVENT_MARKER below.
+ Existing events should never change their numbers
*/
- ENUM_END_EVENT /* end marker */
+ ENUM_END_EVENT= 19 /* end marker */
};
/*
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 6
- svn commit - mysqldoc@docsrva: r227 - branches/MikePluggable/trunk/refman-5.1Author: mhillyer
Date: 2005-11-03 01:01:48 +0100 (Thu, 03 Nov 2005)
New Revision: 227
Log:
Work in Progress push so Stefan can proofread.
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-02 21:49:48 UTC (rev 226)
+++ branches/MikePluggable/trunk/refman-5.1/custom-engine.xml 2005-11-03 00:01:48 UTC (rev 227)
@@ -45,8 +45,10 @@
<title>Overview</title>
- <para>The MySQL server is build in a modular fashion:</para>
-
+ <para>
+ The MySQL server is build in a modular fashion:
+ </para>
+
<figure>
<title>MySQL architecture</title>
<mediaobject>
@@ -58,22 +60,40 @@
</textobject>
</mediaobject>
</figure>
-
- <para>The storage engines manage data storage and index management
- for MySQL. The MySQL server communicates with the storage engines
- through a defined API.</para>
-
- <para>Each storage engine is an inherited class with each instance
- of the class being referred to as a <literal>handler</literal>.
+
+ <para>
+ The storage engines manage data storage and index management for
+ MySQL. The MySQL server communicates with the storage engines
+ through a defined API.
</para>
-
- <para>Handlers are instanced on the basis of one handler for each
- thread that needs to work with a specific table. For example: If
- three connections all start working with the same table, three
- handler instances will need to be created.</para>
-
-
+ <para>
+ Each storage engine is an inherited class with each instance of
+ the class being referred to as a <literal>handler</literal>.
+ </para>
+
+ <para>
+ Handlers are instanced on the basis of one handler for each thread
+ that needs to work with a specific table. For example: If three
+ connections all start working with the same table, three handler
+ instances will need to be created.
+ </para>
+
+ <para>
+ One 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.
+ </para>
+
+ <para>
+ Custom storage engines can be built in a progressive manner:
+ developers can start with 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.
+ </para>
+
</section>
<section id="custom-engine-create-files">
@@ -88,18 +108,472 @@
example engine files.
</remark>
- <para/>
+ <para>
+ The easiest way to implement a new storage engine is to begin by
+ copying and modifying the <literal>EXAMPLE</literal> storage
+ engine. The <filename>ha_example.cc</filename> and
+ <filename>ha_example.h</filename> files can be found in the
+ <filename>sql/examples/</filename> directory of the MySQL 5.1
+ source tree.
+ </para>
+ <para>
+ When copying the files, change the names from ha_example to
+ something appropriate to your storage engine such as
+ <filename>ha_foo.cc</filename> and <filename>ha_foo.h</filename>.
+ </para>
+
+ <para>
+ After you have copied and renamed the files you must replace all
+ instances of <literal>EXAMPLE</literal> and
+ <literal>example</literal> with the name of your storage engine.
+ If you are familiar with <literal>sed</literal>, these steps can
+ be done automatically:
+ </para>
+
+<programlisting>
+sed s/EXAMPLE/FOO/g ha_example.h | sed s/example/foo/g ha_foo.h
+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>
- <para/>
+ <para>
+ The <literal>handlerton</literal> (short for 'handler singleton')
+ defines the storage engine and contains function pointers to those
+ 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.
+ </para>
+ <para>
+ Here's an example from the <literal>EXAMPLE</literal> storage
+ engine:
+ </para>
+
+<programlisting>
+handlerton example_hton= {
+ "EXAMPLE",
+ SHOW_OPTION_YES,
+ "Example storage engine",
+ DB_TYPE_EXAMPLE_DB,
+ NULL, /* Initialize */
+ 0, /* slot */
+ 0, /* savepoint size. */
+ NULL, /* close_connection */
+ NULL, /* savepoint */
+ NULL, /* rollback to savepoint */
+ NULL, /* release savepoint */
+ NULL, /* commit */
+ NULL, /* rollback */
+ NULL, /* prepare */
+ NULL, /* recover */
+ NULL, /* commit_by_xid */
+ NULL, /* rollback_by_xid */
+ NULL, /* create_cursor_read_view */
+ NULL, /* set_cursor_read_view */
+ NULL, /* close_cursor_read_view */
+ example_create_handler, /* Create a new handler */
+ NULL, /* Drop a database */
+ NULL, /* Panic call */
+ NULL, /* Release temporary latches */
+ NULL, /* Update Statistics */
+ NULL, /* Start Consistent Snapshot */
+ NULL, /* Flush logs */
+ NULL, /* Show status */
+ NULL, /* Replication Report Sent Binlog */
+ HTON_CAN_RECREATE
+};
+</programlisting>
+
+ <para>
+ This is the definition of the handlerton from
+ <filename>handler.h</filename>:
+ </para>
+
+<programlisting>
+typedef struct
+ {
+ const char *name;
+ SHOW_COMP_OPTION state;
+ const char *comment;
+ enum db_type db_type;
+ bool (*init)();
+ uint slot;
+ uint savepoint_offset;
+ int (*close_connection)(THD *thd);
+ int (*savepoint_set)(THD *thd, void *sv);
+ int (*savepoint_rollback)(THD *thd, void *sv);
+ int (*savepoint_release)(THD *thd, void *sv);
+ int (*commit)(THD *thd, bool all);
+ int (*rollback)(THD *thd, bool all);
+ int (*prepare)(THD *thd, bool all);
+ int (*recover)(XID *xid_list, uint len);
+ int (*commit_by_xid)(XID *xid);
+ int (*rollback_by_xid)(XID *xid);
+ void *(*create_cursor_read_view)();
+ void (*set_cursor_read_view)(void *);
+ void (*close_cursor_read_view)(void *);
+ handler *(*create)(TABLE *table);
+ void (*drop_database)(char* path);
+ int (*panic)(enum ha_panic_function flag);
+ int (*release_temporary_latches)(THD *thd);
+ int (*update_statistics)();
+ int (*start_consistent_snapshot)(THD *thd);
+ bool (*flush_logs)();
+ bool (*show_status)(THD *thd, stat_print_fn *print, enum ha_stat_type stat);
+ int (*repl_report_sent_binlog)(THD *thd, char *log_file_name,
+ my_off_t end_offset);
+ uint32 flags;
+ } handlerton;
+</programlisting>
+
+ <para>
+ The first element in the handlerton 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
+ 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,
+ a description of the storage engine displayed when using the
+ <literal>SHOW STORAGE ENGINES</literal> command.
+ </para>
+
+ <remark>
+ [MH] TODO: BETTER GET THE RIGHT INFORMATION FOR THIS NEXT
+ PARAGRAPH. WE NEED TO KNOW THE HIGHEST VALUE A CONSTANT CAN BE AND
+ THE FILE WHERE THE CONSTANTS ARE DEFINED.
+ </remark>
+
+ <para>
+ The fourth element in the handlerton 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
+ <filename>handler.h</filename> file. As an alternative to creating
+ a constant you can use an integer that is greater than 25.
+ </para>
+
+ <para>
+ The remaining sections of the handlerton 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
+ 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,
+ 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
+ <literal><replaceable>foo</replaceable>_init()</literal> is
+ called.
+ </para>
+
+ <para>
+ The seventh element in the handlerton 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).
+ </para>
+
+ <para>
+ The savepoint offset must be initialized statically to the size of
+ 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.
+ </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
+ 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
+ value.
+ </para>
+
+ <para>
+ The ninth element in the handlerton points to an uninitialized
+ storage area of requested size (see the savepoint offset
+ description)
+ </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
+ 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
+ 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
+ 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
+ support transactions.
+ </para>
+
</section>
+ <section id="custom-engine-instancing">
+
+ <title>Handling Handler Instancing</title>
+
+ <para>
+ The first method call your storage engine needs to support is the
+ call for a new handler instance.
+ </para>
+
+ <para>
+ Before the handlerton is defined in the storage engine source
+ file, a function header for the instancing function must be
+ defined. Here is an example from the <literal>CSV</literal>
+ engine:
+ </para>
+
+<programlisting>
+static handler* tina_create_handler(TABLE *table);
+</programlisting>
+
+ <para>
+ As you can see, the function accepts a pointer to the table the
+ handler is intended to manage and returns a handler object.
+ </para>
+
+ <para>
+ After the function header is defined, the function is named with a
+ function pointer in the twenty-first handlerton element,
+ identifying the function as being responsible for generating new
+ handler instances.
+ </para>
+
+ <para>
+ Here is an example of the <literal>MyISAM</literal> storage
+ engine's instancing function:
+ </para>
+
+<programlisting>
+static handler *myisam_create_handler(TABLE *table)
+ {
+ return new ha_myisam(table);
+ }
+</programlisting>
+
+ <para>
+ This call then works in conjunction with the storage engine's
+ constructor. Here is an example from the
+ <literal>FEDERATED</literal> storage engine:
+ </para>
+
+<programlisting>
+ha_federated::ha_federated(TABLE *table_arg)
+ :handler(&federated_hton, table_arg),
+ mysql(0), stored_result(0), scan_flag(0),
+ ref_length(sizeof(MYSQL_ROW_OFFSET)), current_position(0)
+ {}
+</programlisting>
+
+ <para>
+ And from the <literal>EXAMPLE</literal> storage engine:
+ </para>
+
+<programlisting>
+ha_example::ha_example(TABLE *table_arg)
+ :handler(&example_hton, table_arg)
+ {}
+</programlisting>
+
+ <para>
+ The additional elements in the <literal>FEDERATED</literal>
+ example are extra initializations for the handler. The minimum
+ implementation required is the handler() initialization shown in
+ the <literal>EXAMPLE</literal> version.
+ </para>
+
+ </section>
+
+ <section id="custom-engine-extensions">
+
+ <title>Defining Table Extensions</title>
+
+ <para>
+ Storage engines are required to provide the MySQL server with a
+ list of extensions used by the storage engine with regards to a
+ given table, its data and indexes.
+ </para>
+
+ <para>
+ Extensions are expected in the form of a null-terminated string
+ array. The following is the array used by the
+ <literal>CSV</literal> engine:
+ </para>
+
+<programlisting>
+static const char *ha_tina_exts[] = {
+ ".CSV",
+ NullS
+};
+</programlisting>
+
+ <para>
+ This array is returned when the <link linkend="custom-engine-api-reference-bas_ext"><literal>bas_ext()</literal></link> is
+ called:
+ </para>
+
+<programlisting>
+const char **ha_tina::bas_ext() const
+{
+ return ha_tina_exts;
+}
+</programlisting>
+
+ </section>
+
+ <section id="custom-engine-create-table">
+ <title>Creating Tables</title>
+
+ <para>Once a handler is instanced, the first operation that will
+ likely be required is the creation of a table.</para>
+
+ <para>Your storage engine must implement the <link linkend="custom-engine-api-reference-create">create</link> virtual
+ function:</para>
+
+<programlisting>
+virtual int create(const char *name, TABLE *form, HA_CREATE_INFO *info)=0;
+</programlisting>
+
+ <para>This function should create all necessary files and then close
+ the table. The MySQL server will call for the table to be opened
+ later on.</para>
+
+ <para>The <literal>*name</literal> parameter is the name of the
+ table. The <literal>*form</literal> parameter is a
+ <literal>st_table</literal> structure that defines the table and
+ matches the contents of the
+ <filename><replaceable>tablename</replaceable>.frm</filename> file
+ already created by the MySQL server. It is not necessary for a
+ storage engine to modify the
+ <filename><replaceable>tablename</replaceable>.frm</filename> file
+ is most cases and there is no pre-built functionality to support
+ doing so.</para>
+
+ <para>The <literal>*info</literal> parameter is a structure
+ containing information on the <literal>CREATE TABLE</literal>
+ statement used to create the table. The structure is defined in
+ <filename>handler.h</filename> and copied here for your
+ convenience:</para>
+
+<programlisting>
+typedef struct st_ha_create_information
+ {
+ CHARSET_INFO *table_charset, *default_table_charset;
+ LEX_STRING connect_string;
+ const char *comment,*password;
+ const char *data_file_name, *index_file_name;
+ const char *alias;
+ ulonglong max_rows,min_rows;
+ ulonglong auto_increment_value;
+ ulong table_options;
+ ulong avg_row_length;
+ ulong raid_chunksize;
+ ulong used_fields;
+ SQL_LIST merge_list;
+ enum db_type db_type;
+ enum row_type row_type;
+ uint null_bits; /* NULL bits at start of record */
+ uint options; /* OR of HA_CREATE_ options */
+ uint raid_type,raid_chunks;
+ uint merge_insert_method;
+ uint extra_size; /* length of extra data segment */
+ bool table_existed; /* 1 in create if table existed */
+ bool frm_only; /* 1 if no ha_create_table() */
+ bool varchar; /* 1 if table has a VARCHAR */
+ } HA_CREATE_INFO;
+</programlisting>
+
+ <para>A basic storage engine can ignore the contents of
+ <literal>*form</literal> and <literal>*info</literal>, as all this
+ is really required is the creation and possibly the initialization
+ of the data files used by the storage engine (assuming the storage
+ engine is file-based).</para>
+
+ <para>For example, here is the implementation from the
+ <literal>CSV</literal> storage engine:</para>
+
+<programlisting>
+int ha_tina::create(const char *name, TABLE *table_arg,
+ HA_CREATE_INFO *create_info)
+ {
+ char name_buff[FN_REFLEN];
+ File create_file;
+ DBUG_ENTER("ha_tina::create");
+
+ if ((create_file= my_create(fn_format(name_buff, name, "", ".CSV",
+ MY_REPLACE_EXT|MY_UNPACK_FILENAME),0,
+ O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
+ DBUG_RETURN(-1);
+
+ my_close(create_file,MYF(0));
+
+ DBUG_RETURN(0);
+ }
+</programlisting>
+
+ <para>In the preceding example, the <literal>CSV</literal> engine
+ does not refer at all to the <literal>*table_arg</literal> or
+ <literal>*create_info</literal> parameters, but simply creates the
+ required data files, closes them, and returns.</para>
+
+ <para>The <literal>my_create</literal> and
+ <literal>my_close</literal> functions are helper functions defined
+ in <filename>src/include/my_sys.h</filename>.</para>
+ </section>
+
+ <section id="custom-engine-open-table">
+ <title>Opening a Table</title>
+
+
+ </section>
+
+
<section id="custom-engine-table-scanning">
<title>Implementing Basic Table Scanning</title>
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 7
- can I optimize this query?Hey all,
I have 2 tables:
Profiles(id).
Relationships(id,friend_id,befriender_id).
friend_id and befriender_id represent profiles ids.
I want to find all the profiles that are neither friends neither
befrienders with a given profile.
this is the query I use with profile id=1:
select * from profiles
where profiles.id not in
(SELECT profiles.id FROM profiles INNER JOIN relationships ON
profiles.id = relationships.befriender_id WHERE
(relationships.friend_id = 1 ))
and profiles.id not in
(SELECT profiles.id FROM profiles INNER JOIN relationships ON
profiles.id = relationships.friend_id WHERE
(relationships.befriender_id = 1 ));
is there a better, faster way to do so?
thanx in advance
Pat
- 8
- Multiple Tables Help NeededI'm not sure the follow multiple table query is the right way to do
what I need to do although it seems to be working:
$php_SQL = "SELECT * ".
"FROM basics, personal, photos ".
"WHERE basics.member_name = personal.member_name ".
"AND basics.member_name = photos.member_name ".
"AND basics.account_creation_date >= DATE_SUB(NOW(),
INTERVAL 30 DAY)";
I primarily need to return a resultset for all member_names (they are
index key) filtered for the last 30 days on the
basics.account_creation_date - the 30 day thing is working fine.
I need to access various other table columns (fields) and display this
data on the web page - member_name is the common key for all tables -
this all seems to be working fine as I have 8 test records and can
manually track and see that it is working - the problem is that I need
to add a 4th table and in doing so, the resultset breaks and returns
just one record - I am adding an 'online' table with a col called
is_online which is set to 'yes' if the member is online but the
following query returns just the one record of the online member:
$php_SQL = "SELECT * ".
"FROM basics, personal, photos, online ".
"WHERE basics.member_name = personal.member_name ".
"AND basics.member_name = photos.member_name ".
"AND basics.member_name = online.member_name ".
"AND basics.account_creation_date >= DATE_SUB(NOW(),
INTERVAL 30 DAY)";
It seems to me this should be an easy thing to just add the 4th table
but since this breaks the query now I'm wondering if this query
structure is even built right?
Any help would be greatly appreciated...
- 9
- bk commit into 5.0 tree (jimw:1.1799)Below 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.1799 05/03/11 12:46:11 email***@***.com +1 -0
Merge mysql.com:/home/jimw/my/mysql-5.0-8902
into mysql.com:/home/jimw/my/mysql-5.0-clean
sql/mysql_priv.h
1.273 05/03/11 12:46:11 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: jimw
# Host: rama.(none)
# Root: /home/jimw/my/mysql-5.0-clean/RESYNC
--- 1.272/sql/mysql_priv.h 2005-03-08 10:52:59 -08:00
+++ 1.273/sql/mysql_priv.h 2005-03-11 12:46:11 -08:00
@@ -299,6 +299,10 @@
use strictly more than 64 bits by adding one more define above, you should
contact the replication team because the replication code should then be
updated (to store more bytes on disk).
+
+ NOTE: When adding new SQL_MODE types, make sure to also add them to
+ ../scripts/mysql_create_system_tables.sh and
+ ../scripts/mysql_fix_privilege_tables.sql
*/
#define RAID_BLOCK_SIZE 1024
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 10
- bk commit into 5.0 tree (andrey:1.1905) BUG#10362Below is the list of changes that have just been committed into a local
5.0 repository of andrey. When andrey 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.1905 05/08/27 12:29:36 andrey@lmy004. +4 -0
retest the fix for bug #10362 (SHOW PROCEDURE always qualifies name with database)
(already approved)
sql/sp.cc
1.91 05/08/27 12:29:30 andrey@lmy004. +0 -2
don qualify the name
mysql-test/r/sql_mode.result
1.25 05/08/27 12:29:29 andrey@lmy004. +4 -4
update test results
mysql-test/r/sp.result
1.148 05/08/27 12:29:29 andrey@lmy004. +10 -10
update test results
mysql-test/r/information_schema.result
1.78 05/08/27 12:29:29 andrey@lmy004. +2 -2
update test 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: andrey
# Host: lmy004.
# Root: /work/mysql-5.0-ready1
--- 1.77/mysql-test/r/information_schema.result 2005-08-25 11:03:13 +02:00
+++ 1.78/mysql-test/r/information_schema.result 2005-08-27 12:29:29 +02:00
@@ -308,7 +308,7 @@
sub1
show create function sub2;
Function sql_mode Create Function
-sub2 CREATE FUNCTION `test`.`sub2`(i int) RETURNS int(11)
+sub2 CREATE FUNCTION `sub2`(i int) RETURNS int(11)
return i+1
show function status like "sub2";
Db Name Type Definer Modified Created Security_type Comment
@@ -316,7 +316,7 @@
drop function sub2;
show create procedure sel2;
Procedure sql_mode Create Procedure
-sel2 CREATE PROCEDURE `test`.`sel2`()
+sel2 CREATE PROCEDURE `sel2`()
begin
select * from t1;
select * from t2;
--- 1.24/mysql-test/r/sql_mode.result 2005-07-07 18:49:06 +02:00
+++ 1.25/mysql-test/r/sql_mode.result 2005-08-27 12:29:29 +02:00
@@ -424,23 +424,23 @@
create function `foo` () returns int return 5;
show create function `foo`;
Function sql_mode Create Function
-foo CREATE FUNCTION `test`.`foo`() RETURNS int(11)
+foo CREATE FUNCTION `foo`() RETURNS int(11)
return 5
SET @@SQL_MODE='ANSI_QUOTES';
show create function `foo`;
Function sql_mode Create Function
-foo CREATE FUNCTION `test`.`foo`() RETURNS int(11)
+foo CREATE FUNCTION `foo`() RETURNS int(11)
return 5
drop function `foo`;
create function `foo` () returns int return 5;
show create function `foo`;
Function sql_mode Create Function
-foo ANSI_QUOTES CREATE FUNCTION "test"."foo"() RETURNS int(11)
+foo ANSI_QUOTES CREATE FUNCTION "foo"() RETURNS int(11)
return 5
SET @@SQL_MODE='';
show create function `foo`;
Function sql_mode Create Function
-foo ANSI_QUOTES CREATE FUNCTION "test"."foo"() RETURNS int(11)
+foo ANSI_QUOTES CREATE FUNCTION "foo"() RETURNS int(11)
return 5
drop function `foo`;
SET @@SQL_MODE='';
--- 1.147/mysql-test/r/sp.result 2005-08-27 08:25:47 +02:00
+++ 1.148/mysql-test/r/sp.result 2005-08-27 12:29:29 +02:00
@@ -788,7 +788,7 @@
insert into t1 values ("chistics", 1)|
show create procedure chistics|
Procedure sql_mode Create Procedure
-chistics CREATE PROCEDURE `test`.`chistics`()
+chistics CREATE PROCEDURE `chistics`()
MODIFIES SQL DATA
COMMENT 'Characteristics procedure test'
insert into t1 values ("chistics", 1)
@@ -800,7 +800,7 @@
alter procedure chistics sql security invoker|
show create procedure chistics|
Procedure sql_mode Create Procedure
-chistics CREATE PROCEDURE `test`.`chistics`()
+chistics CREATE PROCEDURE `chistics`()
MODIFIES SQL DATA
SQL SECURITY INVOKER
COMMENT 'Characteristics procedure test'
@@ -815,7 +815,7 @@
return 42|
show create function chistics|
Function sql_mode Create Function
-chistics CREATE FUNCTION `test`.`chistics`() RETURNS int(11)
+chistics CREATE FUNCTION `chistics`() RETURNS int(11)
DETERMINISTIC
SQL SECURITY INVOKER
COMMENT 'Characteristics procedure test'
@@ -828,7 +828,7 @@
comment 'Characteristics function test'|
show create function chistics|
Function sql_mode Create Function
-chistics CREATE FUNCTION `test`.`chistics`() RETURNS int(11)
+chistics CREATE FUNCTION `chistics`() RETURNS int(11)
NO SQL
DETERMINISTIC
SQL SECURITY INVOKER
@@ -1210,7 +1210,7 @@
end|
show create procedure opp|
Procedure sql_mode Create Procedure
-opp CREATE PROCEDURE `test`.`opp`(n bigint unsigned, out pp bool)
+opp CREATE PROCEDURE `opp`(n bigint unsigned, out pp bool)
begin
declare r double;
declare b, s bigint unsigned default 0;
@@ -1263,7 +1263,7 @@
alter procedure bar|
show create procedure bar|
Procedure sql_mode Create Procedure
-bar CREATE PROCEDURE `test`.`bar`(x char(16), y int)
+bar CREATE PROCEDURE `bar`(x char(16), y int)
COMMENT '3333333333'
insert into test.t1 values (x, y)
show procedure status like 'bar'|
@@ -1821,20 +1821,20 @@
set @@sql_mode = ''|
show create procedure bug2564_1|
Procedure sql_mode Create Procedure
-bug2564_1 CREATE PROCEDURE `test`.`bug2564_1`()
+bug2564_1 CREATE PROCEDURE `bug2564_1`()
COMMENT 'Joe''s procedure'
insert into `t1` values ("foo", 1)
show create procedure bug2564_2|
Procedure sql_mode Create Procedure
-bug2564_2 ANSI_QUOTES CREATE PROCEDURE "test"."bug2564_2"()
+bug2564_2 ANSI_QUOTES CREATE PROCEDURE "bug2564_2"()
insert into "t1" values ('foo', 1)
show create function bug2564_3|
Function sql_mode Create Function
-bug2564_3 CREATE FUNCTION `test`.`bug2564_3`(x int, y int) RETURNS int(11)
+bug2564_3 CREATE FUNCTION `bug2564_3`(x int, y int) RETURNS int(11)
return x || y
show create function bug2564_4|
Function sql_mode Create Function
-bug2564_4 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI CREATE FUNCTION "test"."bug2564_4"(x int, y int) RETURNS int(11)
+bug2564_4 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI CREATE FUNCTION "bug2564_4"(x int, y int) RETURNS int(11)
return x || y
drop procedure bug2564_1|
drop procedure bug2564_2|
--- 1.90/sql/sp.cc 2005-08-15 21:39:32 +02:00
+++ 1.91/sql/sp.cc 2005-08-27 12:29:30 +02:00
@@ -1532,8 +1532,6 @@
buf->append("FUNCTION ", 9);
else
buf->append("PROCEDURE ", 10);
- append_identifier(thd, buf, name->m_db.str, name->m_db.length);
- buf->append('.');
append_identifier(thd, buf, name->m_name.str, name->m_name.length);
buf->append('(');
buf->append(params, paramslen);
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 11
- bk commit into 5.0-hp tree (vtkachenko:1.1920)Below is the list of changes that have just been committed into a local
5.0-hp repository of vtkachenko. When vtkachenko 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.1920 05/09/08 16:22:04 email***@***.com +1 -0
srv0srv.c:
Fix bug
innobase/srv/srv0srv.c
1.96 05/09/08 16:21:26 email***@***.com +0 -1
Fix bug
# 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: vtkachenko
# Host: melody.mysql.com
# Root: /users/vtkachenko/bk/HP/mysql-5.0-hp
--- 1.95/innobase/srv/srv0srv.c 2005-08-25 08:54:56 +02:00
+++ 1.96/innobase/srv/srv0srv.c 2005-09-08 16:21:26 +02:00
@@ -261,7 +261,6 @@
computer. Bigger computers need bigger values. */
ulong srv_thread_concurrency = SRV_CONCURRENCY_THRESHOLD;
-ulong srv_commit_concurrency = 0;
ulong srv_commit_concurrency = 0;
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 12
- Help with join, deleteI am not a sql person and could use some help with a delete...here is
what I want:
I have the following tables/fields (only including necessary fields)
answers
result_id
results
result_id
points
I want to delete the records for result_id from both tables when
points in the results table <50
Thanks in advance for any assistance.
Mike
- 13
- large database question: mysql large read queryIf I want to retrieve large number of records(1 million) from a table
from a big table, what kind of problem would I run into?
Would mysql connection time out? How would the network latency play a
role? For example, I have mysql on another machine1 and application
is running on same network, but on different machine2.
I need someone who has worked on large database and performed such
large simple read sql query to a large table, no joins.
Can someone help?
thanks,
joe
- 14
- Release works, Debug (still) crashes on OS X Leopard, Xcode 3.0 (Part 2)Below is the rest of it...
5) The simple main function
6) gdb run with backtrace
5) Code:
#include <iostream>
#include <string>
#include <mysql++.h>
using namespace std;
using namespace mysqlpp;
int main (int argc, char * const argv[])
{
string database_name = "tac_db_rev_4";
string ip_address = "X.X.X.X";
string username = "admin";
string password = "admin";
string client_id = "graham";
string client_pw = "reitz";
string error_msg;
cout << "Attempting to connect to the database...";
Connection m_connection(database_name.c_str(),
ip_address.c_str(),
username.c_str(),
password.c_str(),
3306,
false,
15);
Result client_id_result;
try
{
cout << "connected to the database\n";
Query client_id_query = m_connection.query();
client_id_query <<
"select client_id from clients where client_user_name ="
<< quote_only << client_id << " and client_password ="
<< quote_only << client_pw;
cout << "Query created: " << client_id_query.preview() << endl;
client_id_result = client_id_query.store();
if (client_id_result)
{
cout << "Result received = " << client_id_result.rows()
<< endl;
Row client_id_row;
Row::size_type i = 0;
client_id_row = client_id_result.at(i);
}
Row client_id_row;
// The "=" versus "==" syntax is more mysqlpp bs
if (client_id_row = client_id_result.at(0))
{
cout << client_id_row.at(0) << endl;
return client_id_row.at(0);
}
}
catch (exception &e)
{
cout << "exception occurred...";
cout << e.what() << endl;
}
catch (...)
{
error_msg = "Unknown exception";
cout << error_msg << endl;
}
m_connection.close();
return 0;
}
6) gdb run with backtrace
(gdb) run
Starting program: /Users/grahamreitz/Development/Projects/tac/build/
Debug/tac
Reading symbols for shared libraries ++++++... done
Attempting to connect to the database...connected to the database
Query created: select client_id from clients where client_user_name
='graham' and client_password ='reitz'
Result received = 1
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/bits/
stl_algobase.h:382:
error: function requires a valid iterator range [__first, __last).
Objects involved in the operation:
iterator "__first" @ 0x0xbfffee50 {
type = N10__gnu_norm19_Bit_const_iteratorE;
}
iterator "__last" @ 0x0xbfffee58 {
type = N10__gnu_norm19_Bit_const_iteratorE;
}
Program received signal SIGABRT, Aborted.
0x9264e47a in __kill ()
(gdb) backtrace
#0 0x9264e47a in __kill ()
#1 0x9264e46d in kill$UNIX2003 ()
#2 0x926c5782 in raise ()
#3 0x926d4d3f in abort ()
#4 0x92b476f9 in __gnu_debug::_Error_formatter::_M_error ()
#5 0x00005bdb in std::copy<__gnu_norm::_Bit_const_iterator,
__gnu_norm::_Bit_iterator> (__first={<__gnu_norm::_Bit_iterator_base>
= {<> = {<No data fields>}, _M_p = 0x700bc4, _M_offset = 3221222728},
<No data fields>}, __last={<__gnu_norm::_Bit_iterator_base> = {<> =
{<No data fields>}, _M_p = 0xbffff601, _M_offset = 2413828210}, <No
data fields>}, __result={<__gnu_norm::_Bit_iterator_base> = {<> = {<No
data fields>}, _M_p = 0x1000000, _M_offset = 0}, <No data fields>}) at
stl_algobase.h:382
#6 0x00005cd6 in __gnu_norm::vector<bool, std::allocator<bool>
> ::operator= (this=0xbffff4c8, __x=@0xbffff5f0) at stl_bvector.h:709
#7 0x00005d3a in __gnu_debug_def::vector<bool, std::allocator<bool>
> ::operator= (this=0xbffff4c8, __x=@0xbffff5f0) at debug/vector:100
#8 0x00006eb4 in mysqlpp::Row::operator= (this=0xbffff4a0) at row.h:54
#9 0x00001ef9 in main (argc=1, argv=0xbffff6f0) at /Users/grahamreitz/
Development/Projects/tac/main.cpp:51
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsub=email***@***.com
- 15
- Long old UPDATE statementI have the following SQL which gives me the row Im after
SELECT *
FROM staff, staffemails
WHERE staff.users_username='$user'
and staff.staff_id = staffemails.staff_id
thing is I now want to perform an update on the result of this query. Ive tried
UPDATE staffemails
SET is_registered ='0'
WHERE staff.users_username = '$user'
and staffemails.staff_id = staff.staff_id
But that doesnt work!
Any ideas????
|
|
|