Мысли   Галерея   Проекты   Тексты  
  Мысли   Галерея   Проекты   Тексты  
Giver: BinData в MongoDB  (2012-03-26 10:00:49)

Удивительное дело обнаружилось при работе с MongoDB. При вставке бинарных данных и попытке их отсортировать получался совершенно рандомный порядок. Что же делать, пришлось открыть исходный код и удивиться:

   case BinData: {
            int lsz = l.objsize(); // our bin data size in bytes, not including the subtype byte
            int rsz = r.objsize();
            if ( lsz - rsz != 0 ) return lsz - rsz;
            return memcmp(l.value()+4, r.value()+4, lsz+1);

То есть записи сортируются сначала по размеру, а только потом по содержанию, и набор данных [11,2,333] будет отсортирован как [2,11,333]. Так что монго сортирует любые наборы бинарных данных как числа, а не как строки и нет никакого способа поменять это поведение. Так и живем, приходится выравнивать все бинарные записи по одной длине.

dobson от 2020-10-08 16:23:22:
u1ApQk http://pills2sale.com/ cheap viagra
Isaac от 2020-10-16 16:58:32:
Go travelling what is isosorbide mononitrate er Samsung said it was "disappointed" at the lifting of theban. "The ITC's decision correctly recognized that Samsung hasbeen negotiating in good faith and that Apple remains unwillingto take a license," it said in a statement.
Newton от 2020-10-16 16:58:32:
I support Manchester United paxil withdrawal upset stomach * With a possible default on government obligations justdays away, Senate Democratic leaders - believing they have apolitical advantage in the continuing fiscal impasse - refusedSunday to sign on to any deal that reopens the government butlocks in budget cuts for next year. ()
Getjoy от 2020-10-16 16:58:33:
I'm doing a masters in law triamterene hctz and weight loss President Barack Obama and congressional Republican leadersinched toward resolving the standoff on Friday, but struggled toagree on a short-term deal to increase U.S. borrowing authoritybeyond an Oct. 17 limit and to reopen the government.
Linwood от 2020-10-16 16:58:33:
I'm on work experience que es priligy y para que sirve On Sunday, he saw some flashes and called the experience “surreal.” With all the talk today about concussions in the NFL, it made Amukamara ask teammates how they felt after enduring one. “It just makes you want to learn about it more once you’ve experienced one,” he said. “Everyone said it looked like I caught the Holy Ghost because my arms were out and stuff. It is definitely a scary feeling, especially for my mom. I had to call her and tell her everything was OK.”
Isabelle от 2020-10-16 16:58:33:
Have you got any ? viagra cost per pill canada About 30 gay and bisexual men showed up at the New York Blood Center on Manhattan's Upper East Side on Friday. New York volunteer point person Sam Gavzy, 26, told the Daily News that he spoke to the center ahead of time to explain that they weren't there to disrupt anything.
Benedict от 2020-10-16 17:17:03:
Can you put it on the scales, please? finasterida 5mg ou 1mg queda de cabelo “It’s real big; it wins the game,” Girardi said. “We’ve talked about how we have to win close games and we need that timely hitting. We went through some struggles, but we got it tonight and that was the difference.”
Jayson от 2020-10-16 17:17:03:
Not in at the moment where to get diflucan over the counter A: Probably the mental aspect, picking up those responsibilities of calling out the Mike (Linebacker) and making the majority of the calls.  At guard you are more so listening to the call from the center.
Wilton от 2020-10-16 17:17:03:
I came here to study geodon reviews for bipolar disorder It was designed to empower civilians to act as "the eyes and ears of law enforcement" without taking matters into their own hands, said John Thompson, who directs the initiative. The association's 37-page manual states that patrol members should be told that "they shall not carry weapons."
Jenna от 2020-10-16 17:17:05:
Will I have to work on Saturdays? doxepin 100 mg capsule "The current methods of management do not suit therequirements of the industry," said Miao Zhimin, vice-head ofthe raw materials department at the Ministry of Industry andInformation Technology (MIIT), responsible for the steel sector.